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

# CLI Overview

> A CLI for working with Tiro notes and transcripts from a shell, CI, or an agent.

The Tiro CLI is the npm package [`@theplato/tiro-cli`](https://www.npmjs.com/package/@theplato/tiro-cli). It gives you the same Tiro APIs as MCP, usable from a shell, CI, cron, or an agent.

[![npm version](https://img.shields.io/npm/v/@theplato/tiro-cli)](https://www.npmjs.com/package/@theplato/tiro-cli)
[![Node.js](https://img.shields.io/node/v/@theplato/tiro-cli)](https://nodejs.org)

## Quick install

```bash npm theme={"system"}
npm install -g @theplato/tiro-cli
```

```bash pnpm theme={"system"}
pnpm add -g @theplato/tiro-cli
```

```bash yarn theme={"system"}
yarn global add @theplato/tiro-cli
```

```bash bun theme={"system"}
bun add -g @theplato/tiro-cli
```

```bash theme={"system"}
tiro auth login                                 # browser opens; OAuth + PKCE
tiro notes search "Q3 Planning" --since 7d --json
```

## Which one to use

| | **REST API** | **MCP server** | **CLI** |
| - | - | - | - |
| Audience | services, integrations | MCP-aware AI clients | shells, CI, ad-hoc agents |
| Result lands in | your code | agent **conversation** | **files** or stdout pipe |
| Per-session token cost | per request | thousands (tool schema) | dozens (per call) |
| Best for | service-to-service traffic | small reads, multi-turn reasoning | bulk export, file ops, scripting |
| Discovery | OpenAPI | MCP `list_tools` | `tiro --help` |

All three use the same OAuth and JWT, so credentials issued for one work with the others. See [Authentication](https://docs.tiro.ooo/en/developers/fundamentals/authentication.md).

> [!NOTE]
>
> If you read and reason over notes inside a conversation, MCP is the better
> fit. Use the CLI when you need results in a file or a pipe.

## What you get

* **Auth**: `tiro auth login | status | logout` — OAuth Authorization Code + PKCE with loopback redirect; tokens stored in OS Keychain.
* **Notes**: `tiro notes list | search | get | transcript` — covers the same surface as MCP's `list_notes` / `search_notes` / `get_note` / `get_note_transcript`.
* **Wiki**: `tiro wiki workspaces | search | page | mentions | graph` — read the auto-extracted knowledge graph; `--workspace <guid>` targets a specific workspace. Paid/opt-in, mirroring the MCP wiki tools.
* **MCP-shape JSON**: `tiro notes transcript --format json` mirrors the MCP `get_note_transcript` payload exactly. Reuse your MCP parser unchanged.
* **File output**: every retrieval command supports `--output <path>` so the actual content goes to disk and stdout shrinks to a metadata line. Critical for keeping agent context windows light.
* **Stable error envelope**: every error returns `{ ok: false, error: { code, message, suggestion?, errorType?, httpStatus?, requestId? } }` with documented exit codes.

## Architecture

```
                       Tiro Backend — /v1/external/* + /v1/mcp/*
                              │
       ┌──────────────────────┼──────────────────────┐
       ▼                      ▼                      ▼
  ┌──────────┐         ┌──────────────┐       ┌──────────────┐
  │ REST     │         │ MCP server   │       │ CLI          │
  │ clients  │         │ (uniform     │       │ (filesystem, │
  │          │         │  shape)      │       │  bulk, pipe) │
  └──────────┘         └──────────────┘       └──────────────┘
```

→ Continue to [Setup](https://docs.tiro.ooo/en/developers/cli/setup.md) to install and authenticate.

## Links

* npm: [npmjs.com/package/@theplato/tiro-cli](https://www.npmjs.com/package/@theplato/tiro-cli)
* GitHub: [github.com/plato-corp/tiro-cli](https://github.com/plato-corp/tiro-cli)
* Changelog: [CHANGELOG.md](https://github.com/plato-corp/tiro-cli/blob/main/CHANGELOG.md)
* Issues: [github.com/plato-corp/tiro-cli/issues](https://github.com/plato-corp/tiro-cli/issues)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.