# CLI

`jinn` is one file for Linux, macOS and Windows. It uses the [API](/api).

## Install

```sh
curl -fsSL https://docs.usejinn.com/install.sh | sh
```

The script puts `jinn` in `/usr/local/bin` (or `~/.local/bin`). You can also download it yourself:

| System | File |
|---|---|
| Linux, x86-64 | [jinn-linux-amd64](/cli/jinn-linux-amd64) |
| Linux, ARM | [jinn-linux-arm64](/cli/jinn-linux-arm64) |
| macOS, Apple silicon | [jinn-darwin-arm64](/cli/jinn-darwin-arm64) |
| macOS, Intel | [jinn-darwin-amd64](/cli/jinn-darwin-amd64) |
| Windows | [jinn-windows-amd64.exe](/cli/jinn-windows-amd64.exe) |

[SHA256SUMS](/cli/SHA256SUMS) lists their checksums.

## Sign in

```sh
jinn login
```

The CLI shows a link and a code. Open the link, check that the console shows the same code, and approve. The CLI then has its own admin key, in `~/.config/jinn/key`. On a server, set `JINN_KEY` instead.

## Commands

| Command | What it does |
|---|---|
| `jinn bases` | List the bases. |
| `jinn functions` | List the account's functions. |
| `jinn publish function.json` | Make the function the file names, or publish its next version. The file is a definition with a `name`. |
| `jinn run NAME --prompt TEXT [--in DIR] [--out DIR]` | Start a run, print what the agent does, and download the output folder. `NAME` is a function's name or id. |
| `jinn run NAME … --detach` | Start a run and print its id. |
| `jinn run NAME … --version N --webhook URL --ref REF` | Choose a version, a webhook and your own reference. |
| `jinn runs [--function NAME] [--state active\|succeeded\|failed]` | List runs. |
| `jinn show RUN` | Print a run as JSON. |
| `jinn logs RUN [--follow]` | Print a run's log. |
| `jinn output RUN --out DIR` | Download a run's output folder. |

`JINN_API` changes the API's address.
