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

# Commands and flags

## Global flags

Every command accepts these:

| Flag                                                  | Does                                                                 |
| ----------------------------------------------------- | -------------------------------------------------------------------- |
| `--format <json\|table\|yaml\|csv\|jsonl\|raw\|http>` | Output format. Default: `table` in a terminal, `json` when piped.    |
| `--human`                                             | Keep the table output even when piped.                               |
| `--query <JMESPath>`                                  | Keep only part of the response, for example `--query 'data[].slug'`. |
| `--dry-run`                                           | Validate the request and print it without sending it.                |
| `--base-url <url>`                                    | Call another host.                                                   |
| `-q, --quiet`                                         | Print nothing on success. Errors still go to stderr.                 |
| `--debug`                                             | Print the HTTP request and response to stderr.                       |
| `--schema`                                            | Print the JSON schema of the current command or group.               |

## Request bodies

Set fields with flags, nested ones with dots:

```bash
ocpplab-cli evcharger commands start_session \
  --target.identity DEMO-CP-001 \
  --payload.id-tag TAG-001 --payload.connector-id 1
```

Or send the whole body as JSON, from an argument or stdin:

```bash
ocpplab-cli evcharger commands start_session --json '{"target": {"identity": "DEMO-CP-001"}, "payload": {"id_tag": "TAG-001"}}'
cat body.json | ocpplab-cli evcharger commands start_session --json -
```

`--params '<json>'` merges extra parameters and overrides individual flags.

## Paging

List commands that page also accept:

| Flag                | Does                                            |
| ------------------- | ----------------------------------------------- |
| `--page-all`        | Fetch every page and stream the items as NDJSON |
| `--page-limit <n>`  | Stop after `n` pages (default `10`)             |
| `--page-delay <ms>` | Wait between pages (default `100`)              |

## Scripting

```bash
# Every brand slug, one per line
ocpplab-cli evcharger catalog list_brands --page-all | jq -r '.slug'

# Keep one field of a response
ocpplab-cli health live --query status

# Preview a destructive call before you run it
ocpplab-cli evcharger deployment delete --identity DEMO-CP-001 --dry-run
```

Exit code `0` means success. On an API error, the CLI prints the error to stderr and exits non-zero.

## Environment variables

| Variable                   | Does                                                                     |
| -------------------------- | ------------------------------------------------------------------------ |
| `OCPPLAB_TOKEN`            | SDK token. Takes precedence over `auth login`.                           |
| `OCPPLAB_CLI_BASE_URL`     | API host (`--base-url` wins)                                             |
| `OCPPLAB_CLI_OUTPUT`       | Default output format (`--format` wins)                                  |
| `OCPPLAB_CLI_RETRIES`      | Retry attempts for failed requests                                       |
| `OCPPLAB_CLI_TIMEOUT_SECS` | Total request timeout                                                    |
| `OCPPLAB_CLI_PROXY`        | HTTP(S) proxy URL. `HTTPS_PROXY`, `HTTP_PROXY` and `NO_PROXY` also work. |
| `OCPPLAB_CLI_CA_BUNDLE`    | PEM file with extra trusted certificates                                 |

## Shell completion

```bash
ocpplab-cli completion zsh > "${fpath[1]}/_ocpplab-cli"
```

Also `bash`, `fish` and `powershell`.