Komander CLI Manual

Configuration

The first thing you need to do after installing Komander CLI, is initializing the configuration and create a new context, by running:

komander config init

To edit it later, you can run:

komander config edit

Contexts

The Komander CLI can be configured to connect with multiple Komander instances using Contexts.

To know which context you are currently using, juts run komander context.

Create a context

komander context create <name>

Use a context

komander context use <name>

Delete a context

komander context delete <name>

.komander repository file

When creating or adding a repository to Komander, a .komander file gets created with the minimum information required by the CLI to function with defaults.

When running a Komander CLI command, it will look for a .komander file in the current folder. If present, it will parse it and use its values when needed, meaning that you can omit <project>, <environment>, <deployment> and <service> arguments if you've set them in the komanderfile. If you specify a parameter present in the komanderfile, it will use the one specified in the terminal.

The minimal komander file looks like this:

{
  "project": "",
  "repositoryId": ""
}

Defaults can be set using:

{
  "defaultEnvironment": "",
  "defaultDeployment": "",
  "defaultService": ""
}

Authentication

The Komander CLI communicates with your Komander Server to get information about your deployments, services etc.

To authenticate it, simply run komander login, which will open your browser to a login page. You will get a code that you need to copy back to your terminal.

You are now ready to run commands!

Cloning a repository

komander clone <project> <repository>

This will clone the repository to the repositories folder defined your komander config.

Start a deployment

komander deploy <project> <environment> <deployment> (--dry-run) (--build=<target>)

Or if you have set the proper defaults in your repository .komander file:

komander deploy

Options

--dry-run: Will only print the Docker Compose file or Kubernetes resource file that would be run, but doesn't deploy anything

--build=<target>: Force Docker to build a new image with the Dockerfile target to use. Only works if the environment provider is Docker (not Kubernetes)

Stop a deployment

komander undeploy <project> <environment> <deployment>

Run an application script

komander run <script> <project> <environment> <service>

Or if you have set the proper defaults in your repository .komander file:

komander run <script>

Note: scripts are defined in each repository's page on Komander.

Access the service shell

komander shell <project> <environment> <service>

Or if you have set the proper defaults in your repository .komander file:

komander shell

Bump a repository's tag

For now it only works with Cargo and NPM projects.

komander tag <major|minor|patch|exact=0.0.0>

It will change the version in the package.json or Cargo.toml file, then commit, create a git tag and push.