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

# CLI

> Manage Manifest from the terminal: create harnesses, connect providers, set routing, and read request logs without the dashboard.

`mnfst` is the Manifest command-line tool. It does what the dashboard does — create harnesses, connect providers, set routing, read the request log — from a terminal, a script, or an agent. Every command prints JSON on stdout and human hints on stderr, and exits `0` or `1`.

<Note>
  One naming difference: the CLI's commands say `agent`, while the dashboard and these docs say **harness**. `mnfst agent …` manages harnesses.
</Note>

## Install

The CLI ships in the Manifest repository. It is not published to npm yet, so build it from source and link it onto your `PATH`:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
git clone https://github.com/mnfst/manifest.git
cd manifest
npm install
npm run build --workspace=packages/shared
npm run build --workspace=packages/cli
npm link --workspace=packages/cli
mnfst --help
```

## Sign in

`mnfst login` opens your browser to an authorization page. Sign in, click **Authorize**, and the CLI stores a token for that host. Tokens are per host and stored in `~/.config/manifest/config.json` with mode `0600`.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
mnfst login
mnfst login --url http://localhost:2099   # a self-hosted instance
```

For scripts and agents, pass the token instead of opening a browser. The secret never goes on the command line:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
mnfst login --token-env MANIFEST_TOKEN    # read from an environment variable
printf '%s' "$MANIFEST_TOKEN" | mnfst login --token-stdin
```

Or skip login entirely by setting both `MANIFEST_URL` and `MANIFEST_API_KEY`. The CLI then uses those and leaves the stored config alone.

Tokens expire after 30 days without use, and at most 90 days after they are issued. `mnfst logout` revokes the token on the server and removes it locally.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
mnfst whoami          # the current identity
mnfst auth status     # credential, host, and expiry
mnfst logout          # revoke and sign out
```

## Manage harnesses

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
mnfst agent create --name support-bot --platform openai-sdk --if-absent
mnfst agent list
mnfst agent configure support-bot --models gpt-4o,gpt-4o-mini --provider openai
mnfst agent setup support-bot --reveal      # the wiring snippet, with the real key
mnfst agent rotate-key support-bot --yes
mnfst agent delete support-bot --yes
```

`agent create` returns the harness key and the setup instructions for its platform. Without `--key-file`, the key goes to a managed store and is printed only by `agent key show`. `--if-absent` makes the command safe to re-run.

`mnfst agent key path <name>` prints where the key lives, and `agent key show <name> --raw` prints it. `mnfst agent env <name> >> .env` emits `MANIFEST_AGENT_KEY` and `MANIFEST_AGENT_URL` lines for an app or service.

## Connect providers

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
mnfst provider catalog                                  # what you can connect, and its auth types
mnfst provider connect openai --auth-type api_key --credential-env OPENAI_API_KEY
mnfst provider list --agent support-bot                 # connections, and which are enabled per harness
mnfst provider refresh openai                           # re-run model discovery
mnfst provider custom add --name gateway --endpoint https://llm.internal/v1 --credential-env GW_KEY
```

`provider *` acts on the workspace. `agent provider enable|disable` controls which providers a single harness can use.

## Set routing

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
mnfst routing status support-bot
mnfst agent configure support-bot --models gpt-4o,gpt-4o-mini --provider openai --tier batch
mnfst routing test support-bot "Reply with OK" --tier batch
```

`agent configure` sets the default tier: the first model in `--models` is the route, and the rest are fallbacks. Add `--tier <name>` to upsert a custom tier that callers select with a request header. `routing test` sends one real request through the harness's route and fails loudly when the route is broken.

## Read requests and models

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
mnfst requests get --agent support-bot --range 7d --status failed
mnfst requests get --agent support-bot --cursor "$NEXT"   # one page per call
mnfst models support-bot --cost --capabilities
mnfst model prices --provider openai
```

`requests get` returns one page per call. Take `next_cursor` from the response and pass it back for the next page.

## Run a command with a harness key

`mnfst run` injects a harness key into a child process, so the secret never crosses stdout or your shell history:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
mnfst run --agent support-bot --env OPENAI_API_KEY -- my-service
```

The child receives the key as `OPENAI_API_KEY` (default `MANIFEST_AGENT_KEY`) and the gateway URL as `MANIFEST_AGENT_URL`.

## Diagnostics

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
mnfst doctor
```

`doctor` checks the config, the host, the credential, the providers, and the harnesses, in that order. Run it first when a command fails: it separates "the host is unreachable" from "the key is wrong for this host".

## Agent skill

The CLI ships an operating guide for coding agents. Install it into your agent's skills directory:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
mnfst skill show            # print the guide
mnfst skill install         # write it to the detected agent's skills directory
```

## Related

* [LLM Gateway](/docs/llm-gateway) — what the gateway does with each request
* [Providers](/docs/providers/api-key-providers) — connect subscriptions, API keys, and local models
* [API reference](/docs/reference/api) — the endpoints the CLI calls
* [Telemetry](/docs/reference/telemetry) — what the dashboard and CLI report
