# Global options

> Source: https://truto.one/docs/cli/global-options/

Every command accepts these flags. They can appear anywhere on the command line (before or after the subcommand).

| Flag | Description | Default |
| --- | --- | --- |
| `-p, --profile <name>` | Use a specific profile | Active profile |
| `--api-url <url>` | Override API URL | Profile URL or `https://api.truto.one` |
| `--token <token>` | Override API token | Profile token |
| `-o, --output <format>` | `json`, `table`, `yaml`, `csv`, `ndjson` | `table` |
| `-v, --verbose` | Print request/response details to stderr | Off |
| `--no-color` | Disable colored output | Off |
| `--no-help-on-error` | Suppress automatic `--help` on errors (for piping) | Off |

:::callout{type="tip"}
When `-o` is `json`, `yaml`, `csv`, or `ndjson`, decorative status messages are suppressed on stdout so only structured data is emitted. Errors always go to stderr.
:::

## Output formats

| Format | Best for | Notes |
| --- | --- | --- |
| `table` | Interactive inspection | Default. Truncates long values; up to 8 columns. |
| `json` | Piping to `jq`, saving files | Pretty-printed, 2-space indent. |
| `ndjson` | Streaming, log processing | One JSON object per line. Ideal for `export`. |
| `csv` | Spreadsheets | Columns from first record. |
| `yaml` | Human-readable nested data | |

Some commands override the default:

| Command | Default output |
| --- | --- |
| Most admin commands | `table` |
| `export` | `json` (unless `-o` is set) |
| `get` subcommands | `json` |
| `custom` | `json` |

## Pagination

List commands return 25 results by default:

```bash
truto integrations list --limit 10
# Output shows: Next page: --next-cursor abc123...
truto integrations list --limit 10 --next-cursor abc123
```

For exhaustive pagination across data-plane resources, use [`truto export`](/docs/cli/power-features) instead.

## Shared resource flags

Most admin resource commands support:

| Flag | Operation | Description |
| --- | --- | --- |
| `--next-cursor <cursor>` | `list` | Next page |
| `--limit <n>` | `list` | Results per page (default 25) |
| `--stdin` | `create` | Body from stdin (JSON array or NDJSON) |
| `-i, --interactive` | `update` | Pre-fill fields from current record |
| `-f, --force` | `delete` | Skip confirmation |

## Filtering

List commands accept `--<field>` filters. Check per-command help:

```bash
truto integrations list --help
truto accounts list --tenant-id <tid>
truto sync-jobs list --integration_name hubspot
```

## Scripting examples

```bash
# IDs as JSON
truto integrations list -o json | jq '.[].id'

# Count exported records
truto export crm/contacts -a <account-id> -o ndjson | wc -l

# Debug HTTP
truto integrations list -v
# stderr: → GET https://api.truto.one/integration?limit=25
#         ← 200 OK
```

## Stdin and `--body`

On `create` (admin resources), `unified`, `proxy`, `custom`, and `batch`:

- **Admin `create`:** Input starting with `[` → JSON array (bulk create); otherwise NDJSON (one object per line).
- **Data plane / batch:** Stdin is always a **single** JSON body.
- `--stdin` and `-b` are mutually exclusive. For data-plane commands, `-b` wins; for admin `create`, `--stdin` wins.

See [Power features](/docs/cli/power-features) for full stdin examples.
