Every incur CLI includes these flags automatically. No configuration needed.
Built-in Flags
| Flag | Short | Description |
|---|
--help | -h | Show help for the CLI or a specific command |
--version | | Print CLI version |
--llms | | Output agent-readable command manifest |
--mcp | | Start as an MCP stdio server |
--json | | Shorthand for --format json |
--format <fmt> | | Output format: toon, json, yaml, md, jsonl |
--verbose | | Include full envelope (ok, data, meta) |
Help Flag
Show usage information:
Output
Command-Specific Help
Output
Version Flag
Print the CLI version:
Set the version when creating the CLI:
Or read from package.json:
Change the output format:
Supported formats:
toon – Terse Object Oriented Notation (default)
json – Standard JSON with 2-space indentation
yaml – YAML format
md – Markdown tables
jsonl – JSON Lines (for streaming)
JSON Shorthand
Equivalent to --format json.
Verbose Flag
Include the full output envelope:
Output
The envelope includes:
ok – Success indicator
data – Command output
meta – Metadata (command name, duration, CTAs)
In non-verbose mode, only data is shown.
Verbose + JSON
Output
LLMs Flag
Output a machine-readable manifest of all commands:
Output (Markdown)
Output
Useful for:
- Direct inspection
- Custom integrations
- Documentation generation
- Tool definition export
MCP Flag
Start the CLI as an MCP stdio server:
This exposes all commands as MCP tools. The server reads JSON-RPC from stdin and writes responses to stdout.
Agents use this mode when invoking the CLI via MCP:
Implementation
All global options are handled automatically in src/Cli.ts. No additional code needed:
This CLI automatically supports:
my-cli --help
my-cli --version
my-cli status --json
my-cli status --verbose
my-cli --llms
my-cli --mcp
Override the default format:
Users can still override with --format toon or other formats.
Combining Flags
Global options can be combined:
Order Independence
Global options work anywhere in the command line:
Built-in Commands
Every CLI also includes these built-in commands:
These are covered in detail in:
Global options are automatically available on every command. No configuration or code needed.