Syncano CLI
![codecov](https://codecov.io/gh/Syncano/syncano-node-cli/branch/devel/graph/badge.svg?token=HDMlBF4FkF)
:fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire:
WARNING
syncano-cli is currently under heavy active development. The application is not stable and new versions
tagged as beta
might introduce breaking changes. Do not use for purposes other than review and testing.
You have been warned!
:fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire::fire:
Node version prerequisite
Not older than
![NODE](https://img.shields.io/badge/npm-v4.6.7-blue.svg)
Installation
$ npm install
$ npm run build
$ npm install -g
To run it
$ syncano-cli
Usage: cli [options] [command]
Commands:
init [options] init project
socket Manage sockets
hosting Manage hosting
sync synchronize configuration
help [cmd] display help for [cmd]
Options:
-h, --help output usage information
Initialize an instance
$ syncano-cli init
$ syncano-cli init --instance <existing_instance_name>
Welcome to Syncano (syncano.io)
Please login or create an account by entering your email and password:
Instance has been created
Creating Syncano Instance... Done
Setting up config files... Done
Add a Hosting
$ syncano-cli hosting add
$ syncano-cli hosting add [path_to_hosting_files]
If you don't specify path in command, you will be able to choose one from select list.
This action allow only to add new hosting to your project. After that you should synchronize your local files
with remote files on hosting.
List hostings
$ syncano-cli hosting list
Example response:
Your hosting containers:
name: hello
url: https://hello--morning-wood-4770.syncano.site
List installed sockets
$ syncano-cli socket list
Example response:
socket: test
description: Test Socket
endpoint: test/hello
description: Hello world!
path: https://morning-wood-4770.syncano.space/test/hello/
Full info about socket
$ syncano-cli socket info test
Example response:
socket: hello
description: Test Socket
endpoint: test/hello
description: Hello world!
path: https://morning-wood-4770.syncano.space/test/hello/
name: lastname
description: Last name of the person you want to greet
example: Durden
name: firstname
description: First name of the person you want to greet
example: Tyler
response: text/plain
description: Success
exit code: 200
example: Hello Tyler Durden!
description: Failed
exit code: 400
example: No first name or last name provided :(
Environment variables
During Continues Integration process it is easier to configure your project and access to your Syncano Instance using environment variables. Setting those variables you can override settings from ~/.syncano.yml
file and default Syncano API hostname:
CLI is checking those variables:
SYNCANO_HOST
- API host (usually api.syncano.io)SYNCANO_PROJECT_INSTANCE
- Syncano instance for a projectSYNCANO_AUTH_KEY
- Account API Key (you can find it in dashboard or by logging in using API)
Tests
CLI is provided with Unit tests in Mocha.
To run them:
npm run unit
To watch for changes:
npm run unit:watch
To make sure you have your environment ready
npm run validate