<commit_before>---
title: Jet CLI
layout: page
weight: 74
tags:
  - docker
  - introduction
  - commands
  - running locally
categories:
  - docker
---

<div class="info-block">
These commands are only applicable when you run the `jet` binary locally. If you run a build via the Codeship website not all of these settings are available.
</div>

* include a table of contents
{:toc}

For a list of all available _Jet_ commands simply run the following on a command line.

```bash
jet help
```

All of the available commands have these common flags:

* `--system` print extra system log information.

## Main commands

These are the main commands to use for loading and running services and steps.

All of the main commands have some common flags:

* `--dir` specify a different context directory
* `--keep-volume-containers` by default at the end of a run, all volume containers are deleted. This will keep them around.
* `--no-cache` do not use docker build's cache, and completely re-build all built services.
* `--print-build-output` by default, docker build's output is suppressed. If you want to have it, use this flag.
* `--services-path` specify the path to the YAML or JSON services file, if the file you want to use is not in one of the default locations.
* `--key-path` if you have encrypted environment variables, this specifies the path to your encryption key. If not specified, this uses the default location from `jet generate`.

### `jet steps`

This is the command to run your steps as specified in your configuration.

This command has some additional flags:

* `--no-parallel` turn off parallelism. This will run your parallel steps serially. Generally, you shouldn't use this, and this is included for debugging purposes only. _This flag might be removed before the first stable release._
* `-T` disable pseudo-tty allocation, which is done by default for the steps command.
* `--steps-path` specify the path to the YAML or JSON services file, if the file you want to use is not in one of the default locations.
* `--tag` the tag to use


### `jet run`

This is analogous to _docker-compose_'s run command This runs a one-off command on a service specified in your configuration.

For example, if your configuration specifies a service named _app_ and this image has the `echo` binary available, running the following command will print _Hello World_ to your screen.

```shell
jet run app echo "Hello World"
```

This command has some additional flags:

* `-e` add or override an environment variable, similar to docker run. This flag can be used multiple times.
* `--entrypoint` override the entry point of the image.
* `-T` disable pseudo-tty allocation, which is done by default for the run command.

### `jet load`

This is analogous to docker-compose's `pull` and `build` commands:

* If the `image` directive is specified for a service, this will pull the image.
* If the `build` directive is specified for a service, this will build the image.

## Encryption commands

These commands are for generating keys, and encrypting and decrypting environment variable or `.dockercfg` files.

- [Example](https://github.com/codeship/codeship-tool-examples/tree/master/11.encrypted-aes)

The Go code responsible for encrypting / decrypting the values is Open Source and available at [peter-edge/go-encrypt](https://github.com/peter-edge/go-encrypt).

### `jet generate`

Generate new keys for use with the CLI. The generated keys are saved to `${HOME}/.codeship/keys/aes/key.key` by default.

You can specify alternate keys for every other command with `--key-path`, otherwise keys are looked up in the location mentioned above. Keys are not required to be generated unless you have encrypted environment variables or a `.dockercfg`. You need not generate keys and use _Jet_ without encryption as well.

### `jet encrypt [infile] [outfile]`

Encrypt a file. If this is a YAML file containing environment variable, you can use the encrypted file directly with the `encrypted_env_file` directive in your services definition.

### `jet decrypt [infile] [outfile]`

Decrypt a file. This is useful to make sure the encryption worked properly.<commit_msg>Clarify `jet generate<commit_after>---
title: Jet CLI
layout: page
weight: 74
tags:
  - docker
  - introduction
  - commands
  - running locally
categories:
  - docker
---

<div class="info-block">
These commands are only applicable when you run the `jet` binary locally. If you run a build via the Codeship website not all of these settings are available.
</div>

* include a table of contents
{:toc}

For a list of all available _Jet_ commands simply run the following on a command line.

```bash
jet help
```

All of the available commands have these common flags:

* `--system` print extra system log information.

## Main commands

These are the main commands to use for loading and running services and steps.

All of the main commands have some common flags:

* `--dir` specify a different context directory
* `--keep-volume-containers` by default at the end of a run, all volume containers are deleted. This will keep them around.
* `--no-cache` do not use docker build's cache, and completely re-build all built services.
* `--print-build-output` by default, docker build's output is suppressed. If you want to have it, use this flag.
* `--services-path` specify the path to the YAML or JSON services file, if the file you want to use is not in one of the default locations.
* `--key-path` if you have encrypted environment variables, this specifies the path to your encryption key. If not specified, this uses the default location from `jet generate`.

### `jet steps`

This is the command to run your steps as specified in your configuration.

This command has some additional flags:

* `--no-parallel` turn off parallelism. This will run your parallel steps serially. Generally, you shouldn't use this, and this is included for debugging purposes only. _This flag might be removed before the first stable release._
* `-T` disable pseudo-tty allocation, which is done by default for the steps command.
* `--steps-path` specify the path to the YAML or JSON services file, if the file you want to use is not in one of the default locations.
* `--tag` the tag to use


### `jet run`

This is analogous to _docker-compose_'s run command This runs a one-off command on a service specified in your configuration.

For example, if your configuration specifies a service named _app_ and this image has the `echo` binary available, running the following command will print _Hello World_ to your screen.

```shell
jet run app echo "Hello World"
```

This command has some additional flags:

* `-e` add or override an environment variable, similar to docker run. This flag can be used multiple times.
* `--entrypoint` override the entry point of the image.
* `-T` disable pseudo-tty allocation, which is done by default for the run command.

### `jet load`

This is analogous to docker-compose's `pull` and `build` commands:

* If the `image` directive is specified for a service, this will pull the image.
* If the `build` directive is specified for a service, this will build the image.

## Encryption commands

These commands are for generating keys, and encrypting and decrypting environment variable or `.dockercfg` files.

- [Example](https://github.com/codeship/codeship-tool-examples/tree/master/11.encrypted-aes)

The Go code responsible for encrypting / decrypting the values is Open Source and available at [peter-edge/go-encrypt](https://github.com/peter-edge/go-encrypt).

### `jet generate`

Generate new keys for use with the CLI. The generated keys are saved to `${HOME}/.codeship/keys/aes/key.key` by default.

You can specify alternate keys for every other command with `--key-path`, otherwise keys are looked up in the location mentioned above. Note, that you do not need to generate a key unless you either require encrypted environment variables or plan to use `push` steps (which require an encrypted `dockercfg`).

### `jet encrypt [infile] [outfile]`

Encrypt a file. If this is a YAML file containing environment variable, you can use the encrypted file directly with the `encrypted_env_file` directive in your services definition.

### `jet decrypt [infile] [outfile]`

Decrypt a file. This is useful to make sure the encryption worked properly.
{'fraction_non_alphanumeric': 0.07558488302339532, 'fraction_numerical': 0.0009598080383923216, 'mean_word_length': 4.110974862047823, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4209879', 'n_tokens_mistral': 2251, 'n_tokens_neox': 2153, 'n_words': 1219}