Aidbox CLI
First, create an account on https://aidbox.io.
Now you need to install aidbox-cli utility globally. Also you may need to install coffee-script.
$ sudo npm install -g aidbox-cli$ aidbox vOK: v0.5.15
Logging In and Out
Let's log in your aidbox.io account throught the aidbox-cli utility:
$ aidbox loginLogin: <enter your login>Password: <enter your password>OK: Auth success
Then try to log out:
$ aidbox logoutOK: Now you are logged outOK: All session data has been removed
Also you can log in via inline style
$ aidbox login <email> <password>OK: Auth success
Getting Started
In order to start working with Aidbox, you have to do 3 things:
- Create a box, which will host your application.
- Create an implicit client, on behalf of which deploy and authorization will be performed.
- Create users of the box.
Box
box is a command for managing boxes. By means of this command it's possible to create new boxes, view a list of all existing boxes, switch between boxes, delete boxes and so on.
To view a list of all possible subcommands, execute:
$ aidbox box helpbox -- Display current boxbox new <boxname> -- Create new box with specified <boxname>box list -- Display all available boxesbox use <boxname> -- Switch current box to <boxname>box destroy -- Destroy current box [!not ready yet!]
Box Commands
box
Outputs your current box:
$ aidbox boxOK: Your current box is [boxname]
box new
Creates a new box. After creation of a new box, you will be automatically switched to the newly created box context. It means that all futher operations, such as creating users, clients, deploy, etc will be done in this box.
$ aidbox box new <boxname>INFO: Create new box [boxname]OK: Box [boxname] has been createdOK: Current box has been switched to [boxname]
box list
Outputs a list of all available boxes.
$ aidbox box listOutputs a list of all available boxes with their IDs and hosts. For now it's a raw JSON.
box use
Switches a context of command execution to a specified box.
$ aidbox box use <other-box>OK: Current box has been switched to box [other-box]
box destroy - not ready yet
Deletes current box.
$ aidbox destroy; Not ready yet
User Commands
user is a command for working with users in current box. To view a list of all available subcommands, execute:
$ aidbox user helpuser list -- Display a list of users in current boxuser help -- Show help informationuser new -- Create a user via wizarduser new email:password -- Create a user inline
user list
Outputs a list of all users in current box.
$ aidbox user listINFO: Display a list of users in box [boxname]; For now it displays raw JSON
user new
Creates a new user using a wizard, in current box.
$ aidbox user newINFO: Create new user in box [boxname]Email: <test@gmail.com>Password: <password>OK: User [test@gmail.com] has been successfully created in box [boxname]
Another command to create a user inline without a wizard, has the following syntax:
aidbox user new email:password
$ aidbox user new test_2@gmail.com:passwordINFO: Create new user in box [boxname]OK: User [test_2@gmail.com] has been successfully created in box [boxname]
deploy
deploy command deploys your application to a box. By default it deploys content of the dist
folder in the root of your application. You can specify the folder to be depoyed in a box, as well. For example, it can be public
, build
, etc.
$ aidbox deploy buildINFO: Compress you app...INFO: Publish app...OK: You application has been successfully uploaded in box [boxname]OK: Temp files have been removed
Example Workflow
Here is a typical development workflow. Let us suppose there are two boxes dev-myapp and prod-myapp. Currently you are working in dev-myapp box. When you want to deploy your application on prod-myapp, all you need is to swich context to prod-myapp, execute deploy operation in prod-myapp, come back to dev-myapp and continue development.
Thus, a workflow for two boxes dev-myapp and prod-myapp may look like:
$ aidbox login$ aidbox box new dev-myapp$ aidbox box new prod-myapp$ aidbox box use dev-myapp; Some actions for the development of an application; Writing code, building application, testing; Now you need to deploy your application to dev-myapp box; and nake sure eerything is working$ aidbox box$ adibox deploy; If everything works as intended, you can deploy application to prod-myapp box$ aidbox box use prod-myapp$ adibox deploy; Return back into dev-myapp box$ aidbox box use dev-myapp; And continue development