@theplato/tiro-cli 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md ADDED
@@ -0,0 +1,90 @@
1
+ # Tiro for Agents
2
+
3
+ `@theplato/tiro-cli` is the agent's **feet** — a read-heavy CLI surface for Tiro
4
+ notes & transcripts. For interactive **hands** (tool calls inside an agent
5
+ loop), use the hosted Tiro MCP at `https://mcp.tiro.ooo/mcp`.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install -g @theplato/tiro-cli
11
+ tiro auth login
12
+ ```
13
+
14
+ ## Connect MCP to Claude Code
15
+
16
+ ```bash
17
+ tiro mcp install
18
+ # prints: claude mcp add --transport http tiro https://mcp.tiro.ooo/mcp
19
+ ```
20
+
21
+ Or run that command directly to register the hosted MCP.
22
+
23
+ ## Discovery (machine-readable)
24
+
25
+ ```bash
26
+ tiro --help
27
+ tiro --version
28
+ tiro mcp info --json
29
+ tiro <group> <verb> --help
30
+ ```
31
+
32
+ ## Output contract
33
+
34
+ | Context | stdout | stderr |
35
+ |---|---|---|
36
+ | TTY (pretty) | rendered markdown / text | progress, prompts |
37
+ | pipe / `--json` | JSON envelope | progress, prompts |
38
+ | `--output <path>` | single metadata JSON line | progress, prompts |
39
+
40
+ The metadata line includes `saved`, `size`, `format`, `guid`. Agents can
41
+ parse it line-by-line without buffering the file.
42
+
43
+ ## JSON envelope
44
+
45
+ ```json
46
+ { "ok": true, "data": <payload> }
47
+ { "ok": false, "error": { "code": "...", "message": "...", "errorType": "..." } }
48
+ ```
49
+
50
+ `errorType` ∈ `bad_request | unauthorized | forbidden | not_found | conflict |
51
+ internal_error`. Exit codes follow `sysexits.h` (`0` ok, `64` usage, `69`
52
+ unauthorized, `70` internal).
53
+
54
+ ## Common flows
55
+
56
+ | Goal | Command |
57
+ |---|---|
58
+ | List recent notes | `tiro notes list --since 7d --json` |
59
+ | Search notes | `tiro notes search "Q3" --since 30d --json` |
60
+ | Full note metadata | `tiro notes get <guid> --json` |
61
+ | MCP-shape transcript JSON | `tiro notes transcript <guid> --format json` |
62
+ | Save markdown for ingest | `tiro notes transcript <guid> --output ./n.md --no-timestamps` |
63
+ | Save plain text | `tiro notes transcript <guid> --format txt --output ./n.txt` |
64
+
65
+ The `--format json` output of `transcript` is byte-identical to the MCP
66
+ `get_note_transcript` tool result, so agents can swap surfaces without
67
+ changing parsers.
68
+
69
+ ## Surface separation
70
+
71
+ - **CLI (this)** — synchronous, file-output-friendly, agent-controlled
72
+ - **MCP** — interactive tool calls inside an agent loop
73
+ (https://mcp.tiro.ooo/mcp)
74
+ - **HTTP API** — server-to-server; see the OpenAPI spec at
75
+ https://api-docs.tiro.ooo
76
+
77
+ When in doubt: use **CLI for batch ingest** (download, write to disk,
78
+ context-light); use **MCP for interactive lookups** during a conversation.
79
+
80
+ ## Authentication
81
+
82
+ Two ways to authenticate:
83
+
84
+ 1. **Interactive** — `tiro auth login` opens a browser, completes OAuth, and
85
+ stores the token in the OS keychain.
86
+ 2. **Headless / CI** — set `TIRO_TOKEN=<bearer>` in the environment;
87
+ the keychain is bypassed and tokens are never written to disk.
88
+
89
+ The CLI never prints tokens to stdout. `tiro auth status` shows only the
90
+ first 4 characters of the access token.
package/README.md CHANGED
@@ -140,11 +140,29 @@ This is the killer pattern for agents — **the actual content goes to disk; onl
140
140
  ```bash
141
141
  tiro notes transcript <guid> # md by default in TTY, txt in pipe
142
142
  tiro notes transcript <guid> --output ./transcript.md
143
+ tiro notes transcript <guid> --output ./clean.md --no-timestamps # strip ### time headers
143
144
  tiro notes transcript <guid> --format json --output ./paragraphs.json # MCP-shape JSON
144
145
  ```
145
146
 
147
+ In markdown, the timestamp now appears once per paragraph as a `### mm:ss`
148
+ header instead of being attached to every speaker line. Use
149
+ `--no-timestamps` to omit them entirely (handy for raw saving / LLM ingest).
150
+
146
151
  `--format json` returns the exact shape MCP's `get_note_transcript` emits (`{noteGuid, title, participants, createdAt, recordingDurationSeconds, paragraphs[]}` with each paragraph carrying `segments[]` of `{content, speaker:{label,name}|null}`).
147
152
 
153
+ ### Connect to Claude Code (MCP)
154
+ ```bash
155
+ tiro mcp install
156
+ # prints: claude mcp add --transport http tiro https://mcp.tiro.ooo/mcp
157
+
158
+ tiro mcp info --json # endpoint, transport, install command
159
+ ```
160
+
161
+ The CLI is the agent's *feet* (read, save, browse). The hosted MCP at
162
+ [mcp.tiro.ooo](https://mcp.tiro.ooo/mcp) is the agent's *hands* (interactive
163
+ tool calls inside the loop). See [`AGENTS.md`](./AGENTS.md) for the full
164
+ agent contract.
165
+
148
166
  ---
149
167
 
150
168
  ## Commands
@@ -159,7 +177,10 @@ tiro notes search Deep keyword search (notes + documents hydrated)
159
177
  tiro notes get Get a single note (stdout or file)
160
178
  tiro notes transcript Get the full transcript (matches MCP get_note_transcript)
161
179
 
162
- # Coming in v0.3 / v0.4:
180
+ tiro mcp info Show hosted MCP endpoint info
181
+ tiro mcp install Print one-line claude-mcp-add command
182
+
183
+ # Coming in v0.4:
163
184
  tiro notes export Bulk-export search results to a directory
164
185
  tiro templates list/get Document templates
165
186
  tiro share-links {C/R/D} Manage note share links
@@ -168,7 +189,7 @@ tiro schema [<command>] Print JSON Schema (for agents)
168
189
  ```
169
190
 
170
191
  Full sample of every command: `tiro <command> --help`.
171
- Full design spec: [`SPEC.md`](./SPEC.md).
192
+ Agent contract: [`AGENTS.md`](./AGENTS.md).
172
193
  Release history: [`CHANGELOG.md`](./CHANGELOG.md).
173
194
 
174
195
  ---