loki-mode 11.3.0 → 11.3.1

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 (215) hide show
  1. package/README.md +68 -650
  2. package/SKILL.md +4 -4
  3. package/VERSION +1 -1
  4. package/autonomy/completion-council.sh +2 -2
  5. package/autonomy/context-tracker.py +4 -4
  6. package/autonomy/council-v2.sh +1 -1
  7. package/autonomy/grill.sh +1 -1
  8. package/autonomy/lib/done-recognition.sh +1 -1
  9. package/autonomy/lib/prd-enrich.sh +1 -1
  10. package/autonomy/lib/voter-agents.sh +1 -1
  11. package/autonomy/loki +99 -75
  12. package/autonomy/run.sh +30 -18
  13. package/autonomy/sandbox.sh +1 -1
  14. package/autonomy/tui.sh +6 -5
  15. package/autonomy/verify.sh +1 -1
  16. package/bin/loki +166 -59
  17. package/completions/_loki +2 -0
  18. package/completions/loki.bash +2 -2
  19. package/dashboard/__init__.py +1 -1
  20. package/dashboard/server.py +25 -31
  21. package/docs/ARCHITECTURE.md +337 -0
  22. package/docs/BRANDING.md +124 -0
  23. package/docs/CLI-REFERENCE.md +7 -1
  24. package/docs/COMPONENTS.md +447 -0
  25. package/docs/DEPLOYMENT.md +9 -9
  26. package/docs/DOCKER.md +469 -0
  27. package/docs/INSTALLATION.md +67 -1045
  28. package/docs/KNOWN-ISSUES.md +11 -35
  29. package/docs/TESTING.md +161 -0
  30. package/docs/air-gapped.md +1 -2
  31. package/docs/alternative-installations.md +14 -24
  32. package/docs/architecture/DECISIONS.md +333 -0
  33. package/docs/audit-logging.md +7 -7
  34. package/docs/authentication.md +3 -3
  35. package/docs/authorization.md +1 -1
  36. package/docs/certification/04-production-deployment/lab.md +6 -6
  37. package/docs/certification/04-production-deployment/lesson.md +4 -4
  38. package/docs/certification/README.md +1 -1
  39. package/docs/control-plane-container.md +2 -2
  40. package/docs/dev/real-run.md +34 -0
  41. package/docs/dev/release-checklist.md +2 -2
  42. package/docs/exit-codes.md +3 -3
  43. package/docs/git-workflow.md +3 -3
  44. package/docs/metrics.md +37 -55
  45. package/docs/network-security.md +1 -1
  46. package/docs/siem-integration.md +5 -5
  47. package/docs/v10/CLI-MODERN.md +4 -3
  48. package/docs/v10/DECISIONS.md +44 -0
  49. package/docs/v10/DEPS.md +22 -22
  50. package/docs/v10/ENGINE.md +1 -1
  51. package/docs/v10/FAILURE-CLASSES.md +118 -1
  52. package/docs/v10/FOUNDER-QUEUE.md +1 -0
  53. package/docs/v10/GUARDS.md +13 -0
  54. package/docs/v10/LEGACY-REMOVAL.md +4 -6
  55. package/docs/v10/METRICS.md +2 -2
  56. package/docs/v10/MODERNIZE.md +1 -1
  57. package/docs/v10/OPERATING-MODEL.md +2 -1
  58. package/docs/v10/PROGRESS.md +29 -0
  59. package/docs/v11/COST-HALF.md +352 -0
  60. package/docs/v11/MARKET-SLICES.md +315 -0
  61. package/docs/v11/REGISTRIES.md +730 -0
  62. package/loki-ts/data/model-pricing.json +52 -24
  63. package/loki-ts/dist/loki.js +1036 -957
  64. package/mcp/__init__.py +1 -1
  65. package/package.json +1 -1
  66. package/packages/control-plane/dist/server.js +2467 -736
  67. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  68. package/src/protocols/mcp-client.js +6 -2
  69. package/src/protocols/mcp-server.js +13 -3
  70. package/tools/audit-docs.py +1 -1
  71. package/web-app/dist/assets/{AdminPage-D_e45uTw.js → AdminPage-CMkHNJbF.js} +1 -1
  72. package/web-app/dist/assets/{Avatar-T3nIpoaf.js → Avatar-BJyjV7Zi.js} +1 -1
  73. package/web-app/dist/assets/{Badge-BKqb59pP.js → Badge-D572l0uq.js} +1 -1
  74. package/web-app/dist/assets/{Button-DjVlkh8_.js → Button-T4BnOZgl.js} +1 -1
  75. package/web-app/dist/assets/{CockpitPage-DXJgLGmh.js → CockpitPage-Cj_GFsNn.js} +1 -1
  76. package/web-app/dist/assets/{ComparePage-BRP_eVc_.js → ComparePage-A8m4ZXak.js} +1 -1
  77. package/web-app/dist/assets/{ErrorBoundary-CLjpGLjC.js → ErrorBoundary-hugCg5yg.js} +1 -1
  78. package/web-app/dist/assets/{EvidenceReceiptPanel-DX-vb4Xy.js → EvidenceReceiptPanel-CuJKDC2G.js} +1 -1
  79. package/web-app/dist/assets/{GitHubIssuesPanel-214HVHtX.js → GitHubIssuesPanel-BYGKjarC.js} +1 -1
  80. package/web-app/dist/assets/{GitHubPRsPanel-BEiZKc4t.js → GitHubPRsPanel-c7sFIJlf.js} +1 -1
  81. package/web-app/dist/assets/{HomePage-VvMHS5ga.js → HomePage-A1MIkG2P.js} +2 -2
  82. package/web-app/dist/assets/{LoginPage-5WD-v7n3.js → LoginPage-8KQMRhtR.js} +1 -1
  83. package/web-app/dist/assets/{MagicPage-DUQT_Jye.js → MagicPage-C05QW2Lx.js} +1 -1
  84. package/web-app/dist/assets/{MetricsPage-lga-z79v.js → MetricsPage-Oukv5hme.js} +1 -1
  85. package/web-app/dist/assets/{NotFoundPage-CGhBX3G1.js → NotFoundPage-DKIwsawz.js} +1 -1
  86. package/web-app/dist/assets/{ProjectPage-CdzF2GzZ.js → ProjectPage-DwFRPLCG.js} +3 -3
  87. package/web-app/dist/assets/{ProjectsPage-DRG64N8s.js → ProjectsPage-CgY4YYDX.js} +1 -1
  88. package/web-app/dist/assets/{SettingsPage-5fzW9Frb.js → SettingsPage-BpfcSjUA.js} +1 -1
  89. package/web-app/dist/assets/{ShowcasePage-DrTdxO4y.js → ShowcasePage-BqBakC4K.js} +1 -1
  90. package/web-app/dist/assets/{SystemSettingsPage-C9Mqs6Rd.js → SystemSettingsPage-CZLu5VB0.js} +1 -1
  91. package/web-app/dist/assets/{TeamsPage-CUGPdSWo.js → TeamsPage-D55S1jKz.js} +1 -1
  92. package/web-app/dist/assets/{TemplatesPage-CNraDY0F.js → TemplatesPage-D3SydvxN.js} +1 -1
  93. package/web-app/dist/assets/{TerminalOutput-BIu_6Pea.js → TerminalOutput-hNg8G1-e.js} +1 -1
  94. package/web-app/dist/assets/{activity-Bk-kgqaf.js → activity-D2C0VagO.js} +1 -1
  95. package/web-app/dist/assets/{bell-BXmUdmo8.js → bell-CMvYi36w.js} +1 -1
  96. package/web-app/dist/assets/{bot-CiuzXxUR.js → bot-BvtQ6lmo.js} +1 -1
  97. package/web-app/dist/assets/{check-BEzjXppd.js → check-B13xkXed.js} +1 -1
  98. package/web-app/dist/assets/{chevron-left-AYWCXHf8.js → chevron-left-emu6r49E.js} +1 -1
  99. package/web-app/dist/assets/{circle-alert-BNg2uSRq.js → circle-alert-CExlwjuy.js} +1 -1
  100. package/web-app/dist/assets/{clock-DTj0kkGT.js → clock-D7Uas3oL.js} +1 -1
  101. package/web-app/dist/assets/{cloud-x4nTDBLT.js → cloud-CkB4S86C.js} +1 -1
  102. package/web-app/dist/assets/{code-xml-BVh_MLrk.js → code-xml-SL9IIWIn.js} +1 -1
  103. package/web-app/dist/assets/{database-DdfBaowG.js → database-BQFkd7t1.js} +1 -1
  104. package/web-app/dist/assets/{dollar-sign-XuYFmAOY.js → dollar-sign-qHmnNYsU.js} +1 -1
  105. package/web-app/dist/assets/{file-code-corner-D4cRnmeL.js → file-code-corner-C2YUDP0K.js} +1 -1
  106. package/web-app/dist/assets/{file-plus-CyoVlHc_.js → file-plus-C_ooIkDe.js} +1 -1
  107. package/web-app/dist/assets/{globe-Y6IK2RPW.js → globe-CQ-GL485.js} +1 -1
  108. package/web-app/dist/assets/{hammer-BKzr9VZI.js → hammer-U05L_D7V.js} +1 -1
  109. package/web-app/dist/assets/{index-B20cSx5G.js → index-CooHd7I-.js} +3 -3
  110. package/web-app/dist/assets/{layers-DebNOhGS.js → layers-Buo17rjW.js} +1 -1
  111. package/web-app/dist/assets/{loader-circle-DyGbrEgd.js → loader-circle-15vK3oV1.js} +1 -1
  112. package/web-app/dist/assets/{lock-BKPpyt20.js → lock-BeXLebuJ.js} +1 -1
  113. package/web-app/dist/assets/{package-egF5Wi4y.js → package-MVh_6-6R.js} +1 -1
  114. package/web-app/dist/assets/{plus-OiEgKIc-.js → plus-Dh_nd9vS.js} +1 -1
  115. package/web-app/dist/assets/{refresh-cw-CzKvrONq.js → refresh-cw-C9cBJEAT.js} +1 -1
  116. package/web-app/dist/assets/{rotate-ccw-Bu2mII0p.js → rotate-ccw-D3PAtzST.js} +1 -1
  117. package/web-app/dist/assets/{scroll-text-CSkiyax8.js → scroll-text-DZCoXQjo.js} +1 -1
  118. package/web-app/dist/assets/{server-DlPthJFw.js → server-OCOLI5J_.js} +1 -1
  119. package/web-app/dist/assets/{shield-alert-CbpHWQQX.js → shield-alert-oVhmf1_h.js} +1 -1
  120. package/web-app/dist/assets/{thumbs-up-DgGpZe-Q.js → thumbs-up-B-kbX4vN.js} +1 -1
  121. package/web-app/dist/assets/{trash-2-BV3GlCB-.js → trash-2-EL6moveW.js} +1 -1
  122. package/web-app/dist/assets/{trending-down-Y4TJtXhD.js → trending-down-Cl3kjpsx.js} +1 -1
  123. package/web-app/dist/assets/{trending-up-DsDNoHZY.js → trending-up-DST7I6M2.js} +1 -1
  124. package/web-app/dist/assets/{upload-gkThrc_I.js → upload-CUOT780G.js} +1 -1
  125. package/web-app/dist/assets/{usePolling-jpNSeNAe.js → usePolling-Djmt90eb.js} +1 -1
  126. package/web-app/dist/assets/{user-3Zez1WOK.js → user-BRBohA6J.js} +1 -1
  127. package/web-app/dist/index.html +1 -1
  128. package/docs/ARCHITECTURE-OVERVIEW.md +0 -209
  129. package/docs/AUTONOMI-ECOSYSTEM.md +0 -107
  130. package/docs/COCKPIT-SPEC.md +0 -72
  131. package/docs/COCKPIT-UX-MANDATE.md +0 -53
  132. package/docs/COMPETITIVE-ANALYSIS.md +0 -303
  133. package/docs/COMPETITIVE-NEXT-10.md +0 -316
  134. package/docs/COMPETITIVE-RALPH-ZEROSHOT-2026-07-08.md +0 -81
  135. package/docs/DASHBOARD-9.12-EVIDENCE.md +0 -97
  136. package/docs/DASHBOARD-ARCHITECTURE.md +0 -425
  137. package/docs/DASHBOARD_V2_CHECKLIST.md +0 -243
  138. package/docs/DEMOS.md +0 -63
  139. package/docs/ENTERPRISE-IDENTITY-ROADMAP.md +0 -206
  140. package/docs/EVIDENCE-RECEIPT-BUILD-APPLICABILITY.md +0 -79
  141. package/docs/FEAT-PRDREUSE-DOCKER-PLAN.md +0 -144
  142. package/docs/GATE-FAILURE-TRIAGE.md +0 -254
  143. package/docs/HANDOFF-2026-08-03.md +0 -439
  144. package/docs/LOOP-CANDIDATE-PROPOSAL-v1.md +0 -167
  145. package/docs/LOOP-HARNESS-AUDIT.md +0 -684
  146. package/docs/MERGE-DEDUP-MAP.md +0 -420
  147. package/docs/MERGE-ROUTE-MAP.md +0 -139
  148. package/docs/MODEL-REGISTRY-PLAN.md +0 -155
  149. package/docs/OUTCOME-FRONTIER.md +0 -536
  150. package/docs/P2-SPEC-ROBUSTNESS-PLAN.md +0 -192
  151. package/docs/PLANS-INDEX.md +0 -32
  152. package/docs/PRD-REUSE-DONE-RECOGNITION-PLAN.md +0 -536
  153. package/docs/PROMPT-ABLATION-RESULT.md +0 -97
  154. package/docs/R4-TRUST-TRAJECTORY-DESIGN.md +0 -127
  155. package/docs/R5-AUTO-WIKI-DESIGN.md +0 -137
  156. package/docs/R6-ROLLBACK-CHECKPOINT-PLAN.md +0 -107
  157. package/docs/R7-ZERO-CONFIG-FIRST-RUN-PLAN.md +0 -137
  158. package/docs/R8-SHAREABLE-TEAM-ASSETS-PLAN.md +0 -129
  159. package/docs/R9-OPEN-CORE-HOOKS-PLAN.md +0 -113
  160. package/docs/RARV-C-100X-PLAN.md +0 -286
  161. package/docs/RARV-C-LOOP-EFFICIENCY-PLAN.md +0 -470
  162. package/docs/SHAREABLE-PROOF-PLAN.md +0 -194
  163. package/docs/SONNET5-DEFAULT-PLAN.md +0 -157
  164. package/docs/SPEED-AND-FIRST-PASS-PLAN.md +0 -281
  165. package/docs/STALE-STATE-AUDIT.md +0 -174
  166. package/docs/SYNERGY-TASKS.md +0 -143
  167. package/docs/TASKLIST-ACCURACY-PLAN.md +0 -355
  168. package/docs/TOP-100-BACKLOG.md +0 -159
  169. package/docs/V8-ACCEPTANCE-TRIAGE-2026-07-24.md +0 -114
  170. package/docs/V8-COMPLEXITY-AUDIT-2026-07-24.md +0 -45
  171. package/docs/V8-MAJOR-RELEASE-PLAN.md +0 -137
  172. package/docs/V8-OVERNIGHT-PLAN-2026-07-25.md +0 -82
  173. package/docs/V8-SDK-RESEARCH-RAW.md +0 -129
  174. package/docs/WELCOME-OPENER-PLAN.md +0 -106
  175. package/docs/adoption-baseline-2026-07-31.md +0 -84
  176. package/docs/architecture/bmad-integration-epic.md +0 -271
  177. package/docs/architecture/bmad-integration-review.md +0 -86
  178. package/docs/architecture/bmad-integration-validation.md +0 -249
  179. package/docs/architecture/bmad-loki-voice-agent-council-analysis.md +0 -61
  180. package/docs/auto-claude-comparison.md +0 -250
  181. package/docs/bug-fixes/agent-01-cli-fixes.md +0 -101
  182. package/docs/bug-fixes/agent-02-purplelab-fixes.md +0 -88
  183. package/docs/bug-fixes/agent-03-dashboard-fixes.md +0 -119
  184. package/docs/bug-fixes/agent-04-memory-fixes.md +0 -105
  185. package/docs/bug-fixes/agent-05-provider-fixes.md +0 -86
  186. package/docs/bug-fixes/agent-06-integration-fixes.md +0 -101
  187. package/docs/bug-fixes/agent-07-dash-run-fixes.md +0 -101
  188. package/docs/bug-fixes/agent-08-docker-fixes.md +0 -164
  189. package/docs/bug-fixes/agent-09-e2e-build-fixes.md +0 -69
  190. package/docs/bug-fixes/agent-10-e2e-fullstack-fixes.md +0 -102
  191. package/docs/bug-fixes/agent-11-e2e-session-fixes.md +0 -70
  192. package/docs/bug-fixes/agent-12-scenario-fixes.md +0 -120
  193. package/docs/bug-fixes/agent-13-enterprise-fixes.md +0 -143
  194. package/docs/bug-fixes/agent-14-uat-newuser-fixes.md +0 -88
  195. package/docs/bug-fixes/agent-15-uat-poweruser-fixes.md +0 -132
  196. package/docs/bug-fixes/agent-19-code-review.md +0 -316
  197. package/docs/bug-fixes/agent-20-architecture-review.md +0 -331
  198. package/docs/competitive/bolt-new-analysis.md +0 -579
  199. package/docs/competitive/emergence-others-analysis.md +0 -605
  200. package/docs/competitive/replit-lovable-analysis.md +0 -622
  201. package/docs/dashboard-guide.md +0 -487
  202. package/docs/enterprise/migration.md +0 -265
  203. package/docs/history/one-run-audit.md +0 -304
  204. package/docs/plans/FORGE-AUTONOMOUS-QUEUE.md +0 -312
  205. package/docs/plans/ULTRAPLAN-FORGE-BAAS.md +0 -612
  206. package/docs/plans/UT2-6-LSP-DIAGNOSTIC-BROADCAST.md +0 -394
  207. package/docs/prd-purple-lab-ide.md +0 -152
  208. package/docs/prd-purple-lab-platform-v2.md +0 -223
  209. package/docs/prd-purple-lab-platform.md +0 -319
  210. package/docs/retrospectives/v7.5.15-fleet-postmortem.md +0 -325
  211. package/docs/retrospectives/v7.5.15-honesty-audit.md +0 -136
  212. package/docs/retrospectives/v7.5.15-llm-failure-modes.md +0 -49
  213. package/docs/show-hn-post.md +0 -46
  214. package/docs/test-scenarios/enterprise-scenarios.md +0 -732
  215. package/docs/thick2thin.md +0 -173
@@ -1,1132 +1,154 @@
1
1
  # Loki Mode Installation Guide
2
2
 
3
- The flagship product of [Autonomi](https://www.autonomi.dev/). Loki Mode is a spec-driven autonomous builder with a built-in trust layer that takes any spec to a deployed product and verifies completion with evidence (quality gates plus a completion council), not just a "done" claim. Complete installation instructions for all platforms and use cases.
3
+ Loki Mode, by [Autonomi](https://www.autonomi.dev/), turns a spec or an issue into a verified pull request with a receipt you can check. This page covers installing it, a first run, and the options around it.
4
4
 
5
- **Version:** v11.3.0
5
+ **Version:** v11.3.1
6
6
 
7
- **Engine note:** `loki "<task>"`, `loki owner/repo#N` and `loki quick` run the Loki 10 engine. `loki start` still routes to the legacy engine, which is being removed (planned work resumes 2026-10-07); prefer `loki owner/repo#N`. See [docs/v10/GUIDE.md](v10/GUIDE.md).
7
+ **Engine note:** `loki "<task>"`, `loki owner/repo#N` and `loki quick` run the Loki 10 engine. `loki start` still routes to the older engine, which is being removed; prefer `loki owner/repo#N`. See the [user guide](v10/GUIDE.md).
8
8
 
9
9
  ---
10
10
 
11
- ## What's New in v7.5.x
11
+ ## Install
12
12
 
13
- ### Phase 1 RARV-C closure (shipped v7.5.0, default-on as of v7.5.3)
14
- Phase 1 closure features now activate automatically when you run
15
- `loki start` -- no env flags required. Power users can opt out by
16
- setting any flag to `0`.
13
+ Pick one. All three install the same `loki` CLI.
17
14
 
18
- - `findings_injector.ts` -- structured per-finding records (severity, file,
19
- line, reviewer) injected into the next iteration's prompt instead of bare
20
- comma-separated tokens. Default: ON. Opt out with `LOKI_INJECT_FINDINGS=0`.
21
- - `counter_evidence.ts` -- override council. Drop a
22
- `.loki/state/counter-evidence-<iter>.json` to dispute reviewer findings;
23
- approval lifts the BLOCK. Default: ON. Opt out with `LOKI_OVERRIDE_COUNCIL=0`.
24
- - `learnings_writer.ts` -- automatic structured learnings to
25
- `.loki/state/relevant-learnings.json` on every code_review failure.
26
- Default: ON. Opt out with `LOKI_AUTO_LEARNINGS=0`.
27
- - `escalation_handoff.ts` -- structured human-handoff doc to
28
- `.loki/escalations/handoff-*.md` before PAUSE. Default: ON. Opt out
29
- with `LOKI_HANDOFF_MD=0`.
30
- - `loki status` shows a "Phase 1 artifacts" section when findings,
31
- learnings, or escalations exist (added v7.5.5; see the `phase1` block
32
- in `loki status --json`).
33
- - See `skills/quality-gates.md` for full schema and reachability notes.
34
-
35
- ### Output-token compressor (caveman, default-on, Claude-only)
36
- Loki integrates [caveman](https://github.com/JuliusBrussee/caveman), an optional
37
- Claude Code skill that compresses the model's OUTPUT tokens only (keeping all
38
- technical substance). It activates on free-form generation (the main RARV dev
39
- loop) and is HARD-SUPPRESSED on every trust-gate subcall (council votes, code
40
- review verdict, evidence-related parses) so determinism is never affected.
41
- - Claude-provider-only; runs are byte-identical on Cline / Codex / Aider / opencode.
42
- - Default on; opt out with `LOKI_CAVEMAN=0`.
43
- - Level: `LOKI_CAVEMAN_LEVEL` (default `full`; also `lite`, `ultra`, `wenyan*`).
44
- - Pinned + vendor-less: `LOKI_CAVEMAN_VERSION` (default `1.9.0`); Loki bootstraps
45
- the pinned version on demand (opt out `LOKI_CAVEMAN_AUTO_BOOTSTRAP=0`).
46
- - Savings are output-token-only and bounded; Loki never quotes a dollar figure.
47
- - See `skills/quality-gates.md` (Output-token compressor) for details.
48
-
49
- ### Earlier highlights still in scope
50
- - Bash-to-Bun runtime migration in progress (see `UPGRADING.md`)
51
- - Provider-agnostic runtime: Claude (full), Cline, Codex, Aider, opencode (no vendor lock-in)
52
- - Memory system (episodic / semantic / procedural)
53
- - ChromaDB semantic code search via MCP
54
-
55
- ---
56
-
57
- ## Table of Contents
58
-
59
- - [Bun (Recommended)](#bun-recommended)
60
- - [npm](#npm)
61
- - [Homebrew](#homebrew)
62
- - [Quick Start](#quick-start)
63
- - [Verify Installation](#verify-installation)
64
- - [Other Methods](#other-methods)
65
- - [VS Code Extension (Deprecated)](#vs-code-extension-deprecated)
66
- - [Sandbox Mode](#sandbox-mode)
67
- - [Multi-Provider Support](#multi-provider-support)
68
- - [Environment Variables](#environment-variables)
69
- - [Claude Code (CLI)](#claude-code-cli)
70
- - [Claude.ai (Web)](#claudeai-web)
71
- - [Anthropic API Console](#anthropic-api-console)
72
- - [Ports](#ports)
73
- - [Shell Completions](#shell-completions)
74
- - [Troubleshooting](#troubleshooting)
75
-
76
- ---
77
-
78
- ## Bun (Recommended)
79
-
80
- ```bash
81
- bun install -g loki-mode
82
- ```
83
-
84
- Installs the `loki` CLI. Bun is the recommended path: the `loki` shim runs the
85
- faster TypeScript runtime when `bun` is on `PATH`, and the stable bash engine
86
- (the autonomous loop, quality gates, and completion council) runs underneath on
87
- every route, so you lose nothing by choosing Bun. Run `loki setup-skill` once
88
- after install to create the per-provider skill symlinks (Claude Code, Codex CLI).
89
-
90
- **Prerequisites:** Bun 1.3+ (`curl -fsSL https://bun.sh/install | bash`, or
91
- `brew install oven-sh/bun/bun`). No separate Node install is required.
92
-
93
- **Update:** `bun update -g loki-mode`
94
-
95
- **Uninstall:** `bun remove -g loki-mode`
96
-
97
- ---
98
-
99
- ## npm
100
-
101
- ```bash
102
- npm install -g loki-mode
103
- ```
104
-
105
- A fully supported alternative when you prefer npm or do not have Bun. As of
106
- v7.4.12 there is no postinstall step; run `loki setup-skill` once after install
107
- to create the per-provider skill symlinks (Claude Code, Codex CLI). The `loki`
108
- shim auto-routes read-only commands to the Bun runtime when `bun` is on `PATH`
109
- and falls back to the bash CLI otherwise (the core autonomous engine is the
110
- same on both routes).
111
-
112
- **Prerequisites:** Node.js 20+ (Node 22 LTS recommended; it is the primary
113
- tested/CI target). Bun 1.3+ optional but recommended for the faster routed
114
- commands and forward-compat with v8.0.0.
115
-
116
- **What it does:**
117
- - Installs the `loki` CLI binary to your PATH (`bin/loki` shim)
118
- - Subsequent `loki setup-skill` creates symlinks at `~/.claude/skills/loki-mode`, `~/.codex/skills/loki-mode`
119
-
120
- **Anonymous telemetry is ON by default for an individual interactive install**
121
- and auto-off in CI, non-interactive sessions, and when `LOKI_ENTERPRISE=true` or
122
- `LOKI_AIRGAP=true` is set. It is disclosed once on first use. Turn it off with
123
- `loki telemetry off`; `loki doctor --airgap` shows its current state. To make
124
- opting in impossible across a fleet, bake an opt-out into your base image
125
- (opt-out always wins):
126
15
  ```bash
127
- # Hard-disable everywhere (belt and suspenders; opt-out always wins):
128
- LOKI_TELEMETRY_DISABLED=true npm install -g loki-mode
129
- # Or set DO_NOT_TRACK=1
16
+ npm install -g loki-mode # Node.js 20+ (Node 22 LTS is the CI target)
17
+ bun install -g loki-mode # Bun 1.3+
18
+ brew tap asklokesh/tap && brew install loki-mode # Homebrew
130
19
  ```
131
- See [PRIVACY.md](./PRIVACY.md) for the exact data sent and the full opt-in /
132
- opt-out model.
133
20
 
134
- **Update:** `npm update -g loki-mode`
135
-
136
- **Uninstall:** `npm uninstall -g loki-mode`
137
-
138
- ---
21
+ The Loki 10 engine runs on Bun. The npm package bundles a Bun binary for macOS and Linux (x64 and arm64) as an optional dependency, so a plain npm install needs nothing else. With Homebrew, install Bun too if you do not have it: `brew install oven-sh/bun/bun`.
139
22
 
140
- ## Slim install (no bundled bun)
141
-
142
- ```bash
143
- npm install -g loki-mode --omit=optional
144
- ```
145
-
146
- Install Loki Mode without the bundled bun binary. This reduces the package size by 62-86 MB per platform but requires you to manage the Loki 10 engine dependency separately.
147
-
148
- **What it skips:**
149
- - `bun` (62-86 MB binary for darwin-aarch64, darwin-x64, linux-aarch64, linux-x64)
150
- - Claude Agent SDK packages
151
- - OpenTelemetry instrumentation packages
152
-
153
- **What happens:**
154
- - Loki 10 requires Bun. Each `loki` command prints an error on stderr if Bun is not found: "loki: the Loki 10 engine cannot run on this machine: no working bun (none on PATH, and the bundled bun for darwin-aarch64 is missing). To fix: install bun from https://bun.sh, or reinstall loki-mode without --omit=optional."
155
-
156
- **To restore Loki access:**
157
- - Install bun: `curl -fsSL https://bun.sh/install | bash` or `brew install oven-sh/bun/bun`
158
- - Or reinstall loki-mode without the flag: `npm install -g loki-mode`
159
-
160
- ---
161
-
162
- ## Homebrew
163
-
164
- ```bash
165
- brew tap asklokesh/tap && brew install loki-mode
166
- ```
167
-
168
- Installs the `loki` CLI. Loki 10 requires Bun; if bun is not installed, run `brew install oven-sh/bun/bun`. Without bun, each command exits 1 with an error message.
169
-
170
- To also install the skill for interactive use with all providers:
23
+ The npm postinstall step repoints any stale skill links and installs shell completions (skipped in CI or with `LOKI_NO_COMPLETIONS=1`). It never fails the install. To install the Loki skill into each detected provider CLI (`~/.claude/skills/`, `~/.codex/skills/`, ...), run:
171
24
 
172
25
  ```bash
173
26
  loki setup-skill
174
27
  ```
175
28
 
176
- **Update:** `brew upgrade loki-mode`
177
-
178
- **Uninstall:** `brew uninstall loki-mode`
179
-
180
- ---
181
-
182
- ## PyPI / Python SDK
183
-
184
- **The `loki` CLI is NOT available via `pip install loki-mode`.** PyPI hosts only the
185
- Python REST client SDK at `loki-mode-sdk` (v7.4.18+). The dashboard, MCP server,
186
- and orchestrator components ship via npm, Docker, and Homebrew only.
187
-
188
- ```bash
189
- # Install the Python REST client only
190
- pip install loki-mode-sdk
191
-
192
- # Install the full CLI (recommended)
193
- bun install -g loki-mode # or: npm install -g loki-mode, or: brew tap asklokesh/tap && brew install loki-mode
194
- ```
195
-
196
- The naming asymmetry (`loki-mode` on npm vs `loki-mode-sdk` on PyPI) is
197
- intentional: PyPI's `loki-mode` namespace is reserved for a future server
198
- package, while `loki-mode-sdk` is the thin client.
199
-
200
- ---
201
-
202
- ## Quick Start
203
-
204
- New here? `loki quickstart` (v7.29.0) walks you through your first build in
205
- four questions (setup check, one-line idea, template pick, plan review with
206
- a real cost estimate before anything is spent). Pressing Enter at every step
207
- builds the sample Todo app.
208
-
209
- ```bash
210
- loki quickstart
211
- ```
212
-
213
- For a fully specified first build, provide the idea, an optional exact shipped
214
- starter template, and explicit consent:
215
-
216
- ```bash
217
- loki quickstart "an internal reporting workspace" --template dashboard --yes
218
- ```
219
-
220
- Use `--dry-run` instead of `--yes` to preview the same template and plan without
221
- provider discovery, file writes, or execution; add `--json` for one versioned
222
- machine-readable object.
223
-
224
- For a local pipeline, pass that object to `--from-preview - --yes`. Loki accepts
225
- at most 1 MiB from non-terminal stdin, revalidates the schema, and recomputes the
226
- current estimate before the explicitly consented build starts:
227
-
228
- ```bash
229
- loki quickstart "an internal reporting workspace" --template dashboard --dry-run --json \
230
- | loki quickstart --from-preview - --yes
231
- ```
232
-
233
- Omit `--yes`, pipe malformed or oversized JSON, or use `-` from a terminal and
234
- the continuation exits `2` before provider discovery, PRD writes, or execution.
235
-
236
- Drop a spec -- any artifact that describes what you want built -- and Loki
237
- Mode takes it from spec to deployed app. Specs can be a markdown PRD, a
238
- GitHub issue URL, or a YAML feature description.
29
+ ### Slim install (no bundled Bun)
239
30
 
240
31
  ```bash
241
- # CLI mode (works with any provider) -- spec as markdown PRD
242
- loki start ./spec.md
243
- loki start ./spec.md --provider codex
244
- loki start ./spec.md --provider cline
245
-
246
- # Spec as a GitHub issue -- pass it positionally, it is auto-detected
247
- loki start https://github.com/owner/repo/issues/42
248
- loki start owner/repo#42
249
-
250
- # Spec as a YAML feature description
251
- loki start ./feature.yaml
252
-
253
- # Interactive mode (inside your coding agent)
254
- claude --dangerously-skip-permissions
255
- # Then say: "Loki Mode with spec at ./my-spec.md"
256
- ```
257
-
258
- ---
259
-
260
- ## Verify Installation
261
-
262
- ```bash
263
- loki --version # Should print the current version
264
- loki doctor # Check skill symlinks, providers, and system prerequisites
265
- ```
266
-
267
- ---
268
-
269
- ## Configuration file
270
-
271
- Instead of exporting many `LOKI_*` env vars, point `loki start` at a config file with `--config <path>` (aliases: `--env-file`, `--vars`), or set `LOKI_CONFIG_FILE`. The format is detected from the extension or content: `.yaml`/`.yml`, `.json`, or `.env` (flat `LOKI_*=value` lines). Values resolve by precedence: a CLI flag beats an ambient env var, which beats the `--config` file, which beats built-in defaults. Never inline a secret; reference an env var with `${VAR}` and the loader expands it at load time (an unset reference is skipped with a warning, and a raw-looking secret literal is flagged and rejected by `loki config validate`). Run `loki config example` to generate an annotated starter.
272
-
273
- ```bash
274
- # config.yaml
275
- dashboard:
276
- port: 9000
277
- github:
278
- token: ${GITHUB_TOKEN} # expanded from the environment, never stored inline
279
-
280
- loki start --config config.yaml ./prd.md
281
- loki config validate config.yaml # check refs and reject raw secrets before a run
282
- ```
283
-
284
- ---
285
-
286
- ## Other Methods
287
-
288
- Git clone and Docker installation methods are also available. See
289
- [alternative-installations.md](alternative-installations.md) for details and
290
- trade-offs.
291
-
292
- ---
293
-
294
- ## VS Code Extension (Deprecated)
295
-
296
- > **DEPRECATED as of v7.2.0.** The Loki Mode VS Code extension is no longer
297
- > maintained. Use the Control Plane (`loki dashboard`) instead.
298
- >
299
- > The marketplace listing remains for users on v7.2.0 and earlier but will
300
- > not receive further updates. The `vscode-extension/` source remains in the
301
- > repository for contributors who want to build the extension locally; it is
302
- > no longer published to the VS Code Marketplace and is not included in npm
303
- > tarballs.
304
-
305
- ### Recommended replacement: the dashboard
306
-
307
- ```bash
308
- loki dashboard
309
- # Opens the Control Plane (default http://127.0.0.1:47821).
310
- ```
311
-
312
- The dashboard provides session monitoring, task views, the completion
313
- council, log streaming, and the managed-memory panel -- the same surface
314
- the extension exposed, plus everything added since v7.2.0.
315
-
316
- ---
317
-
318
- ## Sandbox Mode
319
-
320
- Run Loki Mode in an isolated Docker container for enhanced security.
321
-
322
- ### Features
323
-
324
- - **Docker isolation**: Complete process isolation from host system
325
- - **Seccomp profiles**: Restricted system calls
326
- - **Resource limits**: CPU, memory, and process limits enforced
327
- - **Dropped capabilities**: Minimal Linux capabilities
328
- - **Read-only rootfs**: Immutable container filesystem
329
- - **Git worktree fallback**: Automatic fallback when Docker unavailable
330
-
331
- ### Usage
332
-
333
- ```bash
334
- # Run in sandbox mode (spec can be PRD, issue link, or YAML)
335
- ./autonomy/sandbox.sh ./my-spec.md
336
-
337
- # With provider selection
338
- ./autonomy/sandbox.sh --provider codex ./my-spec.md
32
+ npm install -g loki-mode --omit=optional
339
33
  ```
340
34
 
341
- ### Security Controls
35
+ Skips the bundled Bun binary (62 to 86 MB per platform), the Claude Agent SDK and the OpenTelemetry packages. You then need Bun on `PATH` (`curl -fsSL https://bun.sh/install | bash`); without it every command exits with an error that says how to fix it.
342
36
 
343
- #### Prompt Injection Protection
37
+ ### Python SDK
344
38
 
345
- By default, prompt injection is **disabled** for enterprise safety:
39
+ `pip install loki-mode-sdk` installs only the Python REST client. The `loki` CLI is not on PyPI.
346
40
 
347
- ```bash
348
- # Default: prompt injection disabled
349
- ./autonomy/run.sh ./my-spec.md
350
-
351
- # Opt-in to enable prompt injection
352
- LOKI_PROMPT_INJECTION=true ./autonomy/run.sh ./my-spec.md
353
- ```
354
-
355
- #### Human Input Security
356
-
357
- The `HUMAN_INPUT.md` file has security controls:
358
- - **Symlink protection**: Symlinks are rejected
359
- - **Size limit**: Maximum 1MB file size
360
- - **Path validation**: Must be within `.loki/` directory
361
-
362
- ### When to Use Sandbox Mode
41
+ ### Docker and other methods
363
42
 
364
- - Running untrusted spec files (PRD, issue export, YAML)
365
- - Enterprise environments with strict security requirements
366
- - Automated CI/CD pipelines
367
- - Multi-tenant deployments
43
+ See [alternative-installations.md](alternative-installations.md) for Docker, the GitHub Action and a git clone install.
368
44
 
369
45
  ---
370
46
 
371
- ## Multi-Provider Support
372
-
373
- Loki Mode supports five active providers across three capability modes, plus historical/upcoming entries. Pick by capability + cost.
374
-
375
- ### Supported Providers
376
-
377
- | Provider | Status | Tier | Notes |
378
- |----------|--------|------|-------|
379
- | `claude` | Active | Tier 1 (full) | Default. All features incl. Task subagents, MCP, council. |
380
- | `cline` | Active | Tier 2 | Full feature set; small models (<13B) may fail tool-use. |
381
- | `codex` | Active | Tier 3 (degraded) | Sequential only, no Task tool; aligned with `@openai/codex` v0.125+. |
382
- | `aider` | Active | Tier 3 (degraded) | Sequential only; `ollama_chat/<model>` works for local models. |
383
- | `opencode` | Active | Sequential | Model-agnostic route (`providers/opencode.sh`); autonomous flag `--auto`. Install: `npm install -g opencode-ai`. |
384
- | `gemini` | REMOVED v7.5.18 | -- | Upstream Gemini CLI deprecated by Google. Runtime removed; `LOKI_PROVIDER=gemini` exits with a migration message. |
385
-
386
- When `LOKI_PROVIDER` is unset, Loki auto-detects the first installed provider in
387
- this order: `claude`, `cline`, `codex`, `aider`, `opencode`
388
- (`providers/loader.sh:191`). An explicit `LOKI_PROVIDER` always wins and is
389
- never silently substituted.
390
-
391
- ### Configuration
392
-
393
- #### Environment Variable
394
-
395
- Set the `LOKI_PROVIDER` environment variable to select your provider:
47
+ ## Verify the install
396
48
 
397
49
  ```bash
398
- # Use Claude (default)
399
- export LOKI_PROVIDER=claude
400
-
401
- # Use OpenAI Codex
402
- export LOKI_PROVIDER=codex
403
-
404
- # Use Cline
405
- export LOKI_PROVIDER=cline
50
+ loki --version # prints the installed version
51
+ loki doctor # checks providers, Bun, skill links and prerequisites
406
52
  ```
407
53
 
408
- #### CLI Flag
409
-
410
- Use the `--provider` flag when invoking Loki Mode:
411
-
412
- ```bash
413
- # Use Claude (default)
414
- loki start ./my-spec.md --provider claude
415
-
416
- # Use OpenAI Codex
417
- loki start ./my-spec.md --provider codex
418
-
419
- # Use Cline
420
- loki start ./my-spec.md --provider cline
421
- ```
422
-
423
- #### Docker
424
-
425
- Docker is where sandboxes and runs happen. The easiest way to run Loki in a
426
- container is the `loki docker` host wrapper, which gives you the full local
427
- experience (including `.loki/` state, resume, and continuity) in one command.
428
- The raw `docker run` and `docker compose` methods below remain as alternatives.
429
-
430
- ##### loki docker (easiest)
431
-
432
- If you have loki installed on the host (npm/brew/bun) plus Docker, `loki docker`
433
- runs any loki command inside the published `asklokesh/loki-mode` image with zero
434
- config:
435
-
436
- ```bash
437
- loki docker start owner/repo#17 # work a GitHub issue or PR in Docker (primary path)
438
- loki docker start prd.md # full local experience in Docker
439
- loki docker status # any loki command works
440
- loki docker --dry-run start prd.md # print the docker command, do not run
441
- ```
442
-
443
- On macOS, pass your GitHub login for PRs with
444
- `GH_TOKEN=$(gh auth token) loki docker start owner/repo#17`.
445
-
446
- It bind-mounts the current folder to `/workspace`, so `.loki/` state (memory,
447
- session, queue, checkpoints) persists on the host and resume and continuity
448
- behave exactly like the local `loki` CLI. Auth is auto-detected:
449
- `ANTHROPIC_API_KEY` if set, else your host's existing Claude Code login
450
- (Max/Pro subscribers need no API key), else an honest error with guidance. It
451
- also forwards `~/.gitconfig` and `~/.config/gh` (read-only) plus
452
- `GITHUB_TOKEN`/`GH_TOKEN` if set, so commits and PRs work like local, and
453
- exposes the API on port 57374. Use `--image IMG` to override the image.
454
-
455
- `loki docker` is a thin host wrapper around the image; it requires loki and
456
- Docker installed on the host.
457
-
458
- Multi-repo + unified dashboard: you can run `loki docker start` in several
459
- different repos at once, exactly like the host CLI. Each repo gets its own
460
- container (deterministic name `loki-<hash-of-path>`) and its own bind-mounted
461
- `.loki/` state. Every `loki docker` project registers with the host dashboard,
462
- so running `loki dashboard` on the host (the Control Plane) shows ALL your projects in one unified
463
- view, whether they run via local `loki start` or via `loki docker start`. Builds
464
- run with the dashboard off by default (so concurrent runs do not collide on port
465
- 57374); use the host `loki dashboard`, or `loki docker start --api` for a single
466
- containerized run's UI.
467
-
468
- ##### docker run
469
-
470
- As of v7.45.0 the image ships the Claude Code CLI, so the default `claude`
471
- provider works inside the container. Provide auth with your Anthropic API key:
472
-
473
- ```bash
474
- # Run Loki Mode in Docker (Claude provider, API-key auth)
475
- docker run --rm -e ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" \
476
- -v $(pwd):/workspace -w /workspace \
477
- asklokesh/loki-mode:latest start ./my-spec.md
478
- ```
479
-
480
- ##### docker compose + .env (no host install)
481
-
482
- If you prefer not to install loki on the host, the repo ships a
483
- `docker-compose.yml` with `env_file: .env`. Copy the example,
484
- set your key once, then run without retyping long `-e` flags:
485
-
486
- ```bash
487
- cp .env.example .env # then edit .env and set ANTHROPIC_API_KEY
488
- docker compose run loki start prd.md
489
- ```
490
-
491
- `.env` is gitignored. Edit it and re-run any time; compose reloads it
492
- automatically.
493
-
494
- ##### Host OAuth (Claude Code Max/Pro subscribers, no API key)
495
-
496
- If you have a Claude Code subscription and no API key, you can reuse your host
497
- login by mounting your credentials file at
498
- `/home/loki/.claude/.credentials.json` instead of setting `ANTHROPIC_API_KEY`.
499
- See [DOCKER_README.md](../DOCKER_README.md) "Option 2: host OAuth" for the
500
- one-line export command and the compose volume to uncomment.
501
-
502
- ##### Other providers in Docker
503
-
504
- The image ships only the Claude Code CLI. Cline, Codex, Aider, and opencode are
505
- bring-your-own-CLI: install the provider CLI in a derived image (or mount it),
506
- then select it with `-e LOKI_PROVIDER=<name>`. See
507
- [DOCKER_README.md](../DOCKER_README.md) for details.
508
-
509
- ### Degraded Mode
510
-
511
- When using `codex`, `cline`, or `aider` providers, Loki Mode operates in **degraded mode**:
512
-
513
- - Core autonomous workflow functions normally
514
- - Some advanced features may be unavailable or behave differently
515
- - Model-specific optimizations (Opus/Sonnet/Haiku routing) are adapted for each provider
516
- - Quality gates and RARV cycle remain fully functional
517
-
518
- **Recommendation:** For the best experience and full feature support, use the default `claude` provider.
519
-
520
- ---
521
-
522
- ## Environment Variables
523
-
524
- Loki Mode is designed to run with zero configuration: the trust-layer and
525
- quality features below are default-on and decide intelligently by inspecting
526
- the work. The environment variables here are opt-out escape hatches for power
527
- users, not required setup. Set the documented value to disable a feature; leave
528
- the variable unset to keep the intelligent default.
529
-
530
- ### Trust-gate and completion knobs (default-on)
531
-
532
- These are read by the orchestrator (`autonomy/run.sh`) on every run.
533
-
534
- - `LOKI_REVIEW_INCONCLUSIVE_BLOCK` (default `1`) -- when a code-review cycle
535
- returns zero usable verdicts (every reviewer produced empty output), the
536
- review is treated as INCONCLUSIVE and the gate BLOCKS, because an all-empty
537
- review proves nothing. A bounded one-shot retry runs first
538
- (`LOKI_REVIEW_RETRY`, default `1`). Set `LOKI_REVIEW_INCONCLUSIVE_BLOCK=0` to
539
- record the inconclusive result without blocking.
540
-
541
- - `LOKI_COMPLETION_TEST_CAPTURE` (default `1`) -- before the verified-completion
542
- evidence gate runs, Loki captures a fresh `test-results.json` so the gate
543
- scores on real PASS/FAIL test results instead of a stale or missing file. It
544
- reuses this iteration's results if already fresh, and never crashes the
545
- completion path on red tests (the gate is the decider). Set
546
- `LOKI_COMPLETION_TEST_CAPTURE=0` to opt out.
547
-
548
- - `LOKI_AUTO_DOCS` (default `true`) -- auto-generates the `.loki/docs/` suite
549
- before the documentation gate evaluates, so the gate scores on real generated
550
- docs instead of nagging you to run `loki docs generate` by hand. Bounded:
551
- runs at most once per run when docs are missing, and again only when existing
552
- docs are substantially stale; best-effort, never fails the iteration loop.
553
- Set `LOKI_AUTO_DOCS=false` to opt out.
554
-
555
- ### Output-token compressor (caveman, Claude-only)
556
-
557
- Loki integrates [caveman](https://github.com/JuliusBrussee/caveman), an optional
558
- Claude Code skill that compresses the model's OUTPUT tokens only (keeping all
559
- technical substance). It activates on free-form generation (the main RARV dev
560
- loop) and is HARD-SUPPRESSED on every trust-gate subcall (council votes, code
561
- review verdicts, evidence-related parses) so determinism is never affected. It
562
- is Claude-provider-only; runs are byte-identical on Cline / Codex / Aider / opencode. These
563
- variables are read in `autonomy/lib/claude-flags.sh`.
564
-
565
- - `LOKI_CAVEMAN` (default on) -- set `LOKI_CAVEMAN=0` to disable the compressor.
566
- Suppression on trust-gate subcalls is unconditional and applies even when
567
- caveman is globally installed but `LOKI_CAVEMAN=0`, so trust gates are never
568
- exposed to compression.
569
-
570
- - `LOKI_CAVEMAN_LEVEL` (default `full`) -- the compression level for free-form
571
- activation. When you do NOT set this, the level is inferred per-invocation
572
- from the run's RARV tier (planning -> `lite`, development/fast -> `full`); the
573
- auto path never selects `ultra`. Setting `LOKI_CAVEMAN_LEVEL` explicitly
574
- overrides the inference entirely (the opt-out escape hatch).
575
-
576
- - `LOKI_CAVEMAN_VERSION` (default `1.9.0`) -- the pinned caveman version used by
577
- the one-time bootstrap. Bump only to upgrade the compressor.
578
-
579
- ### RARV-C closure knobs (default-on)
580
-
581
- The Phase 1 / RARV-C closure loop (findings injection, override council,
582
- learnings writer, handoff doc) is default-on and documented in detail at the
583
- top of this guide under [Phase 1 RARV-C closure](#phase-1-rarv-c-closure-shipped-v750-default-on-as-of-v753):
584
- `LOKI_INJECT_FINDINGS`, `LOKI_OVERRIDE_COUNCIL`, `LOKI_AUTO_LEARNINGS`, and
585
- `LOKI_HANDOFF_MD` (each opt out with `=0`). For the full schema and
586
- reachability notes, see `skills/quality-gates.md`.
54
+ You need at least one provider CLI. Claude Code (`claude`) is the default and the only one with every feature.
587
55
 
588
56
  ---
589
57
 
590
- ## Claude Code (CLI)
591
-
592
- Loki Mode can be installed as a skill in three ways:
58
+ ## First run
593
59
 
594
- ### Option A: Git Clone (Recommended)
595
-
596
- **Personal installation (available in all projects):**
597
60
  ```bash
598
- git clone https://github.com/asklokesh/loki-mode.git ~/.claude/skills/loki-mode
61
+ loki welcome # what Loki is and what to do next
62
+ loki quickstart # guided first build: setup check, idea, template, plan, go
63
+ loki owner/repo#42 # work a GitHub issue end to end and open a PR
64
+ loki "add a /health route" # run one task in the current repo
599
65
  ```
600
66
 
601
- **Project-specific installation:**
602
- ```bash
603
- # Navigate to your project directory first
604
- cd /path/to/your/project
605
-
606
- # Clone to local skills directory
607
- git clone https://github.com/asklokesh/loki-mode.git .claude/skills/loki-mode
608
- ```
67
+ `loki quickstart` asks four questions and shows the plan before anything runs. Press Enter at every step to build the sample Todo app. Add `--dry-run --json` to preview the plan without writing files.
609
68
 
610
- ### Option B: Download from Releases
69
+ Every finished run leaves a receipt. Check a branch the same way CI does:
611
70
 
612
71
  ```bash
613
- # Navigate to skills directory
614
- cd ~/.claude/skills
615
-
616
- # Get latest version number
617
- VERSION=$(curl -s https://api.github.com/repos/asklokesh/loki-mode/releases/latest | grep tag_name | cut -d'"' -f4 | tr -d 'v')
618
-
619
- # Download and extract
620
- curl -L -o loki-mode.zip "https://github.com/asklokesh/loki-mode/releases/download/v${VERSION}/loki-mode-claude-code-${VERSION}.zip"
621
- unzip loki-mode.zip && rm loki-mode.zip
72
+ loki verify # deterministic verification of HEAD against the base branch
622
73
  ```
623
74
 
624
- **Result:** Creates `~/.claude/skills/loki-mode/SKILL.md`
625
-
626
- ### Option C: Minimal Install (curl)
627
-
628
- If you only want the essential files without the full repository:
629
-
630
- ```bash
631
- # Create directory structure
632
- mkdir -p ~/.claude/skills/loki-mode/references
633
-
634
- # Download core skill file
635
- curl -o ~/.claude/skills/loki-mode/SKILL.md \
636
- https://raw.githubusercontent.com/asklokesh/loki-mode/main/SKILL.md
637
-
638
- # Download agent definitions
639
- curl -o ~/.claude/skills/loki-mode/references/agent-types.md \
640
- https://raw.githubusercontent.com/asklokesh/loki-mode/main/references/agent-types.md
641
-
642
- # Download deployment guides
643
- curl -o ~/.claude/skills/loki-mode/references/deployment.md \
644
- https://raw.githubusercontent.com/asklokesh/loki-mode/main/references/deployment.md
645
-
646
- # Download business operations reference
647
- curl -o ~/.claude/skills/loki-mode/references/business-ops.md \
648
- https://raw.githubusercontent.com/asklokesh/loki-mode/main/references/business-ops.md
649
- ```
650
-
651
- **Note:** This minimal install won't include examples, tests, or the autonomous runner. Use Option A or B for full functionality.
652
-
653
- ---
654
-
655
- ## Claude.ai (Web)
656
-
657
- For using Loki Mode on the Claude.ai web interface:
658
-
659
- ### Step 1: Download the Skill Package
660
-
661
- 1. Go to [Releases](https://github.com/asklokesh/loki-mode/releases)
662
- 2. Download **either**:
663
- - `loki-mode-X.X.X.zip` (standard format)
664
- - `loki-mode-X.X.X.skill` (skill format)
665
-
666
- Both contain the same skill and will work.
667
-
668
- ### Step 2: Upload to Claude.ai
669
-
670
- 1. Open [Claude.ai](https://claude.ai)
671
- 2. Go to **Settings** (gear icon)
672
- 3. Navigate to **Features → Skills**
673
- 4. Click **Upload Skill**
674
- 5. Select the downloaded `.zip` or `.skill` file
675
-
676
- **File Structure:** The Claude.ai package has `SKILL.md` at the root level as required by the web interface.
75
+ Exit codes are listed in [exit-codes.md](exit-codes.md). Receipt signing and third-party checking are covered in [SIGNED-RECEIPTS.md](SIGNED-RECEIPTS.md).
677
76
 
678
77
  ---
679
78
 
680
- ## Anthropic API Console
681
-
682
- For using Loki Mode through the Anthropic API Console (console.anthropic.com):
683
-
684
- ### Step 1: Download the API Package
685
-
686
- 1. Go to [Releases](https://github.com/asklokesh/loki-mode/releases)
687
- 2. Download **`loki-mode-api-X.X.X.zip`** (note the `-api-` version)
688
-
689
- **Important:** The API version has a different file structure than the web version.
690
-
691
- ### Step 2: Upload to API Console
692
-
693
- 1. Go to [console.anthropic.com](https://console.anthropic.com)
694
- 2. Navigate to **Skills** section
695
- 3. Click **Upload Skill**
696
- 4. Select the downloaded `loki-mode-api-X.X.X.zip` file
697
-
698
- **File Structure:** The API package has `SKILL.md` inside a `loki-mode/` folder as required by the API.
699
-
700
- ---
79
+ ## Control Plane
701
80
 
702
- ## Verify Installation
703
-
704
- ### For Claude Code (CLI)
705
-
706
- Check that the skill file is in place:
81
+ The Control Plane is the local UI for runs, work and cost. It needs Bun.
707
82
 
708
83
  ```bash
709
- cat ~/.claude/skills/loki-mode/SKILL.md | head -10
710
- ```
711
-
712
- **Expected output:** Should show YAML frontmatter starting with:
713
- ```yaml
714
- ---
715
- name: loki-mode
716
- description: Autonomous Spec-to-Product System (RARV-C closure loop)
717
- ...
718
- ---
84
+ loki control serve # 127.0.0.1:47821 by default
85
+ loki dashboard # reuse a running Control Plane, or start one, and open it
719
86
  ```
720
87
 
721
- ### For Claude.ai (Web)
722
-
723
- 1. Start a new conversation
724
- 2. Type: `Loki Mode`
725
- 3. Claude should recognize the skill and ask for a spec (PRD, GitHub issue link, or YAML)
726
-
727
- ### For API Console
728
-
729
- 1. Create a new API call with skills enabled
730
- 2. Include the skill in your request
731
- 3. The skill should be available for use
88
+ See [control-plane-migration.md](control-plane-migration.md) and [control-plane-container.md](control-plane-container.md).
732
89
 
733
90
  ---
734
91
 
735
- ## File Structure
92
+ ## Providers
736
93
 
737
- After installation, you should have this structure:
738
-
739
- ```
740
- loki-mode/
741
- ├── SKILL.md # Main skill file (required)
742
- ├── README.md # Documentation
743
- ├── docs/
744
- │ └── INSTALLATION.md # This file
745
- ├── CHANGELOG.md # Version history
746
- ├── VERSION # Current version number
747
- ├── LICENSE # Business Source License 1.1
748
- ├── references/ # Agent and deployment references
749
- │ ├── agents.md
750
- │ ├── deployment.md
751
- │ └── business-ops.md
752
- ├── autonomy/ # Autonomous runner (CLI only)
753
- │ ├── run.sh
754
- │ └── README.md
755
- ├── templates/ # 22 spec templates (PRD-style) for project scaffolding
756
- │ ├── simple-todo-app.md
757
- │ ├── api-only.md
758
- │ ├── static-landing-page.md
759
- │ └── ... (22 templates total)
760
- ├── tests/ # Test suite (CLI only)
761
- │ ├── run-all-tests.sh
762
- │ ├── test-bootstrap.sh
763
- │ └── ...
764
- └── integrations/ # Third-party integrations
765
- └── vibe-kanban.md
766
- ```
94
+ | Provider | Notes |
95
+ |----------|-------|
96
+ | `claude` | Default. Full feature set. |
97
+ | `cline` | Full feature set; small local models may fail tool use. |
98
+ | `codex` | Sequential only. |
99
+ | `aider` | Sequential only; `ollama_chat/<model>` works for local models. |
100
+ | `opencode` | Sequential only. Install with `npm install -g opencode-ai`. |
767
101
 
768
- **Note:** Some files/directories (autonomy, tests, templates) are only available with full installation (Options A or B).
102
+ When `LOKI_PROVIDER` is unset, Loki uses the first installed CLI in this order: `claude`, `cline`, `codex`, `aider`, `opencode`. An explicit `LOKI_PROVIDER` or `--provider NAME` always wins.
769
103
 
770
104
  ---
771
105
 
772
- ## Ports
773
-
774
- Loki Mode uses two network ports for different services:
775
-
776
- | Port | Service | Description |
777
- |------|---------|-------------|
778
- | **47821** | Control Plane UI + API | The only UI, plus the `/v1/*` API. Started by `loki control serve` or `loki dashboard`. See [control-plane-migration.md](control-plane-migration.md). |
779
- | **57374** | Legacy API (FastAPI) | The classic dashboard UI is removed in 10.8; this port no longer serves a UI. |
780
-
781
- ### When to Use Which Port
782
-
783
- - **Browser access** (UI, monitoring): Use the Control Plane, port **47821** -- `http://127.0.0.1:47821`
784
- - **API calls** (REST, programmatic): Use port **57374** -- `http://localhost:57374`
785
- - **VS Code extension** (deprecated as of v7.2.0): Connects to API on port **57374** automatically (configurable via `loki.apiPort` setting). No new releases will be published; see the deprecation notice above.
786
- - The server is started automatically when you run `loki start` or `./autonomy/run.sh`. No manual configuration is needed.
787
-
788
- ### Port Configuration
106
+ ## Configuration
789
107
 
790
- ```bash
791
- # Control Plane port (default: 47821)
792
- loki control serve --port 47821
793
-
794
- # API port (default: 57374)
795
- loki api start --port 57374 # was: loki serve
796
- ```
797
-
798
- ### CORS Configuration
799
-
800
- The Control Plane has no CORS setting and requires a loopback Host header unless it is bound to a non-loopback address with `LOKI_CONTROL_TOKEN` set (see [control-plane-migration.md](control-plane-migration.md)). The `LOKI_DASHBOARD_CORS` variable below applies only to the legacy API server:
108
+ Loki runs with zero configuration. To set options in one place, use a config file:
801
109
 
802
110
  ```bash
803
- # Allow specific origins
804
- LOKI_DASHBOARD_CORS="http://localhost:3000,https://my-dashboard.example.com" loki dashboard start
805
-
806
- # Default: http://localhost:57374,http://127.0.0.1:57374 (localhost-only, secure by default)
111
+ loki config example > loki.yaml # annotated starter
112
+ loki config validate loki.yaml # rejects raw secrets and bad keys
113
+ loki start --config loki.yaml ./prd.md
807
114
  ```
808
115
 
809
- ---
810
-
811
- ## Shell Completions
812
-
813
- Enable tab completion for the `loki` CLI to support subcommands, flags, and file arguments.
814
-
815
- ---
816
-
817
- ## Bash Setup
818
-
819
- ### Option 1: Permanent Setup (Recommended)
820
-
821
- Add the source command to your startup file so completions load every time you open a terminal.
822
-
823
- Add this line to your `~/.bashrc` (Linux) or `~/.bash_profile` (macOS):
824
-
825
- ```bash
826
- # npm install: use the npm package path
827
- source "$(npm root -g)/loki-mode/completions/loki.bash"
828
-
829
- # git clone: use the skills directory
830
- source ~/.claude/skills/loki-mode/completions/loki.bash
831
- ```
116
+ A CLI flag beats an environment variable, which beats the config file, which beats the defaults. Reference secrets as `${VAR}`; never write them inline. Every variable is listed in [environment-variables.md](environment-variables.md).
832
117
 
833
118
  ---
834
119
 
835
- ### Option 2: Manual Sourcing (Temporary)
836
-
837
- If you only want to enable completions for your current terminal session (for example, for testing), run:
120
+ ## Privacy
838
121
 
839
- ```bash
840
- source completions/loki.bash
841
- ```
122
+ Anonymous diagnostics are on for an ordinary interactive install and off automatically in CI, non-interactive sessions, and when `LOKI_ENTERPRISE=true` or `LOKI_AIRGAP=true` is set. They never include code, prompts, file paths or keys. Turn them off with `loki telemetry off` or `DO_NOT_TRACK=1`. Details: [PRIVACY.md](PRIVACY.md).
842
123
 
843
124
  ---
844
125
 
845
- ### Optional: Smoother Bash Experience
126
+ ## Shell completions
846
127
 
847
- By default, Bash requires two **TAB** presses to show the completion menu. To make it instant (similar to Zsh) and cycle through options more easily, add the following lines to your `~/.inputrc` file:
128
+ The npm install sets them up for you. To install them by hand:
848
129
 
849
130
  ```bash
850
- # Show menu immediately on first TAB
851
- set show-all-if-ambiguous on
852
-
853
- # Case-insensitive completion (optional)
854
- set completion-ignore-case on
131
+ loki completions install # detects bash or zsh
132
+ loki completions bash > ~/.loki-completion.bash # or print the script
855
133
  ```
856
134
 
857
- > **Note:** You will need to restart your terminal for `~/.inputrc` changes to take effect.
858
-
859
135
  ---
860
136
 
861
- ## Zsh Setup
862
-
863
- Zsh completions require the script to be located in a directory listed in your `$fpath`.
864
-
865
- ### Permanent Setup
137
+ ## Update and uninstall
866
138
 
867
- Add the `loki` completions directory to your `$fpath` in `~/.zshrc` **before** initializing completions:
139
+ | Method | Update | Uninstall |
140
+ |--------|--------|-----------|
141
+ | npm | `npm update -g loki-mode` | `npm uninstall -g loki-mode` |
142
+ | Bun | `bun update -g loki-mode` | `bun remove -g loki-mode` |
143
+ | Homebrew | `brew upgrade loki-mode` | `brew uninstall loki-mode` |
868
144
 
869
- ```bash
870
- # 1. Add the completions directory to fpath
871
- fpath=(/path/to/loki/completions $fpath)
872
-
873
- # 2. Initialize completions
874
- autoload -Uz compinit && compinit
875
- ```
876
-
877
- ---
878
-
879
- ## Testing Completions
880
-
881
- After installation, restart your shell or source your configuration file, then verify:
882
-
883
- ### Bash
884
-
885
- ```bash
886
- loki <TAB> # Should immediately list subcommands
887
- loki start -<TAB> # Should list flags (--provider, --parallel, etc.)
888
- ```
889
-
890
- ### Zsh
891
-
892
- ```bash
893
- loki <TAB> # Should show subcommands with descriptions
894
- loki start --pro<TAB> # Should autocomplete to --provider
895
- ```
896
-
897
- ---
898
-
899
- ## Completion Features
900
-
901
- The completion scripts support:
902
-
903
- * **Subcommands**
904
- `start`, `stop`, `pause`, `resume`, `status`, `dashboard`, `import`, `council`, `memory`, `provider`, `config`, `audit`, `metrics`, `watchdog`, `secrets`, `help`, `completions`
905
-
906
- * **Smart Context**
907
-
908
- * `loki start --provider <TAB>` completes the supported providers (`claude`, `cline`, `codex`, `aider`, `opencode`; see `completions/loki.bash:24`).
909
- * `loki start <TAB>` defaults to file completion for spec files (PRD templates, YAML).
910
-
911
- * **Nested Commands**
912
- Handles specific subcommands for `council`, `memory`, `config`, `audit`, `metrics`, `watchdog`, and `secrets`.
145
+ Run state lives in `.loki/` inside each project and in `~/.loki/`. Remove those directories to delete it.
913
146
 
914
147
  ---
915
148
 
916
149
  ## Troubleshooting
917
150
 
918
- ### Skill Not Found
919
-
920
- **Problem:** Claude doesn't recognize "Loki Mode" command.
921
-
922
- **Solutions:**
923
- 1. **Check installation path:**
924
- ```bash
925
- ls -la ~/.claude/skills/loki-mode/SKILL.md
926
- ```
927
-
928
- 2. **Verify YAML frontmatter:**
929
- ```bash
930
- cat ~/.claude/skills/loki-mode/SKILL.md | head -5
931
- ```
932
- Should show `name: loki-mode`
933
-
934
- 3. **Restart Claude Code:**
935
- ```bash
936
- # Exit and restart claude command
937
- ```
938
-
939
- ### Permission Denied
940
-
941
- **Problem:** Cannot create directories or download files.
942
-
943
- **Solution:**
944
- ```bash
945
- # Ensure skills directory exists
946
- mkdir -p ~/.claude/skills
947
-
948
- # Check permissions
949
- ls -la ~/.claude/
950
- ```
951
-
952
- ### Download Fails
953
-
954
- **Problem:** curl or wget commands fail.
955
-
956
- **Solutions:**
957
- 1. **Check internet connection**
958
-
959
- 2. **Try alternate download method:**
960
- ```bash
961
- # Use wget instead of curl
962
- wget -O ~/.claude/skills/loki-mode/SKILL.md \
963
- https://raw.githubusercontent.com/asklokesh/loki-mode/main/SKILL.md
964
- ```
965
-
966
- 3. **Manual download:**
967
- - Visit the URL in a browser
968
- - Save file manually to `~/.claude/skills/loki-mode/`
969
-
970
- ### Autonomous Runner Won't Start
971
-
972
- **Problem:** `./autonomy/run.sh` gives "command not found" or permission errors.
973
-
974
- **Solutions:**
975
- 1. **Make executable:**
976
- ```bash
977
- chmod +x autonomy/run.sh
978
- ```
979
-
980
- 2. **Run from repository root:**
981
- ```bash
982
- # Make sure you're in the loki-mode directory
983
- cd ~/.claude/skills/loki-mode
984
- ./autonomy/run.sh
985
- ```
986
-
987
- 3. **Check prerequisites:**
988
- ```bash
989
- # Ensure Claude Code is installed
990
- claude --version
991
-
992
- # Ensure Python 3 is available
993
- python3 --version
994
- ```
995
-
996
- ### References Not Loading
997
-
998
- **Problem:** Skill loads but agent definitions or deployment guides are missing.
999
-
1000
- **Solution:**
1001
- ```bash
1002
- # Ensure all reference files are present
1003
- ls -la ~/.claude/skills/loki-mode/references/
1004
-
1005
- # Should show:
1006
- # agents.md
1007
- # deployment.md
1008
- # business-ops.md
1009
-
1010
- # If missing, download them:
1011
- curl -o ~/.claude/skills/loki-mode/references/agent-types.md \
1012
- https://raw.githubusercontent.com/asklokesh/loki-mode/main/references/agent-types.md
1013
- ```
1014
-
1015
- ---
1016
-
1017
- ## Updating Loki Mode
1018
-
1019
- ### For Git Installations
1020
-
1021
- ```bash
1022
- cd ~/.claude/skills/loki-mode
1023
- git pull origin main
1024
- ```
1025
-
1026
- ### For Manual Installations
1027
-
1028
- 1. Download the latest release
1029
- 2. Extract to the same directory (overwrite existing files)
1030
- 3. Or delete old installation and reinstall
1031
-
1032
- ### Check Current Version
1033
-
1034
- ```bash
1035
- cat ~/.claude/skills/loki-mode/VERSION
1036
- ```
1037
-
1038
- ---
1039
-
1040
- ## Uninstalling
1041
-
1042
- ### Claude Code (CLI)
1043
-
1044
- ```bash
1045
- # Remove the skill directory
1046
- rm -rf ~/.claude/skills/loki-mode
1047
- ```
1048
-
1049
- ### Claude.ai (Web)
1050
-
1051
- 1. Go to **Settings → Features → Skills**
1052
- 2. Find "loki-mode" in the list
1053
- 3. Click **Remove**
1054
-
1055
- ### API Console
1056
-
1057
- 1. Go to **Skills** section
1058
- 2. Find "loki-mode"
1059
- 3. Click **Delete**
1060
-
1061
- ---
1062
-
1063
- ## Next Steps
1064
-
1065
- After installation:
1066
-
1067
- 1. **Verify Setup:** Check your environment is ready
1068
- ```bash
1069
- loki doctor
1070
- ```
1071
-
1072
- 2. **Scaffold a Project:** Create a project from a template
1073
- ```bash
1074
- loki init my-app --template simple-todo-app
1075
- cd my-app
1076
- ```
1077
-
1078
- 3. **Start Building:** Launch autonomous development from any spec (PRD, GitHub issue, or YAML)
1079
- ```bash
1080
- loki start spec.md
1081
- ```
1082
-
1083
- 4. **Read Documentation:** Check out [README.md](../README.md) for usage guides
1084
-
1085
- 5. **Join the Community:** Report issues or contribute at [GitHub](https://github.com/asklokesh/loki-mode)
1086
-
1087
- ---
1088
-
1089
- ## Release Operations
1090
-
1091
- <details>
1092
- <summary>Token Rotation Runbook (maintainers only)</summary>
1093
-
1094
- Follow this runbook when a release workflow fails to publish to npm.
1095
-
1096
- **Symptom:** The `publish-npm` step in `.github/workflows/release.yml` fails with:
1097
- ```
1098
- npm error 404 Not Found - PUT https://registry.npmjs.org/loki-mode
1099
- ```
1100
-
1101
- A 404 on PUT means the registry rejected the credential, not that the package is missing.
1102
-
1103
- **Likely causes:**
1104
- - The `NPM_TOKEN` Automation token has expired.
1105
- - The token was revoked or its owner lost publish rights on the `loki-mode` package.
1106
- - The npm account requires a 2FA refresh and the existing Automation token is no longer accepted.
1107
-
1108
- **Remediation steps:**
1109
- 1. Log in to npmjs.com as the publish account and regenerate an Automation token with publish access scoped to `loki-mode`.
1110
- 2. Open https://github.com/asklokesh/loki-mode/settings/secrets/actions
1111
- 3. Update the `NPM_TOKEN` repository secret with the new token value.
1112
- 4. Re-run the failed Release workflow: `gh run rerun <run-id>`. If re-run is not available for that run, push a no-op commit to `main` to retrigger.
1113
-
1114
- **Verification:**
1115
- - Watch the new run: `gh run watch <new-run-id>` and confirm `publish-npm` and `publish-ts-sdk` succeed.
1116
- - Confirm publish: `npm view loki-mode version` returns the new version.
1117
-
1118
- **Note on `publish-ts-sdk`:** This job publishes `sdk/typescript` to npm and uses the same `secrets.NPM_TOKEN` as `publish-npm` (see `.github/workflows/release.yml`). Rotating `NPM_TOKEN` fixes both jobs. The new Automation token must have publish access to both the `loki-mode` package and the TypeScript SDK package.
1119
-
1120
- </details>
1121
-
1122
- ---
1123
-
1124
- ## Need Help?
1125
-
1126
- - **Issues/Bugs:** [GitHub Issues](https://github.com/asklokesh/loki-mode/issues)
1127
- - **Discussions:** [GitHub Discussions](https://github.com/asklokesh/loki-mode/discussions)
1128
- - **Documentation:** [README.md](../README.md)
1129
-
1130
- ---
1131
-
1132
- **Happy Building!**
151
+ - `loki: command not found`: the global bin directory of your package manager is not on `PATH` (`npm prefix -g` shows where npm installs).
152
+ - `the Loki 10 engine cannot run on this machine: no working bun`: install Bun, or reinstall without `--omit=optional`.
153
+ - A provider is missing: `loki doctor` names it and prints the install command.
154
+ - Anything else: `loki doctor --json`, then [KNOWN-ISSUES.md](KNOWN-ISSUES.md), then `loki crash` to file a report.