> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nativeport.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nativeport.ai/_mcp/server.

# Set up with CLI

> npx nativeport stores your key once, then searches the catalog, prints what a call costs, runs it natively and reports your balance. Zero dependencies.

`@nativeport/cli` is a zero-dependency Node 20+ command over the [Agent API](/agent-api): find an endpoint, read its price, call it natively, check your balance. It is also published under the short alias `nativeport`, so `npx nativeport` and `npx @nativeport/cli` are the same thing.

#### Store your key once

```bash
npx nativeport@latest login
```

Prompts for the key without echoing it (or pass `--key`). It is validated against the gateway and stored with mode 0600 under `~/.config/nativeport/`. `NATIVEPORT_API_KEY` in the environment always wins, which is what CI and agents should use.

#### Find, inspect, call

```bash
npx nativeport find google search
npx nativeport inspect serper
npx nativeport call serper --body '{"q":"apple inc"}'
npx nativeport account
```

`call` defaults method, path and body to the entry's example; override with `--method`, `--path` (must start with the entry's `/<provider>`), `--query k=v` and `--body` (literal JSON, `@file`, or `-` for stdin). Status goes to stderr and the body to stdout, so `| jq` works. Binary bodies are written to `--out` or an auto-named file.

## Commands

| Command                               | What it does                                                                        |
| ------------------------------------- | ----------------------------------------------------------------------------------- |
| `login [--key K]` / `logout`          | Store or forget the key.                                                            |
| `account`                             | Balance in µc and USD, status, trial state when present.                            |
| `find <keywords...> [--limit N]`      | Same ranking as `GET /v1/catalog?q=`.                                               |
| `inspect <id>`                        | The full entry with admitted actions, price, restrictions, docs and a ready `curl`. |
| `call <id> [...]`                     | Runs the native route with your key.                                                |
| `catalog`                             | The whole catalog.                                                                  |
| `skill [--install]`                   | Prints the SKILL.md, or installs it for Claude Code.                                |
| `mcp [--client claude\|cursor\|json]` | Prints the MCP client configuration for `/mcp`.                                     |

Every command accepts `--json`. Colors appear only on a TTY and never when `NO_COLOR` is set.

## Exit codes

| Code | Meaning                                                         |
| ---- | --------------------------------------------------------------- |
| 0    | Success                                                         |
| 1    | Usage error, unknown id, or a path outside the entry's provider |
| 2    | No key, or `401`                                                |
| 3    | Insufficient credits (`402`)                                    |
| 4    | Suspended or restricted (`403`, `429`)                          |
| 5    | Any other non-2xx from the provider or gateway                  |
| 6    | Network failure                                                 |

An agent can branch on these without parsing text.

Source and issues: [github.com/nativeport/nativeport-cli](https://github.com/nativeport/nativeport-cli). Install globally with `npm i -g @nativeport/cli` for a bare `nativeport` command.