> ## Documentation Index
> Fetch the complete documentation index at: https://docs.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
```

## Authenticate

Use an [API key](https://docs.gojinko.com/authentication/api-keys.md). OAuth login is deprecated. Save a key for the selected environment:

```bash theme={null}
jinko auth login --key jnk_t_your_key
```

Or supply a key through your shell environment:

```bash theme={null}
export JINKO_API_KEY=jnk_t_your_key
```

`JINKO_API_KEY` takes precedence over saved keys, even when you switch environments with `--env`. Use a key for the selected environment, or unset the variable to use saved profiles.

## First request

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

## Prices in output

CLI output is the raw API response, and no conversion is applied. Read money
from the `*_money` fields (and `value` on objects that carry it): `value` is an
integer in **minor units**, so divide by `10 ** decimal_places` to display it
(`{ "value": 15977, "decimal_places": 2 }` is 159.77, not 15,977), or show
`display`. The older fields beside them, such as trip and checkout
`total_amount` and hotel `total_amount`, are deprecated and hold major units.
Full rules: [Money & prices](https://docs.gojinko.com/concepts/money).

## Environments

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:

Use Jinko Airline (`ZZ`) for sandbox flight tests: `flight-search --include-carriers ZZ` on JFK–LHR from tomorrow (UTC) onwards, and flight ZZ101 for the normal flow. It is a fake airline that exists only in sandbox and always behaves the same way; each other flight number triggers one documented behaviour, including failures. With `--include-carriers ZZ` the results are Jinko Airline only. An empty result means no Jinko Airline itinerary matched the route, date and other filters you sent (times, cabin, stops, price): read the `instruction` and adjust one filter. See [Testing in sandbox](https://docs.gojinko.com/guides/testing-in-sandbox) for routes, prices and scenarios, and [sandbox flight coverage](https://docs.gojinko.com/guides/sandbox-walkthrough#flight-coverage-and-empty-results) for real airlines.

Use live `flight-search` for Jinko Airline. Cached commands such as `find-destination` and `flight-calendar` never return it. The example below uses Python 3 to choose a departure date 60 days from today in UTC.

```bash theme={null}
# use saved profiles instead of a key exported in this shell
unset JINKO_API_KEY

# store your sandbox key under the sandbox profile
jinko auth login --env sandbox --key jnk_sandbox_t_your_key

# make sandbox the default for this machine…
jinko config set environment sandbox

DEPARTURE_DATE=$(python3 -c 'from datetime import datetime, timedelta, timezone; print((datetime.now(timezone.utc) + timedelta(days=60)).date())')
jinko flight-search --origin JFK --destination LHR \
  --departure-date "$DEPARTURE_DATE" --include-carriers ZZ \
  --adults 1 --currency USD                    # → sandbox, Jinko Airline

# …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.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.