@redaksjon/protokoll-cli 0.1.1-dev.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/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 24
package/README.md ADDED
@@ -0,0 +1,252 @@
1
+ # Protokoll CLI
2
+
3
+ Command-line interface for [Protokoll](https://github.com/redaksjon/protokoll) - A thin MCP client for transcription and context management.
4
+
5
+ ## Overview
6
+
7
+ `protokoll-cli` is a lightweight command-line client that communicates with the Protokoll MCP server. It provides a familiar CLI experience while leveraging the full power of Protokoll's intelligent transcription pipeline through the Model Context Protocol.
8
+
9
+ ## Architecture
10
+
11
+ ```
12
+ protokoll-cli (this package) protokoll (core)
13
+ ┌─────────────────────┐ ┌──────────────────────┐
14
+ │ CLI Commands │ │ MCP Server │
15
+ │ ├─ status │ stdio │ ├─ Tools │
16
+ │ ├─ task │ ◄─────► │ ├─ Resources │
17
+ │ ├─ transcript │ │ ├─ Prompts │
18
+ │ ├─ context │ │ └─ Pipeline │
19
+ │ ├─ project/etc │ │ │
20
+ │ ├─ action │ │ Core Library │
21
+ │ ├─ feedback │ │ ├─ Context │
22
+ │ └─ process/batch │ │ ├─ Routing │
23
+ └─────────────────────┘ │ └─ Transcription │
24
+ └──────────────────────┘
25
+ ```
26
+
27
+ ## Installation
28
+
29
+ ```bash
30
+ npm install -g @redaksjon/protokoll-cli
31
+ ```
32
+
33
+ **Prerequisites**: Requires `@redaksjon/protokoll` to be installed (provides the MCP server).
34
+
35
+ ```bash
36
+ npm install -g @redaksjon/protokoll
37
+ ```
38
+
39
+ ## Quick Start
40
+
41
+ ```bash
42
+ # Show version information
43
+ protokoll version
44
+
45
+ # Process an audio file
46
+ protokoll process recording.m4a
47
+
48
+ # List transcripts
49
+ protokoll transcript list
50
+
51
+ # Read a transcript
52
+ protokoll transcript read meeting-notes.md
53
+
54
+ # Manage status
55
+ protokoll status set meeting.md reviewed
56
+
57
+ # Add a task
58
+ protokoll task add meeting.md "Follow up with client"
59
+ ```
60
+
61
+ ## Commands
62
+
63
+ ### Audio Processing
64
+
65
+ Process audio files through Protokoll's intelligent transcription pipeline:
66
+
67
+ ```bash
68
+ # Process single audio file
69
+ protokoll process <audioFile> [options]
70
+ -p, --project <projectId> Specific project ID for routing
71
+ -o, --output <directory> Override output directory
72
+ -m, --model <model> LLM model for enhancement
73
+ --transcription-model <model> Transcription model (default: whisper-1)
74
+
75
+ # Batch process multiple files
76
+ protokoll batch <inputDirectory> [options]
77
+ -o, --output <directory> Override output directory
78
+ -e, --extensions <list> Audio extensions (comma-separated)
79
+ ```
80
+
81
+ ### Transcript Management
82
+
83
+ Read and manage transcripts:
84
+
85
+ ```bash
86
+ # Read a transcript
87
+ protokoll transcript read <transcriptPath>
88
+
89
+ # List transcripts
90
+ protokoll transcript list [options]
91
+ -l, --limit <number> Maximum results (default: 50)
92
+ -s, --search <text> Search within transcripts
93
+ --sort <field> Sort by: date, filename, title (default: date)
94
+ ```
95
+
96
+ ### Status Management
97
+
98
+ Manage transcript lifecycle status:
99
+
100
+ ```bash
101
+ # Set status
102
+ protokoll status set <transcriptPath> <newStatus>
103
+
104
+ # Show current status
105
+ protokoll status show <transcriptPath>
106
+ ```
107
+
108
+ Valid statuses: `initial`, `enhanced`, `reviewed`, `in_progress`, `closed`, `archived`
109
+
110
+ ### Task Management
111
+
112
+ Manage transcript tasks:
113
+
114
+ ```bash
115
+ # Add a task
116
+ protokoll task add <transcriptPath> <description>
117
+
118
+ # Complete a task
119
+ protokoll task complete <transcriptPath> <taskId>
120
+
121
+ # Delete a task
122
+ protokoll task delete <transcriptPath> <taskId>
123
+ ```
124
+
125
+ ### Context Management
126
+
127
+ Manage context entities (projects, people, terms, companies):
128
+
129
+ ```bash
130
+ # Show context system status
131
+ protokoll context status
132
+
133
+ # Search across all entities
134
+ protokoll context search <query>
135
+
136
+ # Entity commands (project, person, term, company)
137
+ protokoll <entity> list [--verbose]
138
+ protokoll <entity> show <id>
139
+ protokoll <entity> add [options]
140
+ protokoll <entity> delete <id>
141
+
142
+ # Term-specific
143
+ protokoll term merge <sourceId> <targetId>
144
+ ```
145
+
146
+ ### Transcript Actions
147
+
148
+ Perform actions on transcripts:
149
+
150
+ ```bash
151
+ # Combine multiple transcripts
152
+ protokoll action combine <files...> [options]
153
+ -t, --title <title> Title for combined transcript
154
+ -p, --project <id> Project ID to assign
155
+
156
+ # Edit transcript metadata
157
+ protokoll action edit <transcriptPath> [options]
158
+ -t, --title <title> New title (renames file)
159
+ -p, --project <id> New project ID
160
+ --add-tag <tag> Add a tag (repeatable)
161
+ --remove-tag <tag> Remove a tag (repeatable)
162
+ -s, --status <status> New status
163
+
164
+ # Change transcript date
165
+ protokoll action change-date <transcriptPath> <newDate>
166
+
167
+ # Create a new note
168
+ protokoll action create-note [options]
169
+ -t, --title <title> Note title (required)
170
+ -c, --content <text> Note content
171
+ -p, --project <id> Project ID
172
+ --tag <tag> Add tag (repeatable)
173
+ -d, --date <date> Date (ISO format)
174
+ ```
175
+
176
+ ### Feedback
177
+
178
+ Provide natural language feedback to correct transcripts:
179
+
180
+ ```bash
181
+ protokoll feedback <transcriptPath> <feedback> [options]
182
+ -m, --model <model> LLM model for processing
183
+
184
+ # Examples:
185
+ protokoll feedback meeting.md "YB should be Wibey"
186
+ protokoll feedback notes.md "This should be assigned to quarterly-review project"
187
+ ```
188
+
189
+ ## Configuration
190
+
191
+ Protokoll-cli uses the Protokoll core's configuration system. Configuration is stored in `.protokoll/config.yaml` in your workspace.
192
+
193
+ The CLI automatically discovers configuration by searching up the directory tree from your current working directory.
194
+
195
+ ## Development
196
+
197
+ ```bash
198
+ # Clone the repository
199
+ git clone https://github.com/redaksjon/protokoll-cli.git
200
+ cd protokoll-cli
201
+
202
+ # Install dependencies
203
+ npm install
204
+
205
+ # Link local protokoll for development
206
+ cd ../protokoll && npm link
207
+ cd ../protokoll-cli && npm link @redaksjon/protokoll
208
+
209
+ # Build
210
+ npm run build
211
+
212
+ # Run tests
213
+ npm test
214
+
215
+ # Run locally
216
+ node dist/main.js --help
217
+ ```
218
+
219
+ ## How It Works
220
+
221
+ ### MCP Communication
222
+
223
+ Protokoll-cli spawns the Protokoll MCP server (`protokoll-mcp`) as a child process and communicates via stdio transport:
224
+
225
+ 1. CLI command is invoked
226
+ 2. `createMCPClient()` spawns `protokoll-mcp` server
227
+ 3. Client sends MCP tool call (JSON-RPC over stdio)
228
+ 4. Server processes request and returns result
229
+ 5. CLI formats and displays output
230
+ 6. Connection is closed
231
+
232
+ ### Progress Notifications
233
+
234
+ Long-running operations (audio processing, batch operations) can send progress notifications from the server. The CLI renders these as progress bars in TTY environments or milestone logs in non-TTY environments.
235
+
236
+ ## Relationship to Protokoll Core
237
+
238
+ `protokoll-cli` is a **thin client** - it contains no business logic. All transcription, context management, routing, and entity operations are handled by the Protokoll core via MCP tool calls.
239
+
240
+ This architecture provides several benefits:
241
+ - **Consistency**: Same backend for CLI, VS Code extension, macOS app, and Cursor
242
+ - **Maintainability**: Business logic in one place
243
+ - **Extensibility**: Easy to add new clients without duplicating logic
244
+ - **Testing**: Core logic tested independently of CLI presentation
245
+
246
+ ## License
247
+
248
+ Apache-2.0
249
+
250
+ ## Author
251
+
252
+ Tim O'Brien <tobrien@discursive.com>