@loguro/cli 1.0.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +554 -0
  3. package/dist/index.js +29493 -0
  4. package/package.json +54 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sebastian Pavel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,554 @@
1
+ # @loguro/cli
2
+
3
+ Command-line tool for querying [Loguro](https://logu.ro) logs.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm i -g @loguro/cli
9
+ # or run without install:
10
+ npx @loguro/cli logs --help
11
+ ```
12
+
13
+ ## Quick start
14
+
15
+ ```bash
16
+ loguro init # interactive wizard: auth → project → key → link → first log
17
+ ```
18
+
19
+ Walks you through PAT setup, project creation, ingestion key generation, and links the current directory. Ends with copy-paste SDK examples (curl, Node, Python, Go) using your real key — ready to ship logs the next second.
20
+
21
+ Already have an account? `loguro init` detects existing tokens and projects and skips the parts you don't need.
22
+
23
+ ## Auth
24
+
25
+ One token (PAT) covers all your projects.
26
+
27
+ ```bash
28
+ loguro login # paste a pat_… from /app/settings/cli-tokens
29
+ loguro whoami
30
+ loguro logout
31
+ ```
32
+
33
+ After login you only need slugs:
34
+
35
+ ```bash
36
+ loguro config add prod --slug=my-prod-app
37
+ loguro config add staging --slug=my-stg-app
38
+ loguro link my-prod-app # link a directory directly to a slug
39
+ ```
40
+
41
+ ### Env vars (CI / one-shot)
42
+
43
+ ```bash
44
+ export LOGURO_TOKEN=pat_xxx
45
+ export LOGURO_PROJECT=my-app
46
+ export LOGURO_BASE_URL=https://logu.ro # optional override
47
+ ```
48
+
49
+ `LOGURO_TOKEN` overrides the saved auth.json, useful for CI.
50
+
51
+ ### Project link
52
+
53
+ Link a directory so you don't have to specify the project every time:
54
+
55
+ ```bash
56
+ cd ~/work/api-prod
57
+ loguro link my-prod-app # writes ./.loguro: { "slug": "my-prod-app" }
58
+ loguro logs -l error # uses your PAT + the linked slug
59
+
60
+ # Or, if you have an app configured under a friendlier name:
61
+ loguro config add prod --slug=my-prod-app
62
+ loguro link prod # writes { "app": "prod" }
63
+ ```
64
+
65
+ Walk-up: from any subdirectory, the closest `.loguro` upwards is used. Commit it to git — no secrets stored, only the slug or app name.
66
+
67
+ ### Resolution order
68
+
69
+ 1. `--app <name>` flag (explicit per-command)
70
+ 2. `.loguro` in current dir or any ancestor (slug or app)
71
+ 3. Default app from config store
72
+ 4. `LOGURO_PROJECT` env / `--project` (with the active PAT)
73
+
74
+ The active PAT is `LOGURO_TOKEN` (env) or the saved `auth.json` (from `loguro login`).
75
+
76
+ ## Commands
77
+
78
+ ### Setup & diagnostics
79
+ ```
80
+ loguro init Interactive setup wizard (auth → project → key → link → first-log examples)
81
+ loguro doctor Health check: auth, backend, env, configured apps, all linked dirs, version
82
+ ```
83
+
84
+ ### Querying logs
85
+ ```
86
+ loguro logs Query logs with filters
87
+ loguro tail Follow new logs (poll)
88
+ loguro count Count logs (total or filtered)
89
+ loguro get Fetch a single log by ID with full context
90
+ loguro distinct List unique values for a field
91
+ loguro timeline Logs around a specific log ID
92
+ loguro trace All logs sharing a trace ID, in chronological order
93
+ loguro slow Slow requests above duration threshold
94
+ loguro sample Random sample of logs
95
+ loguro group Group logs by field
96
+ loguro replay Replay a window of logs as if streaming live, at adjustable speed
97
+ loguro investigate AI investigation of a log (uses your plan AI quota)
98
+ ```
99
+
100
+ ### Visualizations
101
+ ```
102
+ loguro top Top N values for a field with horizontal bars (level, message, context.X)
103
+ loguro chart Volume over time as compact sparkline or chunky bars (--bars)
104
+ loguro analytics Aggregated dashboard: levels, daily timeline, top errors, endpoints
105
+ loguro health Project health badge: error rate now vs previous, optional 24h trend
106
+ loguro diff Compare log patterns between two windows (new / spiked / dropped)
107
+ ```
108
+
109
+ ### Local config
110
+ ```
111
+ loguro config Manage app configurations (slug aliases)
112
+ loguro link Link current dir to a slug or app
113
+ loguro unlink Remove .loguro link
114
+ ```
115
+
116
+ ### Auth
117
+ ```
118
+ loguro login Save a PAT
119
+ loguro logout Remove the saved PAT
120
+ loguro whoami Show current user / token info
121
+ ```
122
+
123
+ ### Account & projects
124
+ ```
125
+ loguro projects List / create / rename / delete projects
126
+ loguro keys Manage project ingestion keys (used by your SDK)
127
+ loguro tokens Manage CLI tokens (PATs)
128
+ loguro usage Current month usage + plan caps
129
+ loguro billing Subscription, current plan, available plans
130
+ ```
131
+
132
+ ### Alerts & notifications
133
+ ```
134
+ loguro channels Manage notification channels (webhook | discord | slack | telegram)
135
+ loguro alerts Manage project alerts
136
+ loguro integrations Connect issue trackers (jira/linear/github) and message integrations (slack/discord/telegram)
137
+ ```
138
+
139
+ ### Workflow helpers
140
+ ```
141
+ loguro pin Pin recurring logs to track (📌 marker auto-shown on lists)
142
+ loguro share Create / list / revoke public markdown shares of logs (single or multi-log)
143
+ ```
144
+
145
+ ### Interactive mode
146
+
147
+ ```
148
+ loguro logs --interactive # or -i
149
+ ```
150
+
151
+ Opens a TUI navigator over your logs:
152
+
153
+ - `↑↓` / `jk` navigate, `enter` to inspect a log, `esc` back
154
+ - `/` live fuzzy search (highlights matches; prefix `=` for exact substring)
155
+ - `space` multi-select rows; `s` shares selected as one markdown page, `p` bulk pins, `c` copies all IDs
156
+ - `r` refresh, `?` keybindings overlay, `q` quit
157
+
158
+ In log detail:
159
+ - `e` AI explain (light) · `i` AI investigate (deep, code-aware)
160
+ - `a` create alert from this log (suspends interactive, runs full alert wizard, returns)
161
+ - `p` pin/unpin toggle (shows encounter count for recurring logs)
162
+ - `t` show all logs sharing the same trace ID
163
+ - `s` create public share, URL auto-copied to clipboard
164
+ - `c` copy log ID, `o` open in web console, `j` toggle JSON-colored context
165
+
166
+ All actions wired to the same backend endpoints as the standalone commands. Pipe-friendly: without `-i` everything stays plain text streamable.
167
+
168
+ ### Zero-UI workflow
169
+
170
+ Setup an entire project — including alerts and integrations — from the terminal:
171
+
172
+ ```bash
173
+ loguro login # paste pat_…
174
+
175
+ # Create project + ingestion key
176
+ loguro projects create "My API" # → slug auto-generated (e.g. happy-otter)
177
+ loguro keys create happy-otter --name=server # server key, default; → shown ONCE; copy into your SDK
178
+ loguro link happy-otter # link cwd to that slug
179
+
180
+ # Browser key for a frontend app (requires at least one --origin)
181
+ loguro keys create happy-otter --name=web --type=browser \
182
+ --origin=https://app.example.com \
183
+ --origin=https://staging.example.com
184
+
185
+ # Wire up notifications
186
+ loguro channels create --name=ops --type=slack \
187
+ --token=xoxb-… --channel=#alerts
188
+ loguro alerts create --name "prod errors" --channel=ops \
189
+ --levels=error,critical --cooldown=30
190
+
191
+ # Connect GitHub for AI-powered code-aware investigations
192
+ loguro integrations connect github --token=ghp_… \
193
+ --owner=mycompany --repo=api \
194
+ --allowAiCodeSearch
195
+
196
+ # Use it
197
+ loguro logs # see logs as soon as your SDK ships them
198
+ loguro investigate <logId> # AI explains the error using your repo
199
+ ```
200
+
201
+ Project secrets are shown only once at create time — copy them immediately.
202
+
203
+ Run `loguro <command> --help` for full options.
204
+
205
+ ### App shortcut
206
+
207
+ If you have an app named in config, use it as the first arg — equivalent to `--app=<name>`:
208
+
209
+ ```bash
210
+ loguro prod logs -l error # = loguro logs --app=prod -l error
211
+ loguro prod tail # = loguro tail --app=prod
212
+ loguro prod # = loguro logs --app=prod (last 20)
213
+ loguro staging slow # = loguro slow --app=staging
214
+ ```
215
+
216
+ ## Query syntax
217
+
218
+ The `logs`, `tail`, `slow`, and `sample` commands accept a query string with the **same syntax as the Loguro UI**, via `-q` or as a positional:
219
+
220
+ ```bash
221
+ loguro logs -q 'level:error @last-1h'
222
+ loguro 'level:error @last-1h' # positional shortcut
223
+ loguro prod 'level:error context.duration:>=500' # with app name
224
+ loguro tail 'level:critical|error'
225
+ ```
226
+
227
+ **Reference:**
228
+
229
+ | Token | Meaning |
230
+ |-------|---------|
231
+ | `level:error` / `level:error\|critical` | filter by level (OR with `\|`) |
232
+ | `!level:debug` | exclude levels |
233
+ | `message:"phrase with spaces"` | message substring (quote spaces) |
234
+ | `message:single` | unquoted single word |
235
+ | `!message:"foo"` | exclude messages |
236
+ | `trace:"abc123"` | trace ID |
237
+ | `context.user_id:42` | context field equals |
238
+ | `context.duration:>=500` | with operator (`=`, `!=`, `>`, `<`, `>=`, `<=`) |
239
+ | `!context.env:staging` | exclude context |
240
+ | `search:"payment"` | global search across message + context |
241
+ | `@today` / `@yesterday` / `@last-1h` / `@last-24h` / `@last-7d` | time range |
242
+ | `@"2 hours ago"` | natural language (chrono-node) |
243
+ | `from:@today to:"1 hour ago"` | explicit range |
244
+ | `!@yesterday` | exclude time range |
245
+ | `--errors` | shortcut: `level:error\|critical` |
246
+ | `--warn` / `--debug` / `--critical` / `--info` | level shortcuts |
247
+ | `--slow:1000` | duration > N ms |
248
+ | `--memory` | query saved task-context parquets |
249
+
250
+ Unrecognized tokens emit a warning suggesting how to quote them.
251
+
252
+ ## Examples
253
+
254
+ ### Setup (interactive wizards)
255
+
256
+ ```bash
257
+ # Full first-time setup — walks you to first log in under 2 min
258
+ loguro init
259
+
260
+ # Create a project interactively (offers to chain key + link)
261
+ loguro projects create
262
+
263
+ # Create a project non-interactively (CI / scripted)
264
+ loguro projects create "My API" --with-key=server --link
265
+ loguro projects create "Web App" --with-key=front --keyType=browser \
266
+ --origin=https://example.com --origin=http://localhost:3000
267
+
268
+ # Create a notification channel interactively (type select + per-type prompts with hints)
269
+ loguro channels create
270
+
271
+ # Create an alert from an existing log id (derives name/level/message-substring)
272
+ loguro alerts create --from-log 01KQ0E1ZTAP7YWFBK1S2K6XM2W
273
+ ```
274
+
275
+ ### Querying & investigation
276
+
277
+ ```bash
278
+ # Last 20 errors
279
+ loguro logs -l error
280
+
281
+ # Last 24h, payment-related, slower than 200ms, exclude staging
282
+ loguro logs --from 24h -m payment --slow 200 -c '!env=staging'
283
+
284
+ # Errors only, follow live
285
+ loguro tail -l error
286
+
287
+ # All envs in use
288
+ loguro distinct env
289
+
290
+ # Logs around an error
291
+ loguro timeline 01KQ0E1ZTAP7YWFBK1S2K6XM2W --window 60
292
+
293
+ # Random 20 errors with full context
294
+ loguro sample -n 20 -l error
295
+
296
+ # Group by level for error+critical
297
+ loguro group level -v error -v critical
298
+
299
+ # JSON output for piping into jq
300
+ loguro logs -l error --json | jq '.items[].message'
301
+
302
+ # Count for CI alerts
303
+ ERRORS=$(loguro count -q 'level:error @last-1h' --json | jq '.count | tonumber')
304
+ [ "$ERRORS" -gt 100 ] && curl -X POST $SLACK_WEBHOOK -d "alert: $ERRORS errors"
305
+
306
+ # Single log with full context
307
+ loguro get 01KQ0E1ZTAP7YWFBK1S2K6XM2W
308
+
309
+ # AI investigate (uses plan AI quota; cached after first run)
310
+ loguro investigate 01KQ0E1ZTAP7YWFBK1S2K6XM2W
311
+ loguro investigate 01KQ0E1ZTAP7YWFBK1S2K6XM2W --no-cache
312
+ loguro investigate 01KQ0E1ZTAP7YWFBK1S2K6XM2W --raw # streamed text for pipes
313
+ loguro get 01KQ0E1ZTAP7YWFBK1S2K6XM2W --investigate # show log + AI in sequence
314
+
315
+ # All logs sharing a trace ID, in chronological order (debug a request end-to-end)
316
+ loguro trace 01KQ0E1ZTAP7YWFBK1S2K6XM2W
317
+ loguro trace 01KQ0E1ZTAP7YWFBK1S2K6XM2W --no-showContext
318
+ loguro prod trace 01KQ0... # app shortcut works
319
+
320
+ # Trim output to specific fields (works on logs/tail/slow/sample)
321
+ loguro logs --fields message,context.service,context.userId
322
+ loguro logs -l error --fields timestamp,message,context.path
323
+ loguro logs --fields message --json | jq '.items[]'
324
+
325
+ # Replay a window of logs as if streaming live (with density chart at top)
326
+ loguro replay # last 5min @ 2x
327
+ loguro replay --from 1h --speed 10x # last hour at 10x speed
328
+ loguro replay --from "yesterday 14:00" --to "yesterday 15:00" --bars
329
+ loguro replay -l error --instant # just walk through with deltas
330
+ loguro replay --from 24h --speed 50x # gap-compression auto-skips quiet stretches
331
+ loguro replay --from 24h --no-compress-gaps # disable gap compression
332
+ ```
333
+
334
+ ## Visualizations
335
+
336
+ ```bash
337
+ # Top values for a field — horizontal bars with percent
338
+ loguro top level # last 24h by default
339
+ loguro top level --from 7d
340
+ loguro top message -l error -n 20 # top 20 error messages
341
+ loguro top context.service --from "3 days ago"
342
+ loguro top context.endpoint -l error # problematic endpoints
343
+ loguro top message --json | jq '.values[].value'
344
+
345
+ # Volume over time — sparkline (default) or chunky bars (--bars)
346
+ loguro chart # last 24h
347
+ loguro chart --bars # chunkier bar chart with axis
348
+ loguro chart -l error --from 7d --bars
349
+ loguro chart --notLevel heartbeat --bars # exclude noise
350
+ loguro chart --json | jq '.buckets[].value'
351
+
352
+ # Aggregated dashboard — levels, daily timeline, top errors, endpoints
353
+ loguro analytics # last 7d
354
+ loguro analytics --from 30d -l error
355
+ loguro analytics --json | jq '.byLevel'
356
+
357
+ # Health badge — error rate last 20min vs previous 20min, status (operational/degraded/incident)
358
+ loguro health # quick status check
359
+ loguro health --trend # adds 24h error-rate + volume sparklines
360
+ loguro health --json | jq '.status' # 'operational' | 'degraded' | 'incident'
361
+
362
+ # Compare windows — new patterns, spikes, drops between baseline and comparison
363
+ loguro diff yesterday # baseline yesterday vs current view
364
+ loguro diff 2-days-ago yesterday # explicit two-window
365
+ loguro diff "last monday" "today" # natural language windows
366
+ loguro diff yesterday --spike 100 --drop 30 # tighter thresholds
367
+ loguro diff yesterday --json | jq '.patterns[] | select(.status=="new")'
368
+ ```
369
+
370
+ ## Sharing logs
371
+
372
+ Public markdown links — anyone with the URL can view. Includes the log message, all context, trace timeline if any, and AI investigation if cached.
373
+
374
+ ```bash
375
+ # Single log
376
+ loguro share create 01KQ0E1ZTAP7YWFBK1S2K6XM2W
377
+
378
+ # Multiple logs as ONE markdown page (great for bug reports / Linear tickets)
379
+ loguro share create-context 01KQ0... 01KR3... 01KS9...
380
+
381
+ # List + revoke
382
+ loguro share list
383
+ loguro share delete <hash> # accepts 4+ char prefix
384
+ loguro share update <hash> <logId> # regenerate with fresh data (incl. new AI cache)
385
+ ```
386
+
387
+ In `loguro logs --interactive`, `space` to multi-select rows then `s` runs `share create-context` and copies the URL automatically.
388
+
389
+ ## Diagnostics
390
+
391
+ ```bash
392
+ # Full health check: auth, backend, env vars, configured aliases, all linked dirs, projects, version
393
+ loguro doctor
394
+
395
+ # Discover all .loguro files on disk (walks ~/Desktop, ~/code, ~/work, ~/projects, …)
396
+ loguro doctor --scan
397
+
398
+ # Custom scan root
399
+ loguro doctor --scan-root ~/dev/work
400
+
401
+ # JSON for tooling
402
+ loguro doctor --json | jq '.indexedLinks'
403
+ ```
404
+
405
+ Linked directories are recorded automatically when you run `loguro link` or `loguro init`. The index lives at `~/.config/loguro/links.json` and prunes itself when files are deleted.
406
+
407
+ ## Alerts & notifications
408
+
409
+ ```bash
410
+ # Channels — interactive (recommended; prompts include where to obtain credentials)
411
+ loguro channels create
412
+
413
+ # Channels — non-interactive (CI / scripted)
414
+ loguro channels create --name=ops --type=webhook --url=https://...
415
+ loguro channels create --name=ops-slack --type=slack --token=xoxb-... --channel=#alerts
416
+ loguro channels create --name=ops-tg --type=telegram --bot-token=... --chat-id=...
417
+ loguro channels list
418
+ loguro channels enable ops # / disable
419
+ loguro channels delete ops --yes
420
+
421
+ # Alerts — derive from an existing log (recommended after seeing an error in `loguro logs`)
422
+ loguro alerts create --from-log 01KQ0E1ZTAP7YWFBK1S2K6XM2W
423
+ # → opens a wizard pre-filled with name, level, message substring from that log
424
+
425
+ # Alerts — non-interactive
426
+ loguro alerts create --name "prod errors" --channel=ops \
427
+ --levels=error,critical \
428
+ --messageContains=payment \
429
+ --cooldown=30
430
+ loguro alerts list
431
+ loguro alerts show "prod errors"
432
+ loguro alerts update "prod errors" --levels=critical
433
+ loguro alerts disable "prod errors" # / enable
434
+ loguro alerts delete "prod errors" --yes
435
+ ```
436
+
437
+ ## Integrations
438
+
439
+ Connect issue trackers (for AI-aware investigation context) and per-project message integrations:
440
+
441
+ ```bash
442
+ # GitHub — enables AI code search in `loguro investigate`
443
+ loguro integrations connect github --token=ghp_… \
444
+ --owner=mycompany --repo=api \
445
+ --branch=main --allowAiCodeSearch
446
+
447
+ # Linear / Jira
448
+ loguro integrations connect linear --api-key=lin_… --teamId=...
449
+ loguro integrations connect jira --base-url=https://org.atlassian.net \
450
+ --email=you@x.com --api-token=... --project-key=BUG
451
+
452
+ # Per-project messaging (different from global channels)
453
+ loguro integrations connect slack --token=xoxb-… --channel=#alerts
454
+ loguro integrations connect discord --webhook-url=...
455
+ loguro integrations connect telegram --bot-token=… --chat-id=…
456
+
457
+ # Discover before connecting
458
+ loguro integrations github-repos --token=ghp_…
459
+ loguro integrations github-branches --owner=foo --repo=bar
460
+ loguro integrations linear-teams --api-key=lin_…
461
+
462
+ loguro integrations list
463
+ loguro integrations show github
464
+ loguro integrations disconnect github --yes
465
+ ```
466
+
467
+ ## Pinned logs
468
+
469
+ ```bash
470
+ loguro pin add <logId> --note "tracking until #1234 ships"
471
+ loguro pin list
472
+ loguro pin list --status watching # / resolved
473
+ loguro pin show <pinId>
474
+ loguro pin update <pinId> --status=resolved
475
+ loguro pin remove <pinId> --yes
476
+ ```
477
+
478
+ ## Account
479
+
480
+ ```bash
481
+ loguro usage # current period quota + caps
482
+ loguro usage --history # recent billing periods
483
+ loguro billing # plan + available upgrades
484
+ loguro tokens list # CLI tokens (PATs)
485
+ loguro tokens create --name=ci # → pat_… shown ONCE
486
+ loguro tokens delete <id> --yes
487
+ ```
488
+
489
+ ## Context filters
490
+
491
+ `-c key=value` filter on `context.<key>`. Repeatable. Supports operators and negation:
492
+
493
+ ```
494
+ -c user_id=42 # context.user_id = 42
495
+ -c duration>=500 # context.duration >= 500
496
+ -c '!env=staging' # NOT context.env = staging
497
+ ```
498
+
499
+ Operators: `=`, `!=`, `>`, `<`, `>=`, `<=`. Prefix `!` to negate.
500
+
501
+ ## Time ranges
502
+
503
+ `--from` / `--to` accept ISO dates, relative shorthand, **or natural language** (via `chrono-node`):
504
+
505
+ ```
506
+ --from 30m # 30 minutes ago
507
+ --from 24h # 24 hours ago
508
+ --from 7d # 7 days ago
509
+ --from 2w # 2 weeks ago
510
+ --from 2026-05-01 # ISO date
511
+ --from 2026-05-01T10:00:00Z
512
+
513
+ --from "3 days ago" # natural language
514
+ --from "yesterday"
515
+ --from "last monday"
516
+ --from "2 hours ago"
517
+ --to "yesterday at 18:00"
518
+
519
+ # Combinable
520
+ loguro logs --from "3 days ago" --to "yesterday" -l error
521
+ ```
522
+
523
+ If a time string can't be parsed, the CLI prints a warning and passes it through to the API (which will return `400` with the offending value).
524
+
525
+ ## When to use the CLI vs MCP vs Web Console
526
+
527
+ Loguro ships in three surfaces. Pick the one that fits the workflow — they share auth and project data, so you can switch freely.
528
+
529
+ | Reach for **Web Console** when... | Reach for **CLI** when... | Reach for **MCP** when... |
530
+ |---|---|---|
531
+ | Visual exploration: charts, timeline, replay, log shares | Scripting, CI alerts, pipe to `jq`, batch operations | Talking to Claude/Cursor in your IDE about prod logs without leaving the editor |
532
+ | First-time setup with interactive prompts (OAuth, integrations) | Reproducible setup as code: `loguro projects create` → `keys create` → `alerts create` in a script | "What errors hit payments in the last hour?" — natural language over your real logs |
533
+ | Saved views, command palette browsing, embed widgets | Long-lived PAT in env, single token across all projects | Code-aware investigation: AI sees the log AND your repo (when GitHub integration is connected) |
534
+ | Issue tracker creation with rich UI (Linear/Jira/GitHub) | `.loguro` link per directory, app shortcuts (`loguro prod logs`) | Quick context inline while debugging — no context switch |
535
+
536
+ ### Why MCP works zero-config
537
+
538
+ The MCP server reads the same `~/.config/loguro/auth.json` that `loguro login` writes. Set up the CLI once and the MCP works in **every** IDE you connect it to — no second login, no rotated credentials per session.
539
+
540
+ ### Latency and footprint
541
+
542
+ - **CLI:** single HTTP call per command, streamed JSON, predictable. Best for fetching thousands of rows or piping to other tools.
543
+ - **MCP:** 6 focused tools (~1k tokens of system prompt) — minimal context overhead vs MCPs that ship 30+ tools. Built for Claude to call iteratively without burning the conversation.
544
+ - **Web:** real-time UI with live mode, charts, and AI investigation streaming. Heaviest but only when interactivity matters.
545
+
546
+ ### Combine them
547
+
548
+ A common workflow:
549
+
550
+ 1. **Web** — set up the project, integrations, alerts once
551
+ 2. **CLI** — wire `loguro logs` into CI, scripts, alerts you trigger from cron
552
+ 3. **MCP** — debug interactively when an error comes in: ask Claude "what happened?", let it call `query_logs` + `get_log_timeline` to figure it out
553
+
554
+ All three see the same data. Pick by friction, not by capability.