The Cloud9 CLI

The Cloud9 Command Line Interace (or CLI) provides a way to interact with the cloud9 platform. It has a pluggable architecture and the goal is to extend the cli with functionality that makes it easy to interact with all aspects of the cloud9 platform. Currently it has plugins to publish, build and install packages and to open files from the command line.

installation

c9 comes preinstalled on hosted cloud9 workspaces. To install it on other computers run

npm install -g c9

c9 --help

The c9 --help command will list usage information.

The Cloud9 CLI.
Usage: c9 [--verbose] <command> [<args>]

The most commonly used c9 commands are:
    build       Builds development version of package to load in non-debug mode.
    list        Lists all available packages.
    open        Opens a file or directory.
    restart     Restarts the currently running Cloud9

Options:
  --verbose, -v  Output more information  [default: false]

Each command has usage information of it's own. Type c9 <command> --help to get a listing of usage information for that command.

c9 build

The c9 build builds a package without publishing it. Use the --devel flag to build a version that is not packed and can be used for testing the package with uncompressed files.

The Cloud9 CLI.
Usage: c9 build [--help] [--devel]

Options:
  --help, -h   Output help information
  --devel, -d                           [default: false]
    publish     Publishes a cloud9 package.
    unpublish   Disables a cloud9 package.
    install     Installs a cloud9 package.
    remove      Removes a cloud9 package.
    
# c9 publish

The `c9 publish` command builds and then publishes the current directory as a package to the c9.io repository to make it available in the Cloud9 Package Browser. Learn more about publishing packages in [this guide](doc:publishing-packages).

```
The Cloud9 CLI.
Usage: c9 publish [--help] [--verbose] [--force] [ | major | minor | patch | build]

Options:
  --verbose, -v  Output more information               [default: false]
  --force, -f    Ignore warnings                       [default: false]
  --dry-run      Only build a test version             [default: false]
  --tag, -t      Create git tag for published version  [default: false]
  --help, -h     Output help information             
```


# c9 unpublish

The `c9 unpublish` command disables a plugin in the package browser. It doesn't uninstall the plugin from workspaces that already have it installed.

```
The Cloud9 CLI.
Usage: c9 unpublish [--help] [--verbose]

Options:
  --verbose, -v  Output more information  [default: false]
  --help, -h     Output help information
```

# c9 list

The `c9 list` command lists the plugins published to the c9.io repository. This is a temporary plugin available during the alpha of the SDK. The `--json` flag outputs a list of json objects with the public information describing the packages.

```
The Cloud9 CLI.
Usage: c9 list [--help] [--json]

Options:
  --help, -h  Output help information
  --json                               [default: false]
```

# c9 install

The `c9 install` command installs packages into a workspace, the SDK and [desktop version of Cloud9](doc:running-cloud9-desktop). The `--local` flag installs a package locally without registering it in the database.The `--global` flag installs a package for all workspaces on c9.io. The `--debug` flag clones repositories from open source packages to edit and debug them. Learn more about publishing packages in [this guide](doc:installing-packages).

```
The Cloud9 CLI.
Usage: c9 install [--help] [--verbose] [--force] [--global] [--local] [--debug] [[@] | . ]

Options:
  --verbose, -v  Output more information  [default: false]
  --force, -f    Ignore warnings          [default: false]
  --help, -h     Output help information
  --local                                 [default: false]
  --global                                [default: false]
  --debug                                 [default: false]
  --package                               [default: false]
```

# c9 remove

The `c9 remove` command uninstalls packages. Similarly to `c9 install` you can uninstall them `globally` and `locally` as well.

```
The Cloud9 CLI.
Usage: c9 remove [--help] [--verbose] [--global] [--local] 

Options:
  --verbose, -v  Output more information  [default: false]
  --help, -h     Output help information
  --local                                 [default: false]
  --global                                [default: false]
```

c9 open

The c9 open command opens files and directories in the IDE.

The Cloud9 CLI.
Usage: c9 open [--help] [--wait] <path>

Options:
  --wait      Wait until the file(s) are closed  [default: false]
  --help, -h  Output help information          

c9 restart

The c9 restart command is used for the Cloud9 Desktop and will restart a running instance.

The Cloud9 CLI.
Usage: c9 restart [--help]

Options:
  --help, -h  Output help information