loki-mode 11.3.0 → 11.3.2

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 (242) hide show
  1. package/README.md +68 -650
  2. package/SKILL.md +5 -5
  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/efficiency_cost.py +8 -0
  10. package/autonomy/lib/engine10-push.sh +22 -8
  11. package/autonomy/lib/prd-enrich.sh +1 -1
  12. package/autonomy/lib/voter-agents.sh +1 -1
  13. package/autonomy/loki +161 -105
  14. package/autonomy/run.sh +30 -18
  15. package/autonomy/sandbox.sh +1 -1
  16. package/autonomy/tui.sh +6 -5
  17. package/autonomy/verify.sh +1 -1
  18. package/bin/loki +195 -59
  19. package/completions/_loki +8 -0
  20. package/completions/loki.bash +3 -3
  21. package/dashboard/__init__.py +1 -1
  22. package/dashboard/server.py +47 -45
  23. package/docs/AGENT-CHANGE-RECEIPT.md +2 -2
  24. package/docs/ARCHITECTURE.md +337 -0
  25. package/docs/BRANDING.md +124 -0
  26. package/docs/CLI-REFERENCE.md +11 -1
  27. package/docs/COMPONENTS.md +447 -0
  28. package/docs/DEPLOYMENT.md +9 -9
  29. package/docs/DOCKER.md +469 -0
  30. package/docs/INSTALLATION.md +67 -1045
  31. package/docs/KNOWN-ISSUES.md +11 -35
  32. package/docs/OTEL-COLLECTOR.md +24 -0
  33. package/docs/ROUTING-EVIDENCE.md +32 -0
  34. package/docs/TESTING.md +161 -0
  35. package/docs/air-gapped.md +1 -2
  36. package/docs/alternative-installations.md +14 -24
  37. package/docs/architecture/DECISIONS.md +333 -0
  38. package/docs/audit-logging.md +7 -7
  39. package/docs/authentication.md +3 -3
  40. package/docs/authorization.md +1 -1
  41. package/docs/certification/04-production-deployment/lab.md +6 -6
  42. package/docs/certification/04-production-deployment/lesson.md +4 -4
  43. package/docs/certification/README.md +1 -1
  44. package/docs/control-plane-container.md +2 -2
  45. package/docs/dev/real-run.md +34 -0
  46. package/docs/dev/release-checklist.md +2 -2
  47. package/docs/environment-variables.md +1 -0
  48. package/docs/exit-codes.md +3 -3
  49. package/docs/git-workflow.md +3 -3
  50. package/docs/metrics.md +37 -55
  51. package/docs/network-security.md +1 -1
  52. package/docs/siem-integration.md +5 -5
  53. package/docs/spec-first-intent.md +28 -0
  54. package/docs/v10/CLI-MODERN.md +7 -3
  55. package/docs/v10/DECISIONS.md +59 -0
  56. package/docs/v10/DEPS.md +22 -22
  57. package/docs/v10/ENGINE.md +1 -1
  58. package/docs/v10/FAILURE-CLASSES.md +212 -1
  59. package/docs/v10/FOUNDER-QUEUE.md +1 -0
  60. package/docs/v10/GUARDS.md +31 -0
  61. package/docs/v10/GUIDE.md +7 -5
  62. package/docs/v10/LEGACY-REMOVAL.md +4 -6
  63. package/docs/v10/METRICS.md +14 -2
  64. package/docs/v10/MODERNIZE.md +1 -1
  65. package/docs/v10/OPERATING-MODEL.md +4 -3
  66. package/docs/v10/PROGRESS.md +35 -0
  67. package/docs/v11/COST-HALF.md +352 -0
  68. package/docs/v11/INTOTO-AGENT-CHANGE-PREDICATE.md +77 -0
  69. package/docs/v11/MARKET-SLICES.md +315 -0
  70. package/docs/v11/MCP-2026-07-28.md +55 -0
  71. package/docs/v11/REGISTRIES.md +730 -0
  72. package/docs/v11/VERIFY-PR-SANDBOX.md +41 -0
  73. package/loki-ts/data/model-pricing.json +52 -24
  74. package/loki-ts/dist/loki.js +1185 -945
  75. package/mcp/__init__.py +1 -1
  76. package/mcp/v10_tools.py +29 -0
  77. package/package.json +9 -11
  78. package/packages/control-plane/dist/ask-tools-server.js +8 -2
  79. package/packages/control-plane/dist/server.js +15832 -12361
  80. package/packages/control-plane/drizzle/0006_token_sessions.sql +1 -0
  81. package/packages/control-plane/drizzle/meta/0006_snapshot.json +807 -0
  82. package/packages/control-plane/drizzle/meta/_journal.json +7 -0
  83. package/packages/control-plane/src/db/schema.ts +1 -0
  84. package/packages/control-plane/src/server/routes/cost.ts +4 -3
  85. package/packages/control-plane/src/server/runs.ts +3 -3
  86. package/packages/control-plane/ui/dist/assets/index-DbLzr87u.js +190 -0
  87. package/packages/control-plane/ui/dist/index.html +1 -1
  88. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  89. package/providers/opencode.sh +2 -3
  90. package/src/observability/genai-spans.js +104 -0
  91. package/src/observability/otel-bridge.js +49 -1
  92. package/src/observability/otel.js +2 -2
  93. package/src/protocols/mcp-client.js +6 -2
  94. package/src/protocols/mcp-server.js +191 -6
  95. package/src/protocols/transport/sse.js +23 -2
  96. package/tools/audit-docs.py +1 -1
  97. package/web-app/dist/assets/{AdminPage-D_e45uTw.js → AdminPage-DuRQZsF9.js} +1 -1
  98. package/web-app/dist/assets/{Avatar-T3nIpoaf.js → Avatar-7GtOQvsO.js} +1 -1
  99. package/web-app/dist/assets/{Badge-BKqb59pP.js → Badge-CYgTnIxj.js} +1 -1
  100. package/web-app/dist/assets/{Button-DjVlkh8_.js → Button-rYSyIu7X.js} +1 -1
  101. package/web-app/dist/assets/{CockpitPage-DXJgLGmh.js → CockpitPage-9adANY4o.js} +1 -1
  102. package/web-app/dist/assets/{ComparePage-BRP_eVc_.js → ComparePage-DEG2oA-R.js} +1 -1
  103. package/web-app/dist/assets/{ErrorBoundary-CLjpGLjC.js → ErrorBoundary-CwtvY4xs.js} +1 -1
  104. package/web-app/dist/assets/{EvidenceReceiptPanel-DX-vb4Xy.js → EvidenceReceiptPanel-DTT73pPB.js} +1 -1
  105. package/web-app/dist/assets/{GitHubIssuesPanel-214HVHtX.js → GitHubIssuesPanel-CpWZLz2x.js} +1 -1
  106. package/web-app/dist/assets/{GitHubPRsPanel-BEiZKc4t.js → GitHubPRsPanel-H293R7E2.js} +1 -1
  107. package/web-app/dist/assets/{HomePage-VvMHS5ga.js → HomePage-B11Imp9k.js} +2 -2
  108. package/web-app/dist/assets/{LoginPage-5WD-v7n3.js → LoginPage-BZBgx5Jr.js} +1 -1
  109. package/web-app/dist/assets/{MagicPage-DUQT_Jye.js → MagicPage-B27S4_X8.js} +1 -1
  110. package/web-app/dist/assets/{MetricsPage-lga-z79v.js → MetricsPage-CfbJWNDG.js} +1 -1
  111. package/web-app/dist/assets/{NotFoundPage-CGhBX3G1.js → NotFoundPage-Tp_4zMSm.js} +1 -1
  112. package/web-app/dist/assets/{ProjectPage-CdzF2GzZ.js → ProjectPage-CM4fgMsV.js} +3 -3
  113. package/web-app/dist/assets/{ProjectsPage-DRG64N8s.js → ProjectsPage-DP2Fvsrd.js} +1 -1
  114. package/web-app/dist/assets/{SettingsPage-5fzW9Frb.js → SettingsPage-C4G9-EAy.js} +1 -1
  115. package/web-app/dist/assets/{ShowcasePage-DrTdxO4y.js → ShowcasePage-Dj-n4dwu.js} +1 -1
  116. package/web-app/dist/assets/{SystemSettingsPage-C9Mqs6Rd.js → SystemSettingsPage-BqMLpuGt.js} +1 -1
  117. package/web-app/dist/assets/{TeamsPage-CUGPdSWo.js → TeamsPage-mIH8H96m.js} +1 -1
  118. package/web-app/dist/assets/{TemplatesPage-CNraDY0F.js → TemplatesPage-BagW-v4n.js} +1 -1
  119. package/web-app/dist/assets/{TerminalOutput-BIu_6Pea.js → TerminalOutput-CTQRHhnK.js} +1 -1
  120. package/web-app/dist/assets/{activity-Bk-kgqaf.js → activity-DNQiBDDL.js} +1 -1
  121. package/web-app/dist/assets/{bell-BXmUdmo8.js → bell-Coiwdad1.js} +1 -1
  122. package/web-app/dist/assets/{bot-CiuzXxUR.js → bot-Cou-rTgR.js} +1 -1
  123. package/web-app/dist/assets/{check-BEzjXppd.js → check-CsF-XtQp.js} +1 -1
  124. package/web-app/dist/assets/{chevron-left-AYWCXHf8.js → chevron-left-BJiy55Ht.js} +1 -1
  125. package/web-app/dist/assets/{circle-alert-BNg2uSRq.js → circle-alert-D6-pQQWq.js} +1 -1
  126. package/web-app/dist/assets/{clock-DTj0kkGT.js → clock-BOGqwgt9.js} +1 -1
  127. package/web-app/dist/assets/{cloud-x4nTDBLT.js → cloud-DsxhTtf5.js} +1 -1
  128. package/web-app/dist/assets/{code-xml-BVh_MLrk.js → code-xml-CxJDHUlE.js} +1 -1
  129. package/web-app/dist/assets/{database-DdfBaowG.js → database-BJePscl_.js} +1 -1
  130. package/web-app/dist/assets/{dollar-sign-XuYFmAOY.js → dollar-sign-6qWGAkZo.js} +1 -1
  131. package/web-app/dist/assets/{file-code-corner-D4cRnmeL.js → file-code-corner-DcOtYeDb.js} +1 -1
  132. package/web-app/dist/assets/{file-plus-CyoVlHc_.js → file-plus-WuRyLFo0.js} +1 -1
  133. package/web-app/dist/assets/{globe-Y6IK2RPW.js → globe-r-xCP4DE.js} +1 -1
  134. package/web-app/dist/assets/{hammer-BKzr9VZI.js → hammer-DTt0SsCB.js} +1 -1
  135. package/web-app/dist/assets/{index-B20cSx5G.js → index-BkbXyH8y.js} +3 -3
  136. package/web-app/dist/assets/{layers-DebNOhGS.js → layers-BvZhvSMY.js} +1 -1
  137. package/web-app/dist/assets/{loader-circle-DyGbrEgd.js → loader-circle-3gosTei9.js} +1 -1
  138. package/web-app/dist/assets/{lock-BKPpyt20.js → lock-CZZMxP0U.js} +1 -1
  139. package/web-app/dist/assets/{package-egF5Wi4y.js → package-C5A8CkJr.js} +1 -1
  140. package/web-app/dist/assets/{plus-OiEgKIc-.js → plus-Btv7tTIF.js} +1 -1
  141. package/web-app/dist/assets/{refresh-cw-CzKvrONq.js → refresh-cw-DsWLXgs_.js} +1 -1
  142. package/web-app/dist/assets/{rotate-ccw-Bu2mII0p.js → rotate-ccw-DOVDjway.js} +1 -1
  143. package/web-app/dist/assets/{scroll-text-CSkiyax8.js → scroll-text-smySzlrX.js} +1 -1
  144. package/web-app/dist/assets/{server-DlPthJFw.js → server-b5PHsqAU.js} +1 -1
  145. package/web-app/dist/assets/{shield-alert-CbpHWQQX.js → shield-alert-BD7FDlh-.js} +1 -1
  146. package/web-app/dist/assets/{thumbs-up-DgGpZe-Q.js → thumbs-up-CAsFzbyE.js} +1 -1
  147. package/web-app/dist/assets/{trash-2-BV3GlCB-.js → trash-2-BJ35qHgl.js} +1 -1
  148. package/web-app/dist/assets/{trending-down-Y4TJtXhD.js → trending-down-Ozrd26cZ.js} +1 -1
  149. package/web-app/dist/assets/{trending-up-DsDNoHZY.js → trending-up-BhnMcM32.js} +1 -1
  150. package/web-app/dist/assets/{upload-gkThrc_I.js → upload-JVHfdwoA.js} +1 -1
  151. package/web-app/dist/assets/{usePolling-jpNSeNAe.js → usePolling-CTzbDV-e.js} +1 -1
  152. package/web-app/dist/assets/{user-3Zez1WOK.js → user-Bks3-GYv.js} +1 -1
  153. package/web-app/dist/index.html +1 -1
  154. package/docs/ARCHITECTURE-OVERVIEW.md +0 -209
  155. package/docs/AUTONOMI-ECOSYSTEM.md +0 -107
  156. package/docs/COCKPIT-SPEC.md +0 -72
  157. package/docs/COCKPIT-UX-MANDATE.md +0 -53
  158. package/docs/COMPETITIVE-ANALYSIS.md +0 -303
  159. package/docs/COMPETITIVE-NEXT-10.md +0 -316
  160. package/docs/COMPETITIVE-RALPH-ZEROSHOT-2026-07-08.md +0 -81
  161. package/docs/DASHBOARD-9.12-EVIDENCE.md +0 -97
  162. package/docs/DASHBOARD-ARCHITECTURE.md +0 -425
  163. package/docs/DASHBOARD_V2_CHECKLIST.md +0 -243
  164. package/docs/DEMOS.md +0 -63
  165. package/docs/ENTERPRISE-IDENTITY-ROADMAP.md +0 -206
  166. package/docs/EVIDENCE-RECEIPT-BUILD-APPLICABILITY.md +0 -79
  167. package/docs/FEAT-PRDREUSE-DOCKER-PLAN.md +0 -144
  168. package/docs/GATE-FAILURE-TRIAGE.md +0 -254
  169. package/docs/HANDOFF-2026-08-03.md +0 -439
  170. package/docs/LOOP-CANDIDATE-PROPOSAL-v1.md +0 -167
  171. package/docs/LOOP-HARNESS-AUDIT.md +0 -684
  172. package/docs/MERGE-DEDUP-MAP.md +0 -420
  173. package/docs/MERGE-ROUTE-MAP.md +0 -139
  174. package/docs/MODEL-REGISTRY-PLAN.md +0 -155
  175. package/docs/OUTCOME-FRONTIER.md +0 -536
  176. package/docs/P2-SPEC-ROBUSTNESS-PLAN.md +0 -192
  177. package/docs/PLANS-INDEX.md +0 -32
  178. package/docs/PRD-REUSE-DONE-RECOGNITION-PLAN.md +0 -536
  179. package/docs/PROMPT-ABLATION-RESULT.md +0 -97
  180. package/docs/R4-TRUST-TRAJECTORY-DESIGN.md +0 -127
  181. package/docs/R5-AUTO-WIKI-DESIGN.md +0 -137
  182. package/docs/R6-ROLLBACK-CHECKPOINT-PLAN.md +0 -107
  183. package/docs/R7-ZERO-CONFIG-FIRST-RUN-PLAN.md +0 -137
  184. package/docs/R8-SHAREABLE-TEAM-ASSETS-PLAN.md +0 -129
  185. package/docs/R9-OPEN-CORE-HOOKS-PLAN.md +0 -113
  186. package/docs/RARV-C-100X-PLAN.md +0 -286
  187. package/docs/RARV-C-LOOP-EFFICIENCY-PLAN.md +0 -470
  188. package/docs/SHAREABLE-PROOF-PLAN.md +0 -194
  189. package/docs/SONNET5-DEFAULT-PLAN.md +0 -157
  190. package/docs/SPEED-AND-FIRST-PASS-PLAN.md +0 -281
  191. package/docs/STALE-STATE-AUDIT.md +0 -174
  192. package/docs/SYNERGY-TASKS.md +0 -143
  193. package/docs/TASKLIST-ACCURACY-PLAN.md +0 -355
  194. package/docs/TOP-100-BACKLOG.md +0 -159
  195. package/docs/V8-ACCEPTANCE-TRIAGE-2026-07-24.md +0 -114
  196. package/docs/V8-COMPLEXITY-AUDIT-2026-07-24.md +0 -45
  197. package/docs/V8-MAJOR-RELEASE-PLAN.md +0 -137
  198. package/docs/V8-OVERNIGHT-PLAN-2026-07-25.md +0 -82
  199. package/docs/V8-SDK-RESEARCH-RAW.md +0 -129
  200. package/docs/WELCOME-OPENER-PLAN.md +0 -106
  201. package/docs/adoption-baseline-2026-07-31.md +0 -84
  202. package/docs/architecture/bmad-integration-epic.md +0 -271
  203. package/docs/architecture/bmad-integration-review.md +0 -86
  204. package/docs/architecture/bmad-integration-validation.md +0 -249
  205. package/docs/architecture/bmad-loki-voice-agent-council-analysis.md +0 -61
  206. package/docs/auto-claude-comparison.md +0 -250
  207. package/docs/bug-fixes/agent-01-cli-fixes.md +0 -101
  208. package/docs/bug-fixes/agent-02-purplelab-fixes.md +0 -88
  209. package/docs/bug-fixes/agent-03-dashboard-fixes.md +0 -119
  210. package/docs/bug-fixes/agent-04-memory-fixes.md +0 -105
  211. package/docs/bug-fixes/agent-05-provider-fixes.md +0 -86
  212. package/docs/bug-fixes/agent-06-integration-fixes.md +0 -101
  213. package/docs/bug-fixes/agent-07-dash-run-fixes.md +0 -101
  214. package/docs/bug-fixes/agent-08-docker-fixes.md +0 -164
  215. package/docs/bug-fixes/agent-09-e2e-build-fixes.md +0 -69
  216. package/docs/bug-fixes/agent-10-e2e-fullstack-fixes.md +0 -102
  217. package/docs/bug-fixes/agent-11-e2e-session-fixes.md +0 -70
  218. package/docs/bug-fixes/agent-12-scenario-fixes.md +0 -120
  219. package/docs/bug-fixes/agent-13-enterprise-fixes.md +0 -143
  220. package/docs/bug-fixes/agent-14-uat-newuser-fixes.md +0 -88
  221. package/docs/bug-fixes/agent-15-uat-poweruser-fixes.md +0 -132
  222. package/docs/bug-fixes/agent-19-code-review.md +0 -316
  223. package/docs/bug-fixes/agent-20-architecture-review.md +0 -331
  224. package/docs/competitive/bolt-new-analysis.md +0 -579
  225. package/docs/competitive/emergence-others-analysis.md +0 -605
  226. package/docs/competitive/replit-lovable-analysis.md +0 -622
  227. package/docs/dashboard-guide.md +0 -487
  228. package/docs/enterprise/migration.md +0 -265
  229. package/docs/history/one-run-audit.md +0 -304
  230. package/docs/plans/FORGE-AUTONOMOUS-QUEUE.md +0 -312
  231. package/docs/plans/ULTRAPLAN-FORGE-BAAS.md +0 -612
  232. package/docs/plans/UT2-6-LSP-DIAGNOSTIC-BROADCAST.md +0 -394
  233. package/docs/prd-purple-lab-ide.md +0 -152
  234. package/docs/prd-purple-lab-platform-v2.md +0 -223
  235. package/docs/prd-purple-lab-platform.md +0 -319
  236. package/docs/retrospectives/v7.5.15-fleet-postmortem.md +0 -325
  237. package/docs/retrospectives/v7.5.15-honesty-audit.md +0 -136
  238. package/docs/retrospectives/v7.5.15-llm-failure-modes.md +0 -49
  239. package/docs/show-hn-post.md +0 -46
  240. package/docs/test-scenarios/enterprise-scenarios.md +0 -732
  241. package/docs/thick2thin.md +0 -173
  242. package/packages/control-plane/ui/dist/assets/index-DcBJXjCJ.js +0 -190
package/docs/DOCKER.md ADDED
@@ -0,0 +1,469 @@
1
+ # Loki Mode
2
+
3
+ **Multi-agent autonomous development system. Takes a spec to a deployed product with minimal human intervention.**
4
+
5
+ Transform your spec into a fully built, production-ready product. Built on 2025 research from OpenAI, Google DeepMind, and Anthropic. Source-available under BUSL-1.1.
6
+
7
+ The image ships the Claude Code CLI pre-installed, so it can run real builds out of the box. Just supply credentials (see Authentication below).
8
+
9
+ Docker is where sandboxes and runs happen. `loki docker` gives you the full local experience in one command (including `.loki/` state, resume, and continuity), so start there. The raw `docker run` and `docker compose` methods below remain available as alternatives.
10
+
11
+ ## Quick Start (loki docker, easiest)
12
+
13
+ If you already have loki installed on the host (npm/brew/bun) plus Docker, `loki docker` is the simplest way to run loki in a container. It is a thin host wrapper around the published image: it runs any loki command inside `asklokesh/loki-mode` with zero config.
14
+
15
+ ```bash
16
+ # Run a build against a spec in the current directory
17
+ loki docker start prd.md
18
+
19
+ # Any loki command works
20
+ loki docker status
21
+
22
+ # Print the docker command it would run, without running it
23
+ loki docker --dry-run start prd.md
24
+ ```
25
+
26
+ What it does for you automatically:
27
+
28
+ - Bind-mounts the current folder to `/workspace`, so `.loki/` state (memory, session, queue, checkpoints) persists on the host. Resume and continuity behave exactly like the local `loki` CLI. Stop a build and run `loki docker start prd.md` again later and it resumes with full memory and session continuity.
29
+ - Auto-detects auth, in this order:
30
+ 1. `ANTHROPIC_API_KEY` if set in your environment (explicit), else
31
+ 2. your host's existing Claude Code login (macOS Keychain, or `~/.claude/.credentials.json` on Linux), extracted to a private temp file and mounted read-write so the in-container claude can refresh the short-lived token. A Claude Code Max/Pro subscriber needs no API key; it just reuses the login. Else
32
+ 3. an honest error with setup guidance.
33
+ - Forwards `~/.gitconfig` and `~/.config/gh` (read-only) plus `GITHUB_TOKEN`/`GH_TOKEN` if set, so commits and PRs work like local.
34
+ - Registers the project with the host dashboard, so one host `loki dashboard` shows all your `loki docker` and local `loki start` projects in a single unified view (see "Run loki in multiple repos" below). Builds run with the dashboard off by default; add `--api` to publish port 57374 for a single run.
35
+
36
+ Flags:
37
+
38
+ | Flag | Description |
39
+ |------|-------------|
40
+ | `--image IMG` | Override the image (default `asklokesh/loki-mode:latest`) |
41
+ | `--dry-run` | Print the docker command that would run, then exit |
42
+
43
+ The credentials temp file used for Auth method 2 is created with `0600` permissions and wiped on exit. It is never written into the project, never committed, never logged.
44
+
45
+ Requirements: loki installed on the host (npm/brew/bun) plus Docker. `loki docker` is a host wrapper; it does not bundle the image, it pulls/runs the published one.
46
+
47
+ ### Run loki in multiple repos (unified dashboard)
48
+
49
+ `loki docker` is a first-class multi-repo surface, just like the host CLI. You can run `loki docker start` in several different folders at once:
50
+
51
+ ```bash
52
+ cd ~/work/api && loki docker start prd.md
53
+ cd ~/work/frontend && loki docker start prd.md
54
+ cd ~/work/cli && loki docker start prd.md
55
+ ```
56
+
57
+ Each repo gets its own container (deterministic name `loki-<hash-of-path>`), its own bind-mounted `/workspace`, and its own `.loki/` state on the host, so two repos run as two concurrent containers without colliding on a shared port.
58
+
59
+ Every `loki docker` project registers on the host (with its real folder path) into the same machine-global registry the host dashboard reads. So one host dashboard shows them all:
60
+
61
+ ```bash
62
+ loki dashboard # on the host -- lists ALL projects
63
+ ```
64
+
65
+ The host `loki dashboard` lists every project whether it runs via local `loki start` or via `loki docker start`, and derives each project's running state from its bind-mounted `.loki/session.json`. One dashboard, all repos, same as the local CLI experience.
66
+
67
+ Note: `loki docker` builds run with the dashboard off by default (so concurrent runs never fight over port 57374). The unified view is the host `loki dashboard`. To bring up the dashboard for a single containerized run instead, use `loki docker start --api prd.md`, which publishes port 57374 for that one container.
68
+
69
+ Stopping a containerized build: the dashboard Stop button (and `loki stop`) signals a `loki docker` project by writing `.loki/STOP` into the bind-mounted workspace, which the in-container runner honors at the next iteration boundary. So Stop is reliable but not instant for Docker projects: a build can take up to one provider iteration to wind down, versus the immediate signal a host process receives. To stop a container immediately, use `docker stop loki-<hash-of-path>`.
70
+
71
+ ## Quick Start (docker compose)
72
+
73
+ If you prefer not to install loki on the host, `docker compose` runs Loki from the image directly. You set credentials once in a `.env` file and never retype long flags.
74
+
75
+ ```bash
76
+ # 1. Get the repo (provides docker/docker-compose.yml and docker/.env.example)
77
+ git clone https://github.com/asklokesh/loki-mode.git
78
+ cd loki-mode
79
+
80
+ # 2. Copy the env template and set your key
81
+ cp docker/.env.example .env
82
+ # edit .env, set ANTHROPIC_API_KEY=sk-ant-...
83
+
84
+ # 3. Run a build against a spec in the current directory
85
+ docker compose -f docker/docker-compose.yml run loki start prd.md
86
+ ```
87
+
88
+ To change anything (budget, provider, max iterations), edit `.env` and run the command again. No flags to retype.
89
+
90
+ For a mounted config file instead of a long `.env`, pass `loki start --config /path/to/config.yaml` (also accepts `.json`/`.env`; secrets via `${VAR}`). See "Configuration file" in [docs/INSTALLATION.md](INSTALLATION.md).
91
+
92
+ With the dashboard UI:
93
+
94
+ ```bash
95
+ docker compose -f docker/docker-compose.yml run --service-ports loki start --api prd.md
96
+ # Dashboard at http://localhost:57374
97
+ ```
98
+
99
+ ## Quick Start (docker run)
100
+
101
+ If you prefer `docker run`, pass the key as an environment variable:
102
+
103
+ ```bash
104
+ # Pull the latest image
105
+ docker pull asklokesh/loki-mode:latest
106
+
107
+ # Show help
108
+ docker run --rm asklokesh/loki-mode
109
+
110
+ # Start autonomous mode with a spec
111
+ docker run -it \
112
+ -e ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" \
113
+ -v "$(pwd)":/workspace \
114
+ asklokesh/loki-mode start prd.md
115
+
116
+ # With dashboard UI
117
+ docker run -it \
118
+ -e ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" \
119
+ -p 57374:57374 \
120
+ -v "$(pwd)":/workspace \
121
+ asklokesh/loki-mode start --api prd.md
122
+ # Dashboard at http://localhost:57374
123
+ ```
124
+
125
+ ## Authentication
126
+
127
+ Loki uses Claude (the only provider pre-installed in the image). There are two ways to authenticate.
128
+
129
+ ### Method 1: API key (default, recommended)
130
+
131
+ Set `ANTHROPIC_API_KEY`. Get a key from https://console.anthropic.com/settings/keys.
132
+
133
+ With compose, put it in `.env`:
134
+
135
+ ```bash
136
+ # .env
137
+ ANTHROPIC_API_KEY=sk-ant-...
138
+ ```
139
+
140
+ With `docker run`, pass it directly:
141
+
142
+ ```bash
143
+ docker run -it \
144
+ -e ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" \
145
+ -v "$(pwd)":/workspace \
146
+ asklokesh/loki-mode start prd.md
147
+ ```
148
+
149
+ ### Method 2: Mount host OAuth credentials (Claude Max/Pro subscribers, no API key)
150
+
151
+ If you have a Claude Code Max or Pro subscription and no API key, mount your host login credentials into the container.
152
+
153
+ macOS (credentials live in the Keychain, export them to a file first):
154
+
155
+ ```bash
156
+ security find-generic-password -s "Claude Code-credentials" -w \
157
+ | jq '{claudeAiOauth}' > .loki-oauth-credentials.json
158
+
159
+ docker run -it \
160
+ -v "$(pwd)/.loki-oauth-credentials.json:/home/loki/.claude/.credentials.json:rw" \
161
+ -v "$(pwd)":/workspace \
162
+ asklokesh/loki-mode start prd.md
163
+ ```
164
+
165
+ Linux (credentials are already a file at `~/.claude/.credentials.json`, mount it directly):
166
+
167
+ ```bash
168
+ docker run -it \
169
+ -v ~/.claude/.credentials.json:/home/loki/.claude/.credentials.json:rw \
170
+ -v "$(pwd)":/workspace \
171
+ asklokesh/loki-mode start prd.md
172
+ ```
173
+
174
+ For compose, uncomment the OAuth-mount volume line in `docker/docker-compose.yml`.
175
+
176
+ Notes for Method 2:
177
+ - The mount must be `rw` so refreshed tokens persist back to the host file.
178
+ - Never commit `.loki-oauth-credentials.json`. It contains a live token.
179
+ - Tokens are short-lived (hours). If a container sits idle past expiry, re-export the file before the next run.
180
+
181
+ ## State and Memory Persistence
182
+
183
+ Loki writes its state to `.loki/` inside `/workspace` (memory, session, queue, checkpoints). Because the project directory is bind-mounted to `/workspace`, that state lives on your host and persists across runs. Stop a build and start it again later and it resumes with full memory and session continuity.
184
+
185
+ ## Image Details
186
+
187
+ | Property | Value |
188
+ |----------|-------|
189
+ | Base | Ubuntu 24.04 |
190
+ | User | `loki` (UID 1000, non-root) |
191
+ | Workdir | `/workspace` |
192
+ | CMD | `loki help` |
193
+ | Exposed Port | `57374` (Dashboard/API) |
194
+ | Node.js | 20 LTS |
195
+ | Python | 3.x (for dashboard server) |
196
+ | GitHub CLI | v2.65.0 |
197
+ | Claude Code CLI | pre-installed |
198
+
199
+ ## Usage Examples
200
+
201
+ ```bash
202
+ # Interactive shell
203
+ docker run -it -v "$(pwd)":/workspace asklokesh/loki-mode bash
204
+
205
+ # Background autonomous mode
206
+ docker run -d \
207
+ -e ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" \
208
+ -v "$(pwd)":/workspace \
209
+ asklokesh/loki-mode start --bg prd.md
210
+
211
+ # Quick single-task mode (max 3 iterations)
212
+ docker run -it \
213
+ -e ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" \
214
+ -v "$(pwd)":/workspace \
215
+ asklokesh/loki-mode quick "add login page"
216
+
217
+ # Check status
218
+ docker run -it -v "$(pwd)":/workspace asklokesh/loki-mode status
219
+
220
+ # Build a PRD interactively from templates
221
+ docker run -it -v "$(pwd)":/workspace asklokesh/loki-mode init
222
+
223
+ # Generate PRD from a GitHub issue
224
+ docker run -it \
225
+ -e GITHUB_TOKEN="$GITHUB_TOKEN" \
226
+ -v "$(pwd)":/workspace \
227
+ asklokesh/loki-mode issue https://github.com/org/repo/issues/42
228
+ ```
229
+
230
+ ## Providers
231
+
232
+ Claude is the default provider and the only CLI pre-installed in this image.
233
+
234
+ | Provider | Tier | In this image | Notes |
235
+ |----------|------|---------------|-------|
236
+ | Claude Code | Tier 1 (default) | Yes | Full feature support (subagents, parallel, Task tool, MCP) |
237
+ | OpenAI Codex CLI | Tier 3 | No | Degraded mode (sequential only). Install the CLI in a derived image. |
238
+ | Cline | Tier 2 | No | Reduced parallelism. Install the CLI in a derived image. |
239
+ | Aider | Tier 3 | No | Degraded mode. Install the CLI in a derived image. |
240
+
241
+ To use a Tier 2/3 provider, build a derived image that installs that provider's CLI, then set `LOKI_PROVIDER` and the relevant API key. Example skeleton:
242
+
243
+ ```dockerfile
244
+ FROM asklokesh/loki-mode:latest
245
+ USER root
246
+ # install your provider CLI here (for example, the Codex CLI)
247
+ USER loki
248
+ ```
249
+
250
+ ```bash
251
+ docker run -it \
252
+ -e LOKI_PROVIDER=codex \
253
+ -e OPENAI_API_KEY="$OPENAI_API_KEY" \
254
+ -v "$(pwd)":/workspace \
255
+ your-derived-image start prd.md
256
+ ```
257
+
258
+ ## Volume Mounts
259
+
260
+ | Host Path | Container Path | Mode | Purpose |
261
+ |-----------|---------------|------|---------|
262
+ | Project dir | `/workspace` | `rw` | Source code, PRD files, and persisted `.loki/` state |
263
+ | OAuth credentials | `/home/loki/.claude/.credentials.json` | `rw` | Claude Max/Pro login (Auth Method 2) |
264
+ | `~/.gitconfig` | `/home/loki/.gitconfig` | `ro` | Git configuration |
265
+ | `~/.ssh` | `/home/loki/.ssh` | `ro` | Git SSH authentication |
266
+ | `~/.config/gh` | `/home/loki/.config/gh` | `ro` | GitHub CLI authentication |
267
+
268
+ ```bash
269
+ # Full setup with Git and GitHub access
270
+ docker run -it \
271
+ -e ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" \
272
+ -e GITHUB_TOKEN="$GITHUB_TOKEN" \
273
+ -v "$(pwd)":/workspace \
274
+ -v ~/.gitconfig:/home/loki/.gitconfig:ro \
275
+ -v ~/.ssh:/home/loki/.ssh:ro \
276
+ -v ~/.config/gh:/home/loki/.config/gh:ro \
277
+ -p 57374:57374 \
278
+ asklokesh/loki-mode start --api prd.md
279
+ ```
280
+
281
+ > **SSH Note**: Prefer SSH agent forwarding over mounting private keys. Mount only `known_hosts` and public keys when possible.
282
+
283
+ ## Environment Variables
284
+
285
+ ### Credentials
286
+
287
+ | Variable | Description |
288
+ |----------|-------------|
289
+ | `ANTHROPIC_API_KEY` | Anthropic API key (Auth Method 1, default for Claude provider) |
290
+ | `OPENAI_API_KEY` | OpenAI API key (required only for the Codex provider in a derived image) |
291
+ | `GITHUB_TOKEN` | GitHub personal access token |
292
+
293
+ ### Core Configuration
294
+
295
+ | Variable | Description | Default |
296
+ |----------|-------------|---------|
297
+ | `LOKI_PROVIDER` | AI provider: `claude`, `codex`, `cline`, `aider` | `claude` |
298
+ | `LOKI_MAX_ITERATIONS` | Max autonomous iteration cycles | `1000` |
299
+ | `LOKI_MAX_RETRIES` | Max retry attempts per iteration | `50` |
300
+ | `LOKI_DASHBOARD` | Enable dashboard server | `true` |
301
+ | `LOKI_DASHBOARD_PORT` | Dashboard/API port | `57374` |
302
+ | `LOKI_BUDGET_LIMIT` | Max USD spend before auto-pause (e.g. `50.00`) | unset |
303
+ | `LOKI_NOTIFICATIONS` | Desktop notifications | `false` |
304
+
305
+ ### Execution Control
306
+
307
+ | Variable | Description | Default |
308
+ |----------|-------------|---------|
309
+ | `LOKI_AUTONOMY_MODE` | `perpetual`, `checkpoint`, or `supervised` | `perpetual` |
310
+ | `LOKI_COMPLETION_PROMISE` | Stop condition text (AI outputs this to halt) | unset |
311
+ | `LOKI_PARALLEL_MODE` | Enable git worktree parallelism | `false` |
312
+ | `LOKI_MAX_PARALLEL_AGENTS` | Limit concurrent sub-agents | `10` |
313
+ | `LOKI_SKIP_MEMORY` | Skip loading memory context | `false` |
314
+ | `LOKI_SKIP_PREREQS` | Skip prerequisite checks | `false` |
315
+
316
+ ### Security (Enterprise)
317
+
318
+ | Variable | Description | Default |
319
+ |----------|-------------|---------|
320
+ | `LOKI_STAGED_AUTONOMY` | Require approval before each action | `false` |
321
+ | `LOKI_AUDIT_LOG` | Enable audit logging | `true` |
322
+ | `LOKI_ALLOWED_PATHS` | SANDBOX-SCOPED: host paths the sandbox may mount writable (does NOT restrict agent writes) | all |
323
+ | `LOKI_BLOCKED_COMMANDS` | SANDBOX-SCOPED: blocked `loki sandbox run` argv (does NOT filter agent commands) | `rm -rf /,dd if=,mkfs,...` |
324
+ | `LOKI_SANDBOX_MODE` | Run in Docker-in-Docker sandbox | `false` |
325
+
326
+ ### SDLC Phases (all enabled by default, set to `false` to skip)
327
+
328
+ `LOKI_PHASE_UNIT_TESTS`, `LOKI_PHASE_API_TESTS`, `LOKI_PHASE_E2E_TESTS`, `LOKI_PHASE_SECURITY`, `LOKI_PHASE_INTEGRATION`, `LOKI_PHASE_CODE_REVIEW`, `LOKI_PHASE_WEB_RESEARCH`, `LOKI_PHASE_PERFORMANCE`, `LOKI_PHASE_ACCESSIBILITY`, `LOKI_PHASE_REGRESSION`, `LOKI_PHASE_UAT`
329
+
330
+ ### Completion Council
331
+
332
+ | Variable | Description | Default |
333
+ |----------|-------------|---------|
334
+ | `LOKI_COUNCIL_ENABLED` | Multi-agent verification council | `true` |
335
+ | `LOKI_COUNCIL_SIZE` | Number of council members | `3` |
336
+ | `LOKI_COUNCIL_THRESHOLD` | Votes required to pass | `2` |
337
+
338
+ ### TLS/HTTPS (Dashboard)
339
+
340
+ | Variable | Description |
341
+ |----------|-------------|
342
+ | `LOKI_TLS_CERT` | Path to PEM certificate |
343
+ | `LOKI_TLS_KEY` | Path to PEM private key |
344
+
345
+ ## CLI Commands
346
+
347
+ | Command | Description |
348
+ |---------|-------------|
349
+ | `start [PRD]` | Start autonomous execution |
350
+ | `quick "task"` | Quick single-task mode (max 3 iterations) |
351
+ | `stop` | Stop execution |
352
+ | `pause` / `resume` | Pause/resume execution |
353
+ | `status [--json]` | Show current status |
354
+ | `logs` | Show recent log output |
355
+ | `init` | Build PRD interactively from templates |
356
+ | `issue <url\|num>` | Generate PRD from GitHub issue |
357
+ | `dashboard <cmd>` | Dashboard server: start, stop, status, url, open |
358
+ | `provider <cmd>` | Manage provider: show, set, list, info |
359
+ | `memory <cmd>` | Cross-project learnings |
360
+ | `council <cmd>` | Completion council status |
361
+ | `config <cmd>` | Configuration: show, init, edit, path |
362
+ | `docker <cmd>` | Run any loki command inside the published image (host wrapper, zero config) |
363
+ | `sandbox <cmd>` | Docker sandbox: start, stop, status, logs, shell |
364
+ | `remote [PRD]` | Start remote session (connect from phone/browser, Claude Pro/Max) |
365
+ | `cleanup` | Kill orphaned processes |
366
+ | `version` | Show version |
367
+ | `help` | Show help |
368
+
369
+ ### Start Options
370
+
371
+ ```
372
+ --provider NAME AI provider: claude (default), codex, cline, aider
373
+ --parallel Enable parallel mode with git worktrees
374
+ --bg, --background Run in background
375
+ --simple Force simple complexity tier
376
+ --complex Force complex complexity tier
377
+ --github Enable GitHub issue import
378
+ --no-dashboard Disable web dashboard
379
+ --sandbox Run in Docker sandbox
380
+ --skip-memory Skip loading memory context
381
+ --budget USD Set cost budget limit
382
+ --yes, -y Skip confirmation prompts
383
+ ```
384
+
385
+ ## Docker Compose Reference
386
+
387
+ The repo ships a ready-to-use `docker/docker-compose.yml` with an `env_file: .env` and an `ANTHROPIC_API_KEY` passthrough, plus a commented OAuth-mount volume for Auth Method 2. Copy `.env.example` to `.env`, set your key, and run. For reference, the service looks like this:
388
+
389
+ ```yaml
390
+ services:
391
+ loki:
392
+ image: asklokesh/loki-mode:latest
393
+ env_file: .env
394
+ volumes:
395
+ - .:/workspace:rw
396
+ - ~/.gitconfig:/home/loki/.gitconfig:ro
397
+ - ~/.ssh:/home/loki/.ssh:ro
398
+ - ~/.config/gh:/home/loki/.config/gh:ro
399
+ # Auth Method 2 (Claude Max/Pro): uncomment to mount host OAuth credentials
400
+ # - ./.loki-oauth-credentials.json:/home/loki/.claude/.credentials.json:rw
401
+ environment:
402
+ - ANTHROPIC_API_KEY
403
+ ports:
404
+ - "57374:57374"
405
+ working_dir: /workspace
406
+ stdin_open: true
407
+ tty: true
408
+ ```
409
+
410
+ ```bash
411
+ cp docker/.env.example .env # then edit .env and set ANTHROPIC_API_KEY
412
+ docker compose -f docker/docker-compose.yml run loki start prd.md
413
+ ```
414
+
415
+ ## Security-Hardened Sandbox
416
+
417
+ For untrusted PRDs, enterprise, or CI/CD environments:
418
+
419
+ ```bash
420
+ # Build sandbox image
421
+ docker build -t loki-mode:sandbox -f docker/Dockerfile.sandbox .
422
+
423
+ # Run with resource limits and security controls
424
+ docker run -it \
425
+ --cpus=2 --memory=4g --pids-limit=256 \
426
+ --security-opt=no-new-privileges:true \
427
+ --cap-drop=ALL --cap-add=CHOWN \
428
+ -e ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" \
429
+ -v "$(pwd)":/workspace \
430
+ loki-mode:sandbox start prd.md
431
+
432
+ # Or use the built-in sandbox launcher
433
+ ./autonomy/sandbox.sh start prd.md
434
+ ```
435
+
436
+ Sandbox features: seccomp profile, capability dropping, resource limits, network isolation, optional read-only workspace.
437
+
438
+ ## Healthcheck
439
+
440
+ The image includes a built-in healthcheck that verifies `loki version` responds correctly. Check container health with:
441
+
442
+ ```bash
443
+ docker inspect --format='{{.State.Health.Status}}' <container-id>
444
+ ```
445
+
446
+ ## Tags
447
+
448
+ | Tag | Description |
449
+ |-----|-------------|
450
+ | `latest` | Latest stable release |
451
+ | `8.0.0` | Specific version (current release) |
452
+ | `7.x.x` | Prior versions |
453
+ | `sandbox` | Security-hardened image (Debian slim) |
454
+
455
+ ## Links
456
+
457
+ - [GitHub Repository](https://github.com/asklokesh/loki-mode)
458
+ - [Installation Guide](https://github.com/asklokesh/loki-mode/blob/main/docs/INSTALLATION.md)
459
+ - [Documentation](https://asklokesh.github.io/loki-mode)
460
+ - [PRD Templates](https://github.com/asklokesh/loki-mode/tree/main/templates)
461
+
462
+ ## License
463
+
464
+ Business Source License 1.1 (BUSL-1.1). Source-available, not open source. See [LICENSE](https://github.com/asklokesh/loki-mode/blob/main/LICENSE) and [docs/LICENSE-CHANGE-NOTICE.md](https://github.com/asklokesh/loki-mode/blob/main/docs/LICENSE-CHANGE-NOTICE.md). Converts to Apache 2.0 on March 19, 2030.
465
+
466
+ ## Support
467
+
468
+ - [GitHub Issues](https://github.com/asklokesh/loki-mode/issues)
469
+ - [Documentation Wiki](https://github.com/asklokesh/loki-mode/wiki)