Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #102 from nodejitsu/jitsu

Jitsu command docs
  • Loading branch information...
commit 3e16a372a4f8d25e27ca685188752f6c8be2123d 2 parents 99f6db1 + b05b8df
@3rd-Eden 3rd-Eden authored
View
43 content/a-quickstart/faq.md
@@ -256,9 +256,52 @@ and only if everything went ok, so a failed deploy does not equate to down time.
---
+## Why is the subdirectory or its content not deployed to Nodejitsu?
+
+Execute `npm pack` inside your application and make sure that the resulting
+package includes the file. Nodejitsu uses the same command when deploying
+your app.
+
+In case it is not included in the package, you should look into your
+`gitignore` and/or `.npmignore` files to ensure that the folder or
+contained files are not ignored. Note that any files/folders starting with
+`.` like `.DS_Store` are ignored by default and some special ones like `.git`
+cannot be unignored since npm prevents that.
+
+To explicitly unignore a file use `!filename` inside either `.gitignore` or
+`.npmignore`.
+
+---
+
+## How can I change the name of my application?
+
+Changing the name is possible, however there's just one caveat. After the name
+change you will loose previous snapshots and other configured settings.
+
+To change the application name do `jitsu destroy`, confirm and finally redeploy
+with `jitsu deploy`. Both commands must be executed within the project folder.
+
+---
+
+## How can I use Socket.IO alongside a http server?
+
+We reroute all traffic to port 80. To use a http server and socket.IO over the
+same port, you need to tie socket.IO in http. [Socket.IO documentation][docs] will
+provide a clear example or try our demo app `jitsu install socket.io`.
+To give you a general idea of the logic:
+
+```
+var app = require('express')()
+ , server = require('http').createServer(app)
+ , io = require('socket.io').listen(server);
+
+server.listen(8080);
+```
+
## Can I write to the file system? What are the limits?
File system on our virtual machines is both readable and writable, but does not
persist across deploys. Capacity of the file system is 3 GB.
+[docs]: http://socket.io/#how-to-use
[meta:title]: <> (FAQ)
View
192 content/jitsu/apps.md
@@ -0,0 +1,192 @@
+# Manage your applications
+
+`jitsu apps` has commands to manage your application from top to bottom. Some
+commands have shorthand variants. Also commands that take a *name* parameter,
+if no parameter is supplied, jitsu will attempt to read the package.json from
+the current directory.
+
+## Deploy
+
+Deploy your application to our cloud, for full details see the shorthand in
+jitsu [deploy][deploy].
+
+```bash
+jitsu apps deploy
+```
+
+---
+
+## List
+
+To show all applications of the authenticated user, you can issue either of
+the following commands.
+
+```bash
+jitsu list # shorthand
+jitsu apps list # longhand
+```
+
+---
+
+## Create
+
+This command will prepare an application in our cloud based on the current
+[package.json][package]. However, unlike `jitsu deploy` it will not create a
+snapshot of your application also no drones will be appointed. This is
+particularly useful if you would like to claim a subdomain immediatly, even
+before your application is production ready. The moment your application is
+ready you can [deploy][deploy] to the subdomain with `jitsu deploy`.
+
+```bash
+jitsu apps create
+```
+
+---
+
+## View
+
+Inspecting the applications configuration in our cloud can be done with view,
+where *appname* is the application name you would like to inspect.
+
+```
+jitsu apps view [appname]
+```
+
+This command will provide relevant information about the available packages,
+databases and environment, like:
+
+```bash
+data: {
+data: engines: { node: '0.8.x' },
+data: drones: 1,
+data: dependencies: { ... },
+data: maxDrones: 1,
+data: mtime: '02/11 12:03:00 GMT+0100',
+data: active: { ... },
+data: repository: { type: 'git', url: 'xxx' },
+data: description: 'Hello world',
+data: snapshots: [ ... ],
+data: domains: [],
+data: user: [username],
+data: main: 'server.js',
+data: scripts: { start: 'node server.js' },
+data: subdomain: [subdomain],
+data: env: { SUBDOMAIN: [subdomain], NODE_ENV: 'production' },
+data: name: [appname],
+data: version: '0.3.0-2',
+data: databases: {},
+data: config: {},
+data: ctime: '02/11 11:37:07 GMT+0100'
+data: }
+```
+
+---
+
+## Update
+
+Updates the application in the current directory with the information in
+the [package.json][package] file. If *appname* is supplied the application
+with *appname* is updated.
+
+Note that it will always be updated to the package.json in the current
+directory. Use with caution, as the command is potentially harmful, e.g. you
+could overwrite an applications package.json with another applications
+package.json.
+
+```bash
+jitsu apps update [appname]
+```
+
+---
+
+## Destroy
+
+This command will completely remove your application and its snapshots from
+our cloud, free up the subdomain and used drones. Since this can be potentially
+destructive you will always be asked for confirmation, which defaults to `yes`.
+The shorthand is `jitsu destroy.`
+
+```bash
+jitsu apps destroy [appname]
+```
+
+---
+
+## Start
+
+Start your application with this command or use the shorthand `jitsu start`,
+for instance after you have [stopped](#stop) your application.
+
+```bash
+jitsu apps start [appname]
+```
+
+---
+
+## Restart
+
+Restarting an application is only possible if the current state is `started`. If
+the application is in a [stopped](#stop) state, simply use [start](#start). 500
+errors can usually be resolved with an application restart.
+
+```bash
+jitsu apps restart [appname]
+```
+
+---
+
+## Stop
+
+Stop your application with this command or use the shorthand `jitsu stop`.
+Stopping the application will free up the drone, so it can be used for
+another application. The running snapshot and subdomain of the stopped
+application are retained.
+
+```bash
+jitsu apps stop [appname]
+```
+
+---
+
+## Set number of drones per application
+
+Subscriptions authenticated to use multiple drones, for instance [individual
+small][pricing] can change the drone count per application. To change the
+drone usage by any of your applications use setdrones. *Number* is an integer
+lower than the maximum allowed by the subscription, 3 in this example.
+
+```bash
+jitsu apps setdrones [appname] [number]
+```
+
+---
+
+## Cloud
+
+Business subscriptions can control the cloud distribution of their application.
+Simply viewing the current provider, datacenter, number of used drones and ram
+can be done by using the first command. For more information about changing
+clouds, see [business plans][plans] documentation.
+
+```bash
+jitsu apps cloud [appname] # list cloud information
+jitsu apps cloud [name] <provider> <datacenter> [drones] # change cloud
+```
+
+Like most `apps` commands, cloud also has a shorthand. Querying for
+information by executing `jitsu cloud`, could provide the following results:
+
+```bash
+data: {
+data: datacenter: 'us-east-1',
+data: drones: 1,
+data: ram: 256,
+data: provider: 'joyent'
+data: }
+```
+
+[plans]: /features/business/
+[cloud]: /jitsu/cloud/
+[package]: /appendix/package-json/
+[deploy]: /jitsu/deploy/
+[meta:title]: <> (Manage applications)
View
71 content/jitsu/conf.md
@@ -0,0 +1,71 @@
+# Configuring jitsu
+
+To show your current jitsu configuration do `jitsu conf`. Results will contain
+information about our API location, your username and authentication token.
+*Username* and *token* have been removed from the example below but should
+contain details specific to your account.
+
+```bash
+data: {
+data: directories: {},
+data: userconfig: '/home/user/.jitsuconf',
+data: remoteHost: 'api.nodejitsu.com',
+data: username: '[username]',
+data: api-token: '[token]'
+data: api-token-name: '[tokenname]',
+data: rejectUnauthorized: false
+data: }
+```
+
+Changing any of the keys is possible through `jitsu config set [key] [value]`.
+For example, to change the `username` to any alternative username execute
+`jitsu config set username otherusername`. Note that the command for changing
+settings is `jitsu config` **not** `jitsu conf`!
+
+---
+
+## Command specific flags
+
+Jitsu also provides a myriad of different flags that can be appended to each
+command, here is a short overview.
+
+#### Release
+
+Appending `--release` or `-r` will allow you to specify a release version
+number or semantic increment, e.g: *build*, *patch*, *minor*, *major*. For
+example `jitsu deploy --release minor` will increment the minor version number
+(build version increment is default).
+
+#### Colors
+
+Changing color output is available through `--colors`. By default coloring of
+output is on, this can be disabled by appending `--no-colors`.
+
+#### Confirm
+
+If you are confident on jitsu actions you can prevent additional prompts to
+confirm actions by appending `--confirm` or `-c`.
+
+#### Alternative configuration
+
+Any alternative `jitsu` configuration can be loaded from file, without switching
+accounts.
+
+**Local and parent directories:** Append `--localconf`
+
+**Specified file location:** Append `--jitsuconf` or `-j` followed by file location.
+
+#### Version
+
+Useful for support questions and the like, aquire your current `jitsu` version
+by appending `--version` or `-v`.
+
+#### Skip analyzing
+
+Skipping dynamic dependency detection can be done by appending `--noanalyze`.
+
+#### Raw output
+
+If you need all `jitsu` output as raw JSON, e.g. for piping, append `--raw`.
+
+[meta:title]: <> (Configuration)
View
99 content/jitsu/databases.md
@@ -0,0 +1,99 @@
+# Using and managing databases
+
+Nodejitsu provides easy access to several third-party hosted databases. Included
+databases are, [MongoDB][mongo], [Redis][redis] and [CouchDB][couch]. Most
+databases have several providers, per example MongoHQ and MongoLab for MongoDB.
+All database available are free. For limitations check the provider. Database
+management is converned by the `jitsu databases` command.
+
+## Creating a database
+
+Provisioning a new database is as easy as executing
+`jitsu databases create [type] [name]` where *name* is an arbitrary chosen
+name. The name will be translated to an internal ID by the provider. The *name*
+will be used by Nodejitsu as reference for [listing databases](#listing-active-databases).
+*Type* should be a valid database type, e.g. `mongo`, `redis` or `couch`
+
+Executing `jitsu databases create mongo testname` will create a new
+[MongoDB][mongo] database at MongoLab, referenced by `testname`. Also you will
+be provided with details of the newly created database:
+
+```bash
+info: Welcome to Nodejitsu [username]
+info: jitsu v0.12.10, node v0.8.22
+info: It worked if it ends with Nodejitsu ok
+info: Executing command databases create mongo testname
+info: A new mongo has been created
+data: Database Type: mongo
+data: Database Name: testname
+data: Connection url: mongodb://[cred].mongolab.com:51947/[dbname]
+help:
+help: Connect with the `mongo` cli client:
+help:
+ $ mongo [domain].mongolab.com:51947/[dbname] -u nodejitsu_[username] -p [pw]
+help:
+help: Connect with the `mongodb-native module`:
+help:
+ var mongodb = require('mongodb');
+ var db = new mongodb.Db('nodejitsu_[dbname]',
+ new mongodb.Server('[domain].mongolab.com', 51947, {})
+ );
+ db.open(function (err, db_p) {
+ if (err) { throw err; }
+ db.authenticate('nodejitsu_[username]', '[pw]', function (err, replies) {
+ // You are now connected and authenticated.
+ });
+ });
+help:
+help: Connect with the `mongoose` module:
+help:
+ var mongoose = require('mongoose');
+ mongoose.connect('mongodb://[cred].mongolab.com:51947/[dbname]');
+help:
+info: Nodejitsu ok
+```
+
+Note that *domain*, *dbname*, *username*, *cred* and *pw* are replaced with actual
+credentials and details on how to connect with your new MongoDB.
+
+---
+
+# Listing active databases
+
+To show all databases simply execute `jitsu databases list`, which will provide
+an overview of all your databases. Here is an overview of data returned from the
+[created](#creating-a-database) `testname` database:
+
+```
+data: Database Type: mongo
+data: Database Name: testname
+data: Connection url: mongodb://[cred].mongolab.com:51947/nodejitsu_[dbname]
+info: Nodejitsu ok
+```
+
+---
+
+## Details of database
+
+If you lost details and/or credentials of a single database and would like
+to retrieve those, simply execute `jitsu database get [dbname]`. Where *dbname*
+is the unique database name, per example `testname` as used
+[above](#listing-active-databases). Note that *dbname* is required, otherwise you
+will receive a warning.
+
+---
+
+## Destroying database instance
+
+Databases for which you have no use any longer can be destroyed. However, this
+will delete all data without means of retrieval. Make sure you backed-up any
+data in database. You will be prompted to continue (defaults to yes) before
+any database is deleted. To delete a database, use `jitsu databases destroy
+[dbname]`. As with [aquiring](#details-of-database) database details, *dbname*
+entry is required. If the database was destroyed properly
+`info: Database was deleted` will be returned.
+
+[mongo]: http://www.mongodb.org/
+[redis]: http://redis.io/
+[couch]: http://couchdb.apache.org/
+[meta:title]: <> (Database control)
View
138 content/jitsu/deploy.md
@@ -0,0 +1,138 @@
+# Deploying your application
+
+Deploying your application is easy, it should only take a few seconds.
+`jitsu deploy` can be executed from the root of the application. This is where
+the *package.json* is located. Deployment will iterate through the following
+steps.
+
+1. Creates the application (if necessary)
+2. Creates or validates the package.json
+3. Packages and creates a new snapshot
+4. Stops the application (if necessary)
+5. Starts the application
+
+If you deploy for the first time, you'll be prompted for a subdomain and
+confirm the changes to [package.json][package]. By default your username will be
+prepended before the application name. After a succesful deploy `Nodejitsu ok`
+will be returned.
+
+```
+info: Welcome to Nodejitsu [user]
+info: jitsu v0.12.8, node v0.8.22
+info: It worked if it ends with Nodejitsu ok
+info: Executing command deploy
+warn:
+warn: The package.json file is missing required fields:
+warn:
+warn: Subdomain name
+warn:
+warn: Prompting user for required fields.
+warn: Press ^C at any time to quit.
+warn:
+prompt: Subdomain name: (subdomain)
+warn: About to write /var/www/test/helloworld/package.json
+...
+prompt: Is this ok?: (yes)
+info: Skipping require-analyzer because noanalyze option is set
+info: Checking app availability nodeapps-helloworld
+info: Creating app nodeapps-helloworld
+info: Creating snapshot 0.2.2
+info: Uploading: [=============================] 100%
+info: Updating app nodeapps-helloworld
+info: Activating snapshot 0.2.2 for nodeapps-helloworld
+info: Starting app nodeapps-helloworld
+info: App nodeapps-helloworld is now started
+info: http://subdomain.nodejitsu.com on Port 80
+info: Nodejitsu ok
+```
+## Repeated deployments
+
+After an initial deploy you can redeploy as often as you would like. Note
+however that `jitsu` will ask to increase the package build version, e.g the
+`x` in `0.0.z-x` will be incremented. A manual increase of the patch `z`
+version will skip the step below and immediatly deploy your application.
+
+```
+info: Welcome to Nodejitsu [user]
+info: jitsu v0.12.8, node v0.8.22
+info: It worked if it ends with Nodejitsu ok
+info: Executing command apps deploy
+info: Skipping require-analyzer because noanalyze option is set
+info: Skipping require-analyzer because noanalyze option is set
+warn: Local package version appears to be old
+warn: The package.json version will be incremented automatically
+warn: About to write /var/www/test/helloworld/package.json
+...
+data: version: '0.2.2-1',
+...
+prompt: Is this ok?: (yes)
+```
+
+You can also do `jitsu deploy --release patch` to force `jitsu deploy` to
+increase the patch version number. For more fine-grained versioning control
+see [jitsu config --release][release].
+
+## Hooks
+
+Applications can required certain tasks to be done for before or just after
+deployment. For these repetitive tasks we offer pre and post deploy hooks. Hooks
+are scripts that perform some required tasks before starting your application.
+Per example:
+
+```javascript
+{
+ "name": "test-app",
+ "subdomain": "test-app",
+ "scripts": {
+ "predeploy": "echo This will be run before deploying the app",
+ "postdeploy": "echo This will be run after deploying the app",
+ "start": "app.js"
+ },
+ "engines": {
+ "node": "0.6.x"
+ },
+ "version": "0.0.0"
+}
+```
+
+Deploying an application with these deploy hooks, would result in:
+
+```bash
+info: Welcome to Nodejitsu
+info: It worked if it ends with Nodejitsu ok
+info: Executing command deploy
+info: Analyzing your application dependencies in app.js
+info: Checking app availability test-app
+info: Creating app test-app
+This will be run before deploying the app
+info: Creating snapshot 0.0.0
+info: Updating app test-app
+info: Activating snapshot 0.0.0 for test-app
+info: Starting app test-app
+info: App test-app is now started
+info: http://test-app.jit.su on Port 80
+This will be run after deploying the app
+info: Nodejitsu ok
+```
+
+## Continuous integration
+
+Nodejitsu also supports continuous integration (CI) for deployments. For more
+information about CI check the [getting started page][gettingstarted] or
+relevant [handbook section][handbook].
+
+## What is deployed
+
+Deploy will normally include all files, excluding the *node_modules* directory.
+The content that is deployed is dependant on `npm pack`. This command is
+executed by `jitsu deploy` and governs the snapshots we use for deployment.
+`npm pack` by default ignores files and folders starting with an dot, e.g.
+*.DS_Store*. In addition, it also takes *.gitignore* and *.npmignore* into
+account. More information about this subject can be found in the [FAQ][faq].
+
+[release]: /jitsu/config/#release
+[faq]: /a-quickstart/faq/#why-is-the-subdirectory-or-its-content-not-deployed-to-nodejitsu
+[handbook]: /features/webhooks/
+[gettingstarted]: https://www.nodejitsu.com/getting-started-with-github/
+[package]: /appendix/package-json/
+[meta:title]: <> (Deploying apps)
View
99 content/jitsu/env.md
@@ -0,0 +1,99 @@
+# Environment control
+
+Jitsu offers full control over the environment of your application. It is very
+easy to change environment variables. Although environment variables are usually
+written in uppercase, all commands are case-sensitive. Make sure you use the
+proper capitalization when executing commands.
+
+## Changing specific variables
+
+Any environment variable can be changed using the `get` and `set` methods of
+`jitsu env`. For instance if you'd like to view the value of *NODE_ENV*, simply
+do `jitsu env get NODE_ENV`. This will return results as:
+
+```
+data: NODE_ENV production
+```
+
+Changing *NODE_ENV* to staging in stead of the default production is done by
+calling `jitsu env set NODE_ENV staging`. Environment variables changes will
+come into effect after a [restart][restart].
+
+---
+
+## List current variables
+
+By default Nodejitsu sets some environment variables for your application to
+work. Inspecting the current variables is done using `jitsu env list [appname]`,
+where *appname* is optional. Listing after a fresh [deploy][deploy] would look
+like below. Both *SUBDOMAIN* and *NODE_ENV* are predefined for you.
+
+```
+info: Listing all environment variables for testname
+data: { SUBDOMAIN: 'testname', NODE_ENV: 'production' }
+info: Nodejitsu ok
+```
+
+---
+
+## Saving or loading
+
+At any point you might want to save the environment variables to a local
+JSON file. This could be handy for later use or porting to another
+application. The JSON will be saved to a filename/location of your choosing.
+Execute `jitsu env save [appname] [filename]`, where *appname* can be omitted.
+If only *filename* is supplied, `jitsu` will save the configuration of the
+application in the current directory.
+
+Before saving you will be prompted if you are sure that you want to save
+sensitive data. If so, make sure that destination directory is writable.
+Also the destination will overwriten without additional confirmation, double
+check if the *filename* is unique. Resulting JSON per example:
+
+```javascript
+{
+ "SUBDOMAIN": "testname",
+ "NODE_ENV": "production"
+}
+```
+
+You can load any saved/predefined configuration by issuing `jitsu env load
+[appname] [filename]`. Again, omitting *appname* will write *filename* content
+to the application in the current directory. Before content is written you will
+be presented with current environment variables and need to confirm:
+
+```bash
+info: Old environment variables:
+data: { SUBDOMAIN: 'testname', NODE_ENV: 'production' }
+info: New environment variables:
+data: { SUBDOMAIN: 'testname', NODE_ENV: 'production' }
+warn: YOU CAN LOSE ENVIRONMENT VARIABLES IF YOU ARE NOT CAREFUL.
+info: Is this okay?
+prompt: yes/no: (yes)
+```
+
+---
+
+## Deleting any or all environment variables
+
+Completely clearing an applications environment is possible, but should be
+done with caution. As this will also delete predefined variables like
+*SUBDOMAIN*. The usecase for a complete wipe, would be writing a
+[load file](#saving-or-loading) after. Clearing the enviroment against the
+current application can be done by `jitsu env clear`.
+
+More fine grained control is available trough `jitsu env delete [key]`, where
+*key* is required. For example, deleting `START` from configuration would be
+done by executing `jitsu env delete START`. Note you will *NOT* be prompted
+to confirm.
+
+```javascript
+{
+ "SUBDOMAIN": "testname",
+ "START": "file.js",
+ "NODE_ENV": "production"
+}
+```
+[restart]: /jitsu/apps/#restart
+[deploy]: /jitsu/deploy/
+[meta:title]: <> (Environment)
View
114 content/jitsu/index.md
@@ -0,0 +1,114 @@
+# Jitsu
+
+Jitsu is a Command Line Tool (CLI) for managing and deploying Node.js
+applications. It's open-source and easy to use. We've designed jitsu to
+be suitable for command line beginners, but still be powerful and
+extensible enough for production usage. Jitsu's commands are available as user
+interface in [webops][webops]. Jitsu day to day use:
+
+* [Login](#login)
+* [Logout](#logout)
+* [Deploy management](#additional-commands)
+
+## Install and first time use
+
+Before using Jitsu a quick and easy installation is required. If required you
+can signup after. `npm` is required for installing the `jitsu` package.
+
+```bash
+[sudo] npm install jitsu -g
+```
+
+If you prefer using git repositories over the package you can also install
+`jitsu` by cloning the repository and linking with npm after. This would also
+allow you to contribute to jitsu more easily.
+
+```bash
+git clone git@github.com:nodejitsu/jitsu.git
+[sudo] npm link
+```
+
+## Sign up
+Most of you will sign up to Nodejitsu by using our [web interface][webops] or
+by using the [signup form][signup]. If you prefer signing up on the command
+line however, execute:
+
+```bash
+jitsu signup
+```
+
+Choose your preferred username and provide a password. If your username is
+already taken you will be provided with adequate feedback. Make sure you enter a
+valid e-mail address.
+
+## Login
+
+Before accessing our API through jitsu a login is required. You will be prompted
+to provide you username and password. Your password will be hidden, e.g. if you
+type you'll not see any characters. Don't worry it is working as intended. After
+your logged in every command you execute with `jitsu` is against your account.
+
+```bash
+jitsu login
+```
+
+After providing the correct credentials you should see
+
+```bash
+info: Authenticated as [username]
+info: Nodejitsu ok
+```
+
+## Logout
+
+If you would like to switch between users or make sure you logged out, for
+instance when you're on a public device, simply execute
+
+```bash
+jitsu logout
+```
+
+## Demo
+
+We reduced the hurdle of the first step by preparing some demo applications.
+To try one make sure you are in a writable directory, e.g. your home folder.
+See below for an example of installing the helloworld demo server. If you would
+like to choose another demo, simply type `jitsu install`
+
+```bash
+jitsu install helloworld
+```
+
+If you receive an `EACCES` error the current directory is not writable for
+jitsu. If all goes well, you will be prompted to start the application, by
+default the server will be listening to *port 8080*. To check the results
+visit *http://localhost:8080/*. If you get an `EADDRINUSE` error the *port 8080*
+is already in use. Close the other application before starting the helloworld
+demo.
+
+This application is running locally, see [deploying][deploy] under
+additional commands to get it running on our cloud.
+
+## Additional commands
+
+Jitsu is a very powerful tool with numerous additional tools. See more
+documentation about:
+
+* [Deploying][deploy]
+* [Managing application](/jitsu/apps/)
+* [View the logs](/jitsu/logs/)
+* [Environment control](/jitsu/env/)
+* [Manage snapshots](/jitsu/snapshots/)
+* [Jitsu configuration](/jitsu/conf/)
+* [User management](/jitsu/user/)
+* [Manage databases](/jitsu/databases/)
+* [Control your tokens](/jitsu/tokens/)
+
+*Useful commands for business plans*
+
+* [Your cloud](/features/business/)
+
+[deploy]: /jitsu/deploy/
+[signup]: https://www.nodejitsu.com/signup/
+[webops]: https://webops.nodejitsu.com/
+[meta:title]: <> (Jitsu CLI)
View
66 content/jitsu/logs.md
@@ -0,0 +1,66 @@
+# Viewing application logs
+
+Logging is critical for application management. Good logs will make the life of
+a developer easier. For instance, if your application stopped working checking
+the logs before calling [support][suppprt] is the way to go. `jitsu logs` can be
+used in a variaty of ways. Executing this command from inside a project folder
+containing a [package.json][package] will show logs for the current project. If
+no logs are generated yet `jitsu logs` will return `No logs for [appname] in
+specified timespan`.
+
+Running the command outside a project folder will show a list the authenticated
+users' applications. You will be prompted for which application you would like
+to show the logs. Supplying the *appname* will show the respective logs.
+
+```bash
+info: Welcome to Nodejitsu [username]
+info: jitsu v0.11.6, node v0.8.14
+info: It worked if it ends with Nodejitsu ok
+info: Executing command logs app
+info: Listing all apps for [username]
+data: name state subdomain drones running snapshot
+data: [appname] started [subdomain] 1/3 apps-xxx-0.x.x-xx.tgz
+data: [appname] started [subdomain] 1/3 apps-xxx-0.x.x-xx.tgz
+data: [appname] started [subdomain] 1/3 apps-xxx-0.x.x-xx.tgz
+
+info: Which application to view logs for?
+prompt: app name:
+```
+
+## Per application
+
+Application logs can also be aquired by specifing the application name on the
+CLI. `jitsu logs app [appname]` will show the logs for application *appname*.
+To reduce output, execute `jitsu logs app [appname] [n]` where *n* is an
+integer. If you stored another account in a local configuration file, you could
+access your applications easily without switching accounts by doing:
+
+```bash
+jitsu logs app [username]/[appname] -j $HOME/.userconf
+```
+
+Note the slash between *username* and *appname*. Also *$HOME* should point to the
+location where the configurations are stored, by default this would be your home
+folder.
+
+## Per user
+
+Can't choose which logs to view or if you want to do general monitoring, you
+can show all logs at once by issuing `jitsu logs all`. This will show the logs
+for all applications of the authenticated user. Users with several applications
+might prefer to reduce the number of lines returned. Execute `jitsu logs all [n]`,
+where *n* is an integer. To show a maximum of 10 lines per application, use:
+
+```bash
+jitsu logs all 10
+```
+
+## Additional useful options
+
+If you would like to pipe log output to another script/service you can use the
+`--raw` option. This will output the logs as line-delimited raw JSON. Also
+`--no-colors` will disable coloring of the log output.
+
+[package]: /appendix/package-json/
+[support]: /support/
+[meta:title]: <> (Viewing logs)
View
71 content/jitsu/snapshots.md
@@ -0,0 +1,71 @@
+# Working with snapshots
+
+The `jitsu snapshots` command manages snapshots for applications on Nodejitsu.
+Snapshots are images of the applications code that is deployed to the
+Nodejitsu Platform. You can compare snapshots to tarballs or zipped content.
+For commands that take a *appname* parameter, if no parameter is supplied,
+jitsu will attempt to read the [package.json][package] from the current directory.
+
+## List all snapshots
+
+To show a list of all snapshots, simply do `jitsu snapshots list [appname]`. The
+list is chronological in descending order. The latest snapshot will be listed as
+active. Results should be something like below:
+
+```bash
+data: name status created md5
+data: 0.2.0-2 archived 08/25 02:18:46 GMT+0200 aec8c128dc140ae55a502f013f1c0a19
+data: 0.2.0-3 archived 08/25 02:30:01 GMT+0200 74015351d37add683d77f5993fca10e7
+data: 0.2.0-4 active 08/25 03:07:28 GMT+0200 e273917229236e3fbcc62a8e4408b169
+```
+
+## Activating a specific snapshot
+
+If you need to revert to an older state quickly you can simply activate an older
+snapshot. Making `jitsu snapshots activate [appname]` perfect for crisis
+management. Active will also start the snapshot for you, so you can work
+continue work on a fix right after. In the example below `0.3.0-1` will be
+activated.
+
+```
+data: 0.3.0-1 archived 02/11 11:58:02 GMT+0100 2091668dafe62815dd7afa88ad021e2e
+data: 0.3.0-2 active 02/11 12:02:59 GMT+0100 ad8ed5121c03302d61d885de65f00298
+prompt: Snapshot Name: 0.3.0-1
+```
+
+## Grabbing snapshots from the cloud
+
+You can download any snapshot to inspect or modify it. The snapshot might
+provide insight in any error or failure. For instance, if a [directory][deploy] is
+unintentionally [not included][missing] in the snapshot. Grabbing a snapshot,
+changing code and redeploying is possible, but Nodejitsu recommends using
+[git][git] for code management, as it will improve your workflow.
+
+To get a snapshot from the cloud use `jitsu snapshots fetch [appname]`. You will
+be prompted to enter the snapshot name. Snapshot names are equal to the version
+at deployment. In the example below, the *snapshot name* would be `0.2.0-2`
+
+```
+data: 0.2.0-2 archived 08/25 02:18:46 GMT+0200 aec8c128dc140ae55a502f013f1c0a19
+```
+
+## Removing snapshots
+
+This command is potentially harmful and should be used with caution. Destroy
+will remove any snapshot of your choosing but cannot be undone.
+
+`jitsu snapshots destroy [appname]` will ask you if you want to proceed
+initially, after you will be prompted to supply the *snapshot name*. In the
+example below, the *snapshot name* would be `0.3.0`
+```
+data: 0.3.0 archived 02/11 11:38:22 GMT+0100 0bfc425bff1ddc845036786f1b82b9c2
+```
+
+This snapshot will be permanantly removed, without means of recovery. Make sure
+you do not remove your active snapshot as this will kill your running application.
+
+[git]: http://www.github.com/
+[deploy]: /jitsu/deploy/#what-is-deployed
+[missing]: /a-quickstart/faq/#how-can-i-change-the-name-of-my-application
+[package]: /appendix/package-json/
+[meta:title]: <> (Application snapshots)
View
27 content/jitsu/tokens.md
@@ -0,0 +1,27 @@
+# Tokens
+
+Token management for your accounts is available through `jitsu tokens *`.
+Listing all available tokens, can be done with `jitsu tokens list [username]`,
+where *username* is optional. You will be prompted to enter the password of the
+account your trying to list the tokens for, per example:
+
+```
+info: Welcome to Nodejitsu
+info: jitsu v0.12.10, node v0.8.22
+info: It worked if it ends with Nodejitsu ok
+info: Executing command tokens list [username]
+info: Listing all tokens for [username]
+prompt: password:
+data: name token
+data: tokenname1 4b7df949-1c21-4b70-8770-2c5615bc1d9a
+data: tokenname2 5116b717-988c-467c-8ae4-ae49896e8a3a
+info: Nodejitsu ok
+```
+
+Adding a token to an account can be done with
+`jitsu tokens create [username] [token name]`, where *token name* is a unique
+chosen identifier/name. Removing a token is done by issuing `jitsu tokens
+destroy [username] [token name]`. In the example above *token name* could be
+`tokenname1` or `tokenname2`.
+
+[meta:title]: <> (Tokens)
View
80 content/jitsu/user.md
@@ -0,0 +1,80 @@
+# Account management
+
+Account management can be done from the CLI by using `jitsu users`. The
+following commands are at your disposal to change account details.
+
+---
+
+## Usernames
+
+**Who Am I?**
+
+To check the current authenticated account name, do `jitsu users whoami`. The
+response should read as below where *username* is the current logged in
+account name.
+
+```
+info: You are: [username]
+```
+
+**Is a new account name available?**
+
+Account name availability for a new account can be checked with `jitsu users
+available [username]` where *username* is the name of your choice. The feedback
+should contain either:
+
+```
+info: Username [username] is not available // or
+info: Username [username] is available
+```
+
+---
+
+## Passwords
+
+**Change your password**
+If you would like to change your current password, make sure you are logged in
+with the right user. Changing your password can be done by calling
+`jitsu users changepassword`. You will be prompted to enter a new password first
+and to confirm it after, like so:
+
+```
+info: Welcome to Nodejitsu [username]
+info: jitsu v0.12.8, node v0.8.22
+info: It worked if it ends with Nodejitsu ok
+info: Executing command users changepassword
+prompt: password:
+prompt: confirm password:
+```
+
+**Lost your password?**
+
+Losing your password is cumbersome, but we provide easy recovery through
+`jitsu users forgot [username]`. Where *username* is your account name for which
+you would like to recover the password. You should receive an e-mail on e-mail
+address known to Nodejitsu. The e-mail will provide instructions to complete
+recovery. To reset your password run the following jitsu command:
+
+```
+jitsu users forgot [username] [handshake]
+```
+
+This command can be copy-pasted from the e-mail. The *handshake* is the
+unique identifier temporarily bound to your account to reset your password.
+After entering above command you will be prompted to enter your new password.
+
+---
+
+## Account control
+
+Login, logout and signup can both be done shorthand and through `jitsu users`.
+For more details see [Jitsu CLI][main]
+
+```
+jitsu users create // signup
+jitsu users login // login
+jitsu users logout // logout
+```
+
+[main]: /jitsu/#sign-up
+[meta:title]: <> (User management)
View
2  package.json
@@ -2,7 +2,7 @@
"author": "Nodejitsu <support@nodejitsu.com> (http://nodejitsu.com)",
"name": "handbook",
"description": "A gentle introduction to the art of nodejitsu",
- "version": "0.4.2",
+ "version": "0.4.3",
"subdomain": "handbook",
"homepage": "http://www.nodejitsu.com/docs",
"repository": {
Please sign in to comment.
Something went wrong with that request. Please try again.