Skip to content

NativeSync/nativesync-cli

Repository files navigation

NativeSync CLI Tool

Build NativeSync apps on the command line!

Installation and Setup

How do I get started?

Install from rubygems (Recommended)

  1. gem install nativesync_cli

Install from the repo (requires rake and bundler).

  1. Clone the repo.
  2. rake build
  3. rake install (Requires root privileges).

You now have access to the ns command.

Required Gems

If you install from rubygems then you will not need to install these required gems yourself. The gem package manager will attempt to install the proper versions for you.

  1. thor >= 0.17.0 and < 0.19
  2. json >= 1.7.7 and < 1.8
  3. rest-client >= 1.6.7 and < 1.7

Required system packages

  1. ruby-devel
  2. make
  3. gcc

How can I add the repo bin path to my environment PATH variable?

Place it in your ~/.bash_profile file. You should end up with something like this: export PATH=$PATH:/path/to/nativesync-cli/repo/bin/

How to use (Commands)

before you can use the nativesync CLI, you must first login:

ns init

This will create a file called .nativesync which will contain your API key for later API calls.

After that, you can do any call in the NativeSync system with the following template:

ns <service_name> <function_name> [--credentials_name=<credentials identifier>] [--input-file=<path>] [--output-file=<path>] [<args>]

input-file specifies a path to a JSON-encoded file that the ns tool will receive the input data from.

Alternatively, you can specify key-value pairs that will input to your function

Example:

ns nativesync example_function --foo=bar --hello=world

If an argument needs to be loaded from a file, specify a file extension in your argument.

Example:

ns nativesync create_cloud_function --program=my_function.js --function-name=my_test_function schedule="* * * * * *"

Issues

If you encounter issues with this project, please open a github support ticket.

Contributing changes

I welcome all contributions. If you would like to include a new feature or bug fix, simply open a pull request and explain the problem or feature you contributed. I will review the contribution at that point. Feel free to contact nick@nativesync.io with contribution ideas.

License

See LICENSE file.

Thanks

Many thanks to the people at gitlab for releasing their CLI open source, I used their CLI tool as a template for this project. https://github.com/drewblessing/gitlab-cli

About

Use NativeSync from the command line!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published