> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dev.gojinko.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI

> Install the Jinko CLI and run the booking flow from your shell.

The CLI mirrors the booking workflow exposed through MCP and is ideal for shell agents and scripts.

## Install

```bash theme={null}
npm install -g @gojinko/cli
```

<Note>
  **`@gojinko/cli` 2.0** targets the canonical `jinko-api` `/v1` surface. Upgrading is **opt-in**: the **1.x** line keeps working unchanged against the legacy routes, which stay served during the transition. Upgrade when you're ready; nothing forces a cutover.
</Note>

## Authenticate

OAuth:

```bash theme={null}
jinko auth login
```

API key:

```bash theme={null}
jinko auth login --key jnk_your_key
export JINKO_API_KEY=jnk_your_key
```

## First request

```bash theme={null}
jinko find-destination --origins JFK
jinko flight-calendar --origins JFK --destinations CDG --month 2026-06
jinko flight-search --origin JFK --destination CDG --departure-date 2026-06-15
```

## Environments (prod / sandbox)

The CLI targets **production** by default. Use `--env sandbox` to run the full flow against the sandbox environment (isolated data, **separate API keys**) before going live:

```bash theme={null}
# store your sandbox key under the sandbox profile
jinko auth login --env sandbox --key jnk_your_sandbox_key

# make sandbox the default for this machine…
jinko config set environment sandbox
jinko find-destination --origins JFK            # → sandbox

# …or override per-command
jinko --env prod find-destination --origins JFK # → production
```

| Environment          | API base                          | Flag            |
| -------------------- | --------------------------------- | --------------- |
| Production (default) | `https://api.gojinko.com`         | `--env prod`    |
| Sandbox              | `https://api.sandbox.gojinko.com` | `--env sandbox` |

<Note>
  Prod and sandbox keys are stored separately in `~/.jinko/config.yaml`, so you keep both and switch with `--env`. `JINKO_ENV=sandbox` and the raw `JINKO_API_BASE` override also work.
</Note>
