loki-mode 11.3.9 → 11.4.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 (100) hide show
  1. package/README.md +34 -18
  2. package/SKILL.md +3 -3
  3. package/VERSION +1 -1
  4. package/agents/custom_agents.py +280 -0
  5. package/autonomy/council-v2.sh +22 -1
  6. package/autonomy/edit.sh +242 -0
  7. package/autonomy/lib/chat.sh +312 -0
  8. package/autonomy/lib/help-core.sh +164 -0
  9. package/autonomy/lib/json-output.sh +38 -0
  10. package/autonomy/lib/run-summary.sh +96 -0
  11. package/autonomy/loki +105 -10
  12. package/autonomy/route.sh +270 -0
  13. package/autonomy/run.sh +6 -0
  14. package/autonomy/setup-wizard.sh +161 -0
  15. package/autonomy/verify.sh +22 -2
  16. package/bin/loki +73 -18
  17. package/completions/_loki +55 -0
  18. package/completions/loki.bash +49 -3
  19. package/dashboard/__init__.py +1 -1
  20. package/docs/CLI-CORE-VERBS.md +112 -0
  21. package/docs/CLI-REFERENCE.md +7 -1
  22. package/docs/COMPARE-OPENCODE.md +94 -0
  23. package/docs/COMPONENTS.md +1 -0
  24. package/docs/INSTALLATION.md +56 -12
  25. package/docs/KNOWN-ISSUES.md +2 -12
  26. package/docs/QUICKSTART.md +108 -0
  27. package/docs/environment-variables.md +9 -2
  28. package/docs/exit-codes.md +29 -12
  29. package/docs/v10/CLI-MODERN.md +10 -4
  30. package/docs/v10/GUIDE.md +270 -44
  31. package/docs/v10/OPENCODE-PARITY-PLAN.md +84 -0
  32. package/loki-ts/dist/loki.js +968 -933
  33. package/mcp/__init__.py +1 -1
  34. package/package.json +2 -2
  35. package/packages/control-plane/dist/server.js +180 -80
  36. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  37. package/providers/claude.sh +16 -2
  38. package/providers/model_route_exec.sh +22 -0
  39. package/providers/model_routes.sh +188 -0
  40. package/skills/providers.md +13 -0
  41. package/templates/agents/planner.md +10 -0
  42. package/templates/agents/reviewer.md +10 -0
  43. package/templates/agents/tester.md +10 -0
  44. package/web-app/dist/assets/{AdminPage-QK-i_x-O.js → AdminPage-CYJ2BWRC.js} +1 -1
  45. package/web-app/dist/assets/{Avatar-DblkLNjB.js → Avatar-DdK4wynI.js} +1 -1
  46. package/web-app/dist/assets/{Badge-DIV2ny5H.js → Badge-CrX3MI7J.js} +1 -1
  47. package/web-app/dist/assets/{Button--rePJOlQ.js → Button-709-wwGM.js} +1 -1
  48. package/web-app/dist/assets/{CockpitPage-BZlKxpGy.js → CockpitPage-BapdTInO.js} +1 -1
  49. package/web-app/dist/assets/{ComparePage-3_INSVux.js → ComparePage-DT99pGvA.js} +1 -1
  50. package/web-app/dist/assets/{ErrorBoundary-DHG63CNr.js → ErrorBoundary-B0uJSys8.js} +1 -1
  51. package/web-app/dist/assets/{EvidenceReceiptPanel-DFsBnLlO.js → EvidenceReceiptPanel-BtMFgElP.js} +1 -1
  52. package/web-app/dist/assets/{GitHubIssuesPanel-phPGah98.js → GitHubIssuesPanel-DjJuU941.js} +1 -1
  53. package/web-app/dist/assets/{GitHubPRsPanel-T7KQqJmx.js → GitHubPRsPanel-HXfEX1BC.js} +1 -1
  54. package/web-app/dist/assets/{HomePage-DFjGUF5I.js → HomePage-Cqyves-S.js} +2 -2
  55. package/web-app/dist/assets/{LoginPage-CorUid_5.js → LoginPage-jUbtC7_Y.js} +1 -1
  56. package/web-app/dist/assets/{MagicPage-DofbSxKD.js → MagicPage-DHRsqjgR.js} +1 -1
  57. package/web-app/dist/assets/{MetricsPage-qzrhhfLC.js → MetricsPage-B-pED05R.js} +1 -1
  58. package/web-app/dist/assets/{NotFoundPage-BAZR0mMb.js → NotFoundPage-CsbUs21R.js} +1 -1
  59. package/web-app/dist/assets/{ProjectPage-BOSUzG9J.js → ProjectPage-BtlLEQwB.js} +3 -3
  60. package/web-app/dist/assets/{ProjectsPage-Ba0YLtzD.js → ProjectsPage-DaRbRjSp.js} +1 -1
  61. package/web-app/dist/assets/{SettingsPage-Cr10Ue2K.js → SettingsPage-DALrtP3F.js} +1 -1
  62. package/web-app/dist/assets/{ShowcasePage-Czn655fe.js → ShowcasePage-CoPHSNP0.js} +1 -1
  63. package/web-app/dist/assets/{SystemSettingsPage-Dwjnw6Ob.js → SystemSettingsPage-kOuSN50O.js} +1 -1
  64. package/web-app/dist/assets/{TeamsPage-D8nc69Be.js → TeamsPage-DGWK0LMp.js} +1 -1
  65. package/web-app/dist/assets/{TemplatesPage-DHsaCDGv.js → TemplatesPage-C-_10CwA.js} +1 -1
  66. package/web-app/dist/assets/{TerminalOutput-DBejni2a.js → TerminalOutput-Cz_vPbXL.js} +1 -1
  67. package/web-app/dist/assets/{activity-B2VsBl1C.js → activity-icIsXJVa.js} +1 -1
  68. package/web-app/dist/assets/{bell-CT77Fq2H.js → bell-DbPR2_4r.js} +1 -1
  69. package/web-app/dist/assets/{bot-DfaWgF4H.js → bot-DvjP3Yh5.js} +1 -1
  70. package/web-app/dist/assets/{check-D1yp7Ndv.js → check-D1OBxHeU.js} +1 -1
  71. package/web-app/dist/assets/{chevron-left-B6Pa8IOX.js → chevron-left-D09jDZ29.js} +1 -1
  72. package/web-app/dist/assets/{circle-alert-D5jrL_Y7.js → circle-alert-DyZMLOcC.js} +1 -1
  73. package/web-app/dist/assets/{clock-DIsY_fa_.js → clock-CdpdJTId.js} +1 -1
  74. package/web-app/dist/assets/{cloud-eGwLh1As.js → cloud-CoLTlmoj.js} +1 -1
  75. package/web-app/dist/assets/{code-xml-CGDIcZ3m.js → code-xml-DrkE2ZZY.js} +1 -1
  76. package/web-app/dist/assets/{database-CWpdaykI.js → database-CMQQuM2R.js} +1 -1
  77. package/web-app/dist/assets/{dollar-sign-DZEuTCs6.js → dollar-sign-CuioDaOG.js} +1 -1
  78. package/web-app/dist/assets/{file-code-corner-BHBW6m9v.js → file-code-corner-Cx9j9K1S.js} +1 -1
  79. package/web-app/dist/assets/{file-plus-D4h1jZSR.js → file-plus-CYD2zaaI.js} +1 -1
  80. package/web-app/dist/assets/{globe-CXdqKgwd.js → globe-6w-hnQkL.js} +1 -1
  81. package/web-app/dist/assets/{hammer-B3YuuYI_.js → hammer-BpqtautL.js} +1 -1
  82. package/web-app/dist/assets/{index-BLEnboSv.js → index-Dzs-9EgJ.js} +3 -3
  83. package/web-app/dist/assets/{layers-Dvp5nFtw.js → layers-D5hd7jb7.js} +1 -1
  84. package/web-app/dist/assets/{loader-circle-DodDmIZ3.js → loader-circle-C6Y9x_7H.js} +1 -1
  85. package/web-app/dist/assets/{lock-EiuaH1Ep.js → lock-D51L7rYh.js} +1 -1
  86. package/web-app/dist/assets/{package-Cx4m2hFg.js → package-BJF8hkP8.js} +1 -1
  87. package/web-app/dist/assets/{plus-D-Sd5rpH.js → plus-D5kUQ79n.js} +1 -1
  88. package/web-app/dist/assets/{refresh-cw-C0w1cdmF.js → refresh-cw-BKdlCa7F.js} +1 -1
  89. package/web-app/dist/assets/{rotate-ccw-C_qk6MTT.js → rotate-ccw-_bd_YI1e.js} +1 -1
  90. package/web-app/dist/assets/{scroll-text-DSxiFtkc.js → scroll-text-DbkegIxF.js} +1 -1
  91. package/web-app/dist/assets/{server-NTJt7I8M.js → server-DAwqFIsq.js} +1 -1
  92. package/web-app/dist/assets/{shield-alert-HBxMQOvH.js → shield-alert-BuR1tPHu.js} +1 -1
  93. package/web-app/dist/assets/{thumbs-up-DEgsHzSD.js → thumbs-up-BF6p3mRd.js} +1 -1
  94. package/web-app/dist/assets/{trash-2-px46FnTD.js → trash-2-BVpnkqqz.js} +1 -1
  95. package/web-app/dist/assets/{trending-down-CBosVGKa.js → trending-down-DpsDvRwW.js} +1 -1
  96. package/web-app/dist/assets/{trending-up-Dbd7zrQj.js → trending-up-mFogTjt3.js} +1 -1
  97. package/web-app/dist/assets/{upload-nhdFKAs1.js → upload-4T8zpBsi.js} +1 -1
  98. package/web-app/dist/assets/{usePolling-BgaGdinh.js → usePolling-DPXQv8WO.js} +1 -1
  99. package/web-app/dist/assets/{user-CzIihUy9.js → user-BYGIFaTm.js} +1 -1
  100. package/web-app/dist/index.html +1 -1
package/completions/_loki CHANGED
@@ -64,8 +64,52 @@ function _loki {
64
64
  doctor)
65
65
  _arguments \
66
66
  '--json[Output machine-readable JSON]' \
67
+ '--fix[Create state dirs and a default config]' \
67
68
  '--help[Show help]'
68
69
  ;;
70
+ chat)
71
+ _arguments \
72
+ '--attach[Attach to a running session]' \
73
+ '--tui[Use the terminal UI]' \
74
+ '--help[Show help]'
75
+ ;;
76
+ agents)
77
+ _arguments \
78
+ '1:subcommand:(list new show export)' \
79
+ '--claude[Export to .claude/agents]' \
80
+ '--user[Use the user-level agents directory]' \
81
+ '--help[Show help]'
82
+ ;;
83
+ models)
84
+ _arguments \
85
+ '--local[Show local models]' \
86
+ '--json[Output machine-readable JSON]' \
87
+ '--help[Show help]'
88
+ ;;
89
+ setup)
90
+ _arguments \
91
+ '--yes[Non-interactive defaults]' \
92
+ '--check[Report only]' \
93
+ '--help[Show help]'
94
+ ;;
95
+ route)
96
+ _arguments \
97
+ '1:verb:(start quick)' \
98
+ '--json[Output machine-readable JSON]' \
99
+ '--provider[AI provider]:provider name:(claude cline codex aider opencode)' \
100
+ '--model[Model or route override]:model:' \
101
+ '--no-pr[Skip the pull request]' \
102
+ '--max-cost[Spend cap in USD]:amount:' \
103
+ '--help[Show help]'
104
+ ;;
105
+ edit)
106
+ _arguments \
107
+ '--verify[Run verification after the edit]' \
108
+ '--commit[Commit the edit]' \
109
+ '--dry-run[Describe the change only]' \
110
+ '--help[Show help]' \
111
+ '*:file:_files'
112
+ ;;
69
113
  reset)
70
114
  _loki_reset
71
115
  ;;
@@ -219,6 +263,13 @@ function _loki_commands {
219
263
  'queue:Overnight issue queue with a morning digest'
220
264
  'issues:Run every open issue in a repo and open PRs'
221
265
  'undo:Show what undoing a run would do (read-only plan)'
266
+ 'chat:Interactive chat session (run, attach)'
267
+ 'route:Print the engine, provider and model route without running'
268
+ 'edit:Make a scoped edit to files'
269
+ 'setup:First-run wizard for tools, provider, model route and spend cap'
270
+ 'models:List models and routes (--local for local models)'
271
+ 'agents:List, scaffold, show and export agent definitions'
272
+ 'diff:Show what the last run changed'
222
273
  'control:Control plane (preview, LOKI_CONTROL=1)'
223
274
  'workspace:Multi-project workspaces (preview, LOKI_WORKSPACES=1)'
224
275
  'backlog:Run every matching open issue, N in parallel'
@@ -275,6 +326,10 @@ function _loki_start {
275
326
  '--yes[Skip confirmation prompts]' \
276
327
  '-y[Skip confirmation prompts]' \
277
328
  '--budget[Cost budget limit in USD]:amount:' \
329
+ '--model[Model or route override]:model:' \
330
+ '--max-cost[Spend cap in USD]:amount:' \
331
+ '--no-pr[Build and verify without opening a pull request]' \
332
+ '--explain-route[Print the route without running]' \
278
333
  '--max-iterations[Max iterations]:number:' \
279
334
  '--attempts[Independent attempts in worktrees, 1-5]:number:(1 2 3 4 5)' \
280
335
  '*:spec file:_loki_spec_files'
@@ -5,7 +5,7 @@ _loki_completion() {
5
5
  _init_completion || return
6
6
 
7
7
  # Main subcommands (must match autonomy/loki main case statement)
8
- local main_commands="start backlog quick monitor demo tour welcome init stop pause resume steer status next ship dashboard web serve api sandbox notify import github issue intent config provider reset memory compound checkpoint council dogfood projects enterprise secrets cockpit secure own handoff doctor watchdog audit metrics syslog onboard share proof receipt outcomes explain plan report cost estimate kpis stats test ci watch telemetry agent context ctx code run export review optimize heal modernize migrate cluster worktree wt trigger failover remote deploy docker mcp magic assets analyze compliance crash control workspace open otel preview quickstart rc rollback merge self-update sentrux setup-skill spec state template trust trust-metrics ultracode update verify voice why wiki bench cleanup logs grill docs cp version completions help keys answer queue issues undo acp verify-pr"
8
+ local main_commands="start backlog quick monitor demo tour welcome init stop pause resume steer status next ship dashboard web serve api sandbox notify import github issue intent config provider reset memory compound checkpoint council dogfood projects enterprise secrets cockpit secure own handoff doctor watchdog audit metrics syslog onboard share proof receipt outcomes explain plan report cost estimate kpis stats test ci watch telemetry agent context ctx code run export review optimize heal modernize migrate cluster worktree wt trigger failover remote deploy docker mcp magic assets analyze compliance crash control workspace open otel preview quickstart rc rollback merge self-update sentrux setup-skill spec state template trust trust-metrics ultracode update verify voice why wiki bench cleanup logs grill docs cp version completions help keys answer queue issues undo acp verify-pr chat route edit setup models agents diff"
9
9
 
10
10
  # 1. If we are on the first argument (subcommand)
11
11
  if [[ $cword -eq 1 ]]; then
@@ -27,7 +27,7 @@ _loki_completion() {
27
27
 
28
28
  # If the word starts with a dash, show flags
29
29
  if [[ "$cur" == -* ]]; then
30
- local flags="--provider --max-iterations --parallel --background --bg --simple --complex --github --no-dashboard --sandbox --skip-memory --spec --spec-first --yes --budget --attempts --help"
30
+ local flags="--provider --max-iterations --parallel --background --bg --simple --complex --github --no-dashboard --sandbox --skip-memory --spec --spec-first --yes --budget --attempts --model --isolation --max-cost --no-pr --explain-route --help"
31
31
  COMPREPLY=( $(compgen -W "${flags}" -- "$cur") )
32
32
  return 0
33
33
  fi
@@ -125,7 +125,53 @@ _loki_completion() {
125
125
 
126
126
  doctor)
127
127
  if [[ "$cur" == -* ]]; then
128
- COMPREPLY=( $(compgen -W "--json --help" -- "$cur") )
128
+ COMPREPLY=( $(compgen -W "--json --fix --help" -- "$cur") )
129
+ return 0
130
+ fi
131
+ ;;
132
+
133
+ chat)
134
+ if [[ "$cur" == -* ]]; then
135
+ COMPREPLY=( $(compgen -W "--attach --tui --help" -- "$cur") )
136
+ return 0
137
+ fi
138
+ ;;
139
+
140
+ agents)
141
+ if [[ $cword -eq 2 ]]; then
142
+ COMPREPLY=( $(compgen -W "list new show export" -- "$cur") )
143
+ elif [[ "$cur" == -* ]]; then
144
+ COMPREPLY=( $(compgen -W "--claude --user --help" -- "$cur") )
145
+ fi
146
+ return 0
147
+ ;;
148
+
149
+ models)
150
+ if [[ "$cur" == -* ]]; then
151
+ COMPREPLY=( $(compgen -W "--local --json --help" -- "$cur") )
152
+ return 0
153
+ fi
154
+ ;;
155
+
156
+ setup)
157
+ if [[ "$cur" == -* ]]; then
158
+ COMPREPLY=( $(compgen -W "--yes --check --help" -- "$cur") )
159
+ return 0
160
+ fi
161
+ ;;
162
+
163
+ route)
164
+ if [[ $cword -eq 2 ]]; then
165
+ COMPREPLY=( $(compgen -W "start quick" -- "$cur") )
166
+ elif [[ "$cur" == -* ]]; then
167
+ COMPREPLY=( $(compgen -W "--json --provider --model --no-pr --max-cost --help" -- "$cur") )
168
+ fi
169
+ return 0
170
+ ;;
171
+
172
+ edit)
173
+ if [[ "$cur" == -* ]]; then
174
+ COMPREPLY=( $(compgen -W "--verify --commit --dry-run --help" -- "$cur") )
129
175
  return 0
130
176
  fi
131
177
  ;;
@@ -7,7 +7,7 @@ Modules:
7
7
  control: Session control API (start/stop/pause/resume)
8
8
  """
9
9
 
10
- __version__ = "11.3.9"
10
+ __version__ = "11.4.2"
11
11
 
12
12
  # Expose the control app for easy import
13
13
  try:
@@ -0,0 +1,112 @@
1
+ # Core verbs (CLI reference)
2
+
3
+ The commands most people use, with their main flags. The complete generated
4
+ command table is `docs/CLI-REFERENCE.md` (do not edit that file by hand).
5
+ `loki help` prints the grouped summary; `loki help all` prints every command;
6
+ `loki help <topic>` prints a topic (start, models, providers, agents, verify,
7
+ exit-codes, config); `loki help <command>` runs `<command> --help`. Scripts that
8
+ parse the old default `loki help` output must switch to `loki help all`.
9
+
10
+ `loki start` is the primary path. Everything else is a shortcut, a check, or an
11
+ alternative surface for the same engine. Claude Code is the default Tier-1
12
+ provider; other providers and model routes are additions selected with
13
+ `--provider` or `LOKI_MODEL_ROUTE`.
14
+
15
+ ## Start
16
+
17
+ | Command | What it does |
18
+ | --- | --- |
19
+ | `loki start [SPEC]` | The primary path. Build from a PRD file, an issue (`owner/repo#N`, issue URL, `PROJ-1`), a quoted task or a one-word brief. Alias: `run`. Shorthand: `loki "<task>"`, `loki owner/repo#N` |
20
+ | `loki edit "<change>"` | One targeted change to the current repo in one pass. No PRD, plan, council, PR or branch switch |
21
+ | `loki quick "<task>"` | One small task with a verify loop, no PR |
22
+ | `loki chat` | Interactive alternative to `loki start` (Plan and Build modes, slash commands) |
23
+
24
+ `start` flags: `--no-pr`, `--deep`, `--provider NAME`, `--max-cost USD`
25
+ (aliases `--budget`, `--budget-limit`), `--session-model TIER`, `-v` (verbose),
26
+ `--quiet`, `--json`, `--engine legacy|engine10`, `--explain-route`. Flags that
27
+ only the previous loop honors (`--simple`, `--complex`, `--parallel`,
28
+ `--isolation`, `--sandbox`, `--max-iterations`, `--compliance`, ...) send that
29
+ one call to the previous loop with a one-line notice.
30
+
31
+ Spend cap: `--max-cost`, else `budgets.per_run` in `loki.yaml`, else $100 when
32
+ `ANTHROPIC_API_KEY` or `OPENAI_API_KEY` is set, else no dollar cap
33
+ (subscription). Model routes: `LOKI_MODEL_ROUTE=ollama/qwen3-coder loki start prd.md`.
34
+
35
+ ### loki edit
36
+
37
+ `loki edit [paths...] "<change>"` with `--verify` (fast verifier), `--receipt`
38
+ (unsigned receipt in `.loki/edit-receipts/`), `--commit` (only touched files, by
39
+ name; skipped when verify failed) and `--dry-run` (plan only). `LOKI_EDIT_MODEL`
40
+ overrides the model. Claude provider only for now.
41
+
42
+ ### loki chat
43
+
44
+ Needs a TTY (otherwise exit 2; use `loki quick`). Starts in Plan mode
45
+ (read-only); `/plan` and `/build` switch. Slash commands: `/plan`, `/build`,
46
+ `/run <prd|brief>` (starts a normal `loki start` run with the chat's model and
47
+ provider), `/quick`, `/edit`, `/verify`, `/receipt`, `/cost`, `/diff`, `/undo`,
48
+ `/model <id>`, `/provider <name>`, `/help`, `/exit`. `loki chat --attach` joins a
49
+ running or the last `loki start` session (`/status`, `/steer`, `/diff`,
50
+ `/verify`, `/receipt`, `/stop`). `loki chat --tui` launches the Claude Code TUI
51
+ with Loki context. Bare `loki` does not open chat.
52
+
53
+ ## Check
54
+
55
+ | Command | What it does |
56
+ | --- | --- |
57
+ | `loki status [--json]` | Current run status |
58
+ | `loki verify [--fast] [--json] [--pubkey FILE]` | Deterministic verification with CI-gate exit codes |
59
+ | `loki receipt` (alias of `proof`) | Inspect the proof-of-run receipt |
60
+ | `loki diff` / `loki undo <run> [--plan]` | Show what a run changed; plan or apply an undo |
61
+ | `loki route [start\|quick] <args> [--json]` | Print the engine, provider, model, input type and reason without running |
62
+
63
+ Every run ends with one unified summary on both engines: `Result:`, `Files:`,
64
+ `Cost:` (marked `(estimated)` or `not measured`), `Elapsed:`, `Receipt:` and a
65
+ `next:` line. `--quiet` prints only that block; `--json` adds a `summary`
66
+ object; `NO_COLOR=1` disables color.
67
+
68
+ ## Configure
69
+
70
+ | Command | What it does |
71
+ | --- | --- |
72
+ | `loki setup [--yes] [--check]` | First-run wizard: tools, Claude login, provider, model route, spend cap. Flags: `--provider`, `--model`, `--budget USD`, `--global` |
73
+ | `loki doctor [--fix] [--json]` | Check prerequisites, providers and login. `--fix` creates state dirs and a default config and prints exact commands for the rest; never runs sudo |
74
+ | `loki config list\|get\|set\|path\|show\|validate` | Settings; `config list --json` for machines |
75
+ | `loki models [--local] [--json]` | Model routes (openrouter, ollama, lmstudio, llamacpp, vllm, custom); `--local` probes local runtimes and prints ready-to-paste values |
76
+ | `loki agents list\|new\|show\|export --claude` | Custom child agents in `.loki/agents/*.md` (project) or `~/.config/loki/agents/` (user). `loki agent` (singular) is the unchanged built-in agent-type command |
77
+ | `loki provider list\|set NAME` | Providers and install status |
78
+
79
+ ## --json
80
+
81
+ `status`, `doctor`, `verify`, `config list` and `models` accept `--json`.
82
+ `status`, `doctor` and `models` emit native JSON. `verify` and `config list`
83
+ emit one object from the shared helper `autonomy/lib/json-output.sh`:
84
+
85
+ ```json
86
+ {"command": "verify", "exit_code": 0, "ok": true, "output": "..."}
87
+ ```
88
+
89
+ The process exit code equals `exit_code`.
90
+
91
+ ## Exit codes
92
+
93
+ | Code | Meaning |
94
+ | --- | --- |
95
+ | 0 | Success |
96
+ | 1 | Failure |
97
+ | 2 | Usage error for an unknown command, or setup error |
98
+ | 3 | Missing component, or verifier error |
99
+ | 64 | Usage error for `verify`, `quick` and `start` (unknown option, missing task) |
100
+
101
+ Severity rises with the code. `loki verify` exits 0 VERIFIED, 1 CONCERNS, 2
102
+ BLOCKED or not a git directory, 3 verifier error or empty diff, 64 usage error.
103
+ Gate CI with `loki verify || fail` and treat any code of 2 or higher as worse
104
+ than CONCERNS. From 11.4.0 this is a breaking change for scripts that tested
105
+ `rc == 1` on an empty diff or a non-git directory. Per-command detail:
106
+ `docs/exit-codes.md`.
107
+
108
+ ## Unknown commands
109
+
110
+ An unknown command prints a "Did you mean" suggestion (edit distance), points
111
+ to `loki help` and `loki help all`, and exits 2. A bare one-word `loki <word>`
112
+ is the command namespace; use `loki start <word>` for a one-word brief.
@@ -1,6 +1,6 @@
1
1
  # CLI reference
2
2
 
3
- Generated from `loki-ts/src/cli/registry.ts` by `scripts/generate-stale-zero.sh` for v11.3.9. Do not edit by hand.
3
+ Generated from `loki-ts/src/cli/registry.ts` by `scripts/generate-stale-zero.sh` for v11.4.2. Do not edit by hand.
4
4
  Hidden and legacy-only commands are omitted; see `docs/v10/CLI-MODERN.md` for the full inventory.
5
5
 
6
6
  | Command | Description |
@@ -74,6 +74,11 @@ Hidden and legacy-only commands are omitted; see `docs/v10/CLI-MODERN.md` for th
74
74
  | `loki engine10 dashboard` | v10 dashboard |
75
75
  | `loki engine10 modernize` | v10 modernize |
76
76
  | `loki help` | Show help |
77
+ | `loki chat` | Interactive chat with the active provider |
78
+ | `loki edit` | Make one small scoped edit |
79
+ | `loki diff` | Show what the last run changed |
80
+ | `loki models` | Show per-provider model routes |
81
+ | `loki setup` | Guided first-run setup wizard |
77
82
  | `loki quick` | One small task |
78
83
  | `loki quickstart` | Guided first build |
79
84
  | `loki init` | Scaffold from a template |
@@ -90,6 +95,7 @@ Hidden and legacy-only commands are omitted; see `docs/v10/CLI-MODERN.md` for th
90
95
  | `loki dashboard open` | Open in browser |
91
96
  | `loki config` | Manage configuration |
92
97
  | `loki config show` | Show config |
98
+ | `loki config list` | List config (alias of show) |
93
99
  | `loki config init` | Create config |
94
100
  | `loki config edit` | Edit config |
95
101
  | `loki config path` | Print config path |
@@ -0,0 +1,94 @@
1
+ # Loki Mode and opencode: an honest comparison
2
+
3
+ opencode is a general-purpose interactive coding agent. Loki is an autonomous
4
+ delivery system that works from a task to a verified, receipted result.
5
+ They overlap in the terminal and differ in intent, so this page scores them
6
+ category by category and says where opencode is ahead. It describes opencode
7
+ from its public behavior as of this writing; check its docs for current detail.
8
+ Loki can also drive opencode as a provider (`loki start --provider opencode`).
9
+
10
+ ## Summary
11
+
12
+ | Category | Loki Mode (11.4.0) | opencode | Edge |
13
+ |---|---|---|---|
14
+ | Everyday UX | `loki start` with one unified summary; `loki chat` for interactive use | Polished TUI as the main surface | opencode for interactive feel; Loki for hands-off runs |
15
+ | Install and onboarding | npm install, `loki setup`, `loki doctor --fix`; needs Node, Python, git, jq, curl and a model | Single binary or npm, provider login flow | opencode lighter; Loki now guided |
16
+ | Learning curve | Few core verbs (`loki help`), one route for every input, `loki route` explains it | Learn one TUI | Roughly even |
17
+ | Interactive coding | `loki chat`: Plan/Build modes, slash commands, `--attach` | Full TUI with sessions and rich editing flow | opencode |
18
+ | Small changes | `loki edit` (one pass, diff, opt-in verify and receipt) | Prompt in the TUI or `opencode run` | Even |
19
+ | Provider flexibility | Claude default; codex, cline, aider, opencode; OpenRouter and local routes | Very wide provider catalog, first-class | opencode |
20
+ | Local models | `loki models --local`, `LOKI_MODEL_ROUTE=ollama/...`, lmstudio, llamacpp, vllm, custom URL | Local providers via config | Even |
21
+ | Multi-agent | Role agents, council review, custom agents in `.loki/agents/*.md`, export to Claude Code subagents | Configurable agents and subagents | Even; Loki adds council |
22
+ | Docs consistency | One routing story, one cap rule, generated CLI table | Single product surface | Even |
23
+ | Predictability | Order-independent routing, documented exit-code contract, spend cap | Interactive, user-driven | Loki for unattended use |
24
+
25
+ ## Per category
26
+
27
+ **Everyday UX.** In opencode you work inside one TUI and watch each step. In
28
+ Loki you hand over a task with `loki start` and read one summary at the end:
29
+ Result, Files, Cost, Elapsed, Receipt and a `next:` command. If you want to
30
+ watch and steer, `loki chat --attach` joins the run. opencode's interactive
31
+ experience is more mature.
32
+
33
+ **Install and onboarding.** opencode installs as one tool and logs in to a
34
+ provider. Loki needs Node.js 18+, Python 3.8+, git, jq, curl and a model:
35
+ Claude Code is the default and needed for the default path; other CLIs are
36
+ optional. `loki setup` walks through it and `loki doctor --fix` repairs state
37
+ safely, printing exact commands for the rest. More prerequisites than opencode.
38
+
39
+ **Learning curve.** `loki help` shows grouped core verbs (Start, Check,
40
+ Configure); `loki help all` and `loki help <topic>` go deeper. Flag order and
41
+ input form never change the engine, and `loki route` or `--explain-route`
42
+ prints the engine, provider, model and reason. Unknown commands suggest the
43
+ nearest match and exit 2.
44
+
45
+ **Interactive coding.** `loki chat` has Plan mode (read-only for Claude) and
46
+ Build mode, slash commands (`/run`, `/quick`, `/edit`, `/verify`, `/receipt`,
47
+ `/diff`, `/undo`, `/model`, `/provider`) and `--tui` for the Claude Code TUI.
48
+ It is newer and smaller than opencode's TUI. Its advantage is the handoff: `/run`
49
+ starts a real `loki start` run and `--attach` joins one in progress.
50
+
51
+ **Small changes.** `loki edit "<change>"` is one pass with no plan, council or
52
+ PR, then diff stat, diff, cost and time. `--verify`, `--receipt`, `--commit`
53
+ and `--dry-run` are opt-in. Claude provider only for now.
54
+
55
+ **Provider flexibility.** opencode has the broader provider catalog. Loki's
56
+ Tier-1 provider is Claude Code; codex, cline, aider and opencode are optional.
57
+ On those, the Loki 10 engine now measures cost (parsed or estimated, flagged
58
+ `estimated`) so `--max-cost` applies, and enforces the wall-clock limit,
59
+ `BUDGET_LIMIT` kill and a post-iteration guard scan. Kill blocking is still
60
+ Claude-only and receipts say so (`kill blocking not enforced`).
61
+
62
+ **Local models.** `loki models --local` probes Ollama, LM Studio, llama.cpp and
63
+ vLLM and prints ready-to-paste values. `LOKI_MODEL_ROUTE=<kind>/<id>` runs a
64
+ local or OpenRouter model through the Claude harness, so Loki's controls still
65
+ apply. Small local models can fail tool use; that limit is the model's.
66
+
67
+ **Multi-agent.** Loki has built-in roles and a council. You can add your own
68
+ as markdown with frontmatter (model, provider, tools, deny, permission) in
69
+ `.loki/agents/`, manage them with `loki agents list|new|show|export --claude`,
70
+ and council reviewers use a matching agent automatically.
71
+
72
+ **Docs consistency.** The prerequisites, the spend cap ($100 with an API key,
73
+ none on a subscription), routing and the provider table are stated once and
74
+ match the code on this branch.
75
+
76
+ **Predictability.** One execution path for every input form, a documented
77
+ exit-code contract (`loki verify` 0 to 3, usage errors 64) and a spend cap
78
+ that applies on every engine10 provider.
79
+
80
+ ## What Loki adds
81
+
82
+ - **Autonomy.** A task, PRD or issue goes to a pull request without turn-by-turn
83
+ prompting, with a stop-and-ask when the contract cannot be met.
84
+ - **Receipts.** A signed receipt per run that `loki verify` re-checks and that
85
+ lists what was NOT PROVEN.
86
+ - **Verification.** Checks written from the task before code, a deterministic
87
+ `loki verify` for CI, and test-weakening detection.
88
+ - **Council.** Specialist review selected from the changed files and diff.
89
+
90
+ ## When to pick which
91
+
92
+ Pick opencode for hands-on interactive coding across many providers. Pick Loki
93
+ when you want to delegate a task and get back a verified, receipted result, or
94
+ to gate CI on `loki verify`. They compose: run opencode as a Loki provider.
@@ -166,6 +166,7 @@ capability degradation.
166
166
  - `cline.sh` - Cline (Tier 2: reduced parallelism).
167
167
  - `codex.sh` - OpenAI Codex CLI (Tier 3: degraded, sequential).
168
168
  - `aider.sh` - Aider (Tier 3: degraded).
169
+ - Non-Claude engine10 sessions run under `loki-ts/src/providers/provider_guard.ts` (timeout, budget stop, post-iteration diff scan with revert).
169
170
  - `loader.sh` - Provider loader utility.
170
171
  - `models.sh`, `model_catalog.json` - Model name registry and catalog.
171
172
  - `managed.py` - Managed provider client.
@@ -2,9 +2,9 @@
2
2
 
3
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.9
5
+ **Version:** v11.4.2
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 older engine, which is being removed; prefer `loki owner/repo#N`. See the [user guide](v10/GUIDE.md).
7
+ **Engine note:** `loki start` is the primary command. `loki start`, `loki "<task>"`, `loki owner/repo#N` and `loki quick` all run the Loki 10 engine, whatever the flag order or input form (PRD file, issue ref, task or one-word brief). The previous loop runs only on `--engine legacy`, `LOKI_ENGINE=legacy`, or for one call when a flag Loki 10 cannot honor is present. See the [user guide](v10/GUIDE.md) and the [5-minute quickstart](QUICKSTART.md).
8
8
 
9
9
  ---
10
10
 
@@ -51,19 +51,52 @@ loki --version # prints the installed version
51
51
  loki doctor # checks providers, Bun, skill links and prerequisites
52
52
  ```
53
53
 
54
- You need at least one provider CLI. Claude Code (`claude`) is the default and the only one with every feature.
54
+ ## Prerequisites
55
+
56
+ Required (`loki doctor` fails without them):
57
+
58
+ | Tool | Minimum |
59
+ |------|---------|
60
+ | Node.js | 18 (20+ recommended, 22 LTS is the CI target) |
61
+ | Python 3 | 3.8 |
62
+ | git | any recent version |
63
+ | jq | any |
64
+ | curl | any |
65
+
66
+ Plus a way to reach a model. Claude Code (`claude`) is the default provider and the only one with every feature, so the default path needs it installed and logged in: `npm install -g @anthropic-ai/claude-code`, then `claude auth login`. The bundled Claude Agent SDK with `ANTHROPIC_API_KEY` can stand in for the CLI on the engine10 path. `loki edit` and `loki chat` call the `claude` CLI directly. Every other provider CLI (`codex`, `cline`, `aider`, `opencode`) is optional.
67
+
68
+ Optional: Bun 1.3+ (bundled by the npm package), bash 4+ (recommended), Ollama or an OpenRouter key for non-Claude model routes.
69
+
70
+ One command checks and configures all of this:
71
+
72
+ ```bash
73
+ loki setup # wizard: tools, Claude login, provider, model route, spend cap
74
+ loki setup --yes # non-interactive, accept defaults
75
+ loki setup --check # report only
76
+ loki doctor --fix # apply safe fixes; prints exact commands for the rest
77
+ loki config list # show settings; also: loki config get|set|path
78
+ loki doctor --json # machine-readable
79
+ ```
80
+
81
+ `loki doctor --fix` creates state directories and a default config. It never installs system packages or runs sudo; it prints those commands instead.
55
82
 
56
83
  ---
57
84
 
58
85
  ## First run
59
86
 
60
87
  ```bash
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
88
+ loki setup # first-run wizard
89
+ loki start "add a /health route" # the primary path: build, verify, seal a receipt
90
+ loki start prd.md # same, from a PRD file
91
+ loki start owner/repo#42 # same, from a GitHub, GitLab or Jira issue
92
+ loki edit "rename fooBar to foo_bar" # one small change, no loop
93
+ loki chat # interactive alternative (Plan/Build modes)
94
+ loki welcome # what Loki is and what to do next
95
+ loki quickstart # guided first build: setup check, idea, template, plan, go
65
96
  ```
66
97
 
98
+ The shorter forms `loki "<task>"` and `loki owner/repo#42` run the same engine. The spend cap defaults to $100 when `ANTHROPIC_API_KEY` or `OPENAI_API_KEY` is set and to no dollar cap on a subscription login; change it with `--max-cost <usd>`, `budgets.per_run` in `loki.yaml`, or `loki setup --budget`. A quick walkthrough is in [QUICKSTART.md](QUICKSTART.md).
99
+
67
100
  `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.
68
101
 
69
102
  Every finished run leaves a receipt. Check a branch the same way CI does:
@@ -93,14 +126,25 @@ See [control-plane-migration.md](control-plane-migration.md) and [control-plane-
93
126
 
94
127
  | Provider | Notes |
95
128
  |----------|-------|
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`. |
129
+ | `claude` | Default (Tier 1). Full feature set. |
130
+ | `cline` | Full feature set; small local models may fail tool use. Engine10 cost parsed or estimated, guardrail scan. |
131
+ | `codex` | Sequential only. Engine10 cost parsed or estimated, guardrail scan, `--sandbox workspace-write`. |
132
+ | `aider` | Sequential only; `ollama_chat/<model>` works for local models. Engine10 cost reported or estimated, guardrail scan, `--no-auto-commits`. |
133
+ | `opencode` | Sequential only. Supported in engine10 (`--provider opencode`); cost not measured. Install with `npm install -g opencode-ai`; model via `LOKI_OPENCODE_MODEL=provider/model`. |
101
134
 
102
135
  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.
103
136
 
137
+ ### Model routes and local models
138
+
139
+ Run OpenRouter or a local model through the Claude harness with `LOKI_MODEL_ROUTE=<kind>/<id>`, where kind is `openrouter`, `ollama`, `lmstudio`, `llamacpp`, `vllm` or `custom` (custom needs `LOKI_MODEL_BASE_URL`):
140
+
141
+ ```bash
142
+ loki models --local # discover local models, print ready-to-paste values
143
+ LOKI_MODEL_ROUTE=ollama/qwen3-coder loki start prd.md
144
+ ```
145
+
146
+ OpenRouter reads `OPENROUTER_API_KEY`. The route applies to the Claude child process only and every Loki control (cost, kill blocking, receipts) still applies. Details: [user guide](v10/GUIDE.md).
147
+
104
148
  ---
105
149
 
106
150
  ## Configuration
@@ -2,16 +2,6 @@
2
2
 
3
3
  Issues in the current release that are known and not yet fixed. Report new ones with `loki crash` or at https://github.com/asklokesh/loki-mode/issues.
4
4
 
5
- ## `loki verify` exit codes differ from the target table in three cases
5
+ ## Which engine runs
6
6
 
7
- | Input | Command | Exit today | Target |
8
- |---|---|---|---|
9
- | Empty diff (a git repo with no changes vs base) | `loki verify` | 1 (CONCERNS) | 3 |
10
- | Not a git directory | `loki verify` | 1 (CONCERNS) | 2 |
11
- | Unknown flag | `loki verify` with a flag it does not know | 3 | 64 |
12
-
13
- Changing these is a breaking change for CI gates, so it waits for a planned release. Details: [exit-codes.md](exit-codes.md#known-gaps).
14
-
15
- ## `loki start` uses the older engine
16
-
17
- `loki "<task>"`, `loki owner/repo#N` and `loki quick` run the Loki 10 engine. `loki start ./prd.md` still routes to the older engine, which is being removed. Prefer `loki owner/repo#N` or `loki "<task>"`.
7
+ From 11.4.0, `loki start`, `loki "<task>"`, `loki owner/repo#N` and `loki quick` run the Loki 10 engine whatever the flag order or input form. The previous loop runs only on `--engine legacy`, `LOKI_ENGINE=legacy`, or for one call when a flag Loki 10 cannot honor is present (`--simple`, `--parallel`, `--sandbox`, ...). Check with `loki route start <args>`.
@@ -0,0 +1,108 @@
1
+ # Quickstart (5 minutes)
2
+
3
+ `loki start` is the primary path. This page gets you from install to a
4
+ verified result, then shows the interactive alternative and the small-change
5
+ path.
6
+
7
+ ## 1. Install
8
+
9
+ ```bash
10
+ npm install -g loki-mode
11
+ ```
12
+
13
+ You need Node.js 18+ (20+ recommended), Python 3.8+, git, jq and curl. Claude
14
+ Code (`claude`) is the default provider and is needed for the default path:
15
+
16
+ ```bash
17
+ npm install -g @anthropic-ai/claude-code
18
+ claude auth login
19
+ ```
20
+
21
+ Other coding CLIs (codex, cline, aider, opencode) are optional. Full list:
22
+ [INSTALLATION.md](INSTALLATION.md).
23
+
24
+ ## 2. Set up
25
+
26
+ ```bash
27
+ cd your-repo
28
+ loki setup # checks tools, Claude login, provider, model route, spend cap
29
+ ```
30
+
31
+ `loki setup --yes` accepts defaults. `loki doctor --fix` creates state
32
+ directories and a default config and prints exact commands for anything
33
+ missing; it never runs sudo.
34
+
35
+ ## 3. Run
36
+
37
+ ```bash
38
+ loki start "add rate limiting to /api/login"
39
+ ```
40
+
41
+ Also accepted: `loki start prd.md`, `loki start owner/repo#123`, and a
42
+ one-word brief as `loki start <word>`. Add `--no-pr` to skip the pull request.
43
+ Preview the route first with `loki route start prd.md`.
44
+
45
+ The spend cap defaults to $100 when `ANTHROPIC_API_KEY` or `OPENAI_API_KEY` is
46
+ set, and to no dollar cap on a subscription login. Change it with
47
+ `--max-cost <usd>`.
48
+
49
+ ## 4. Read the summary
50
+
51
+ Every run ends with one block:
52
+
53
+ ```
54
+ Result: verified
55
+ Files: 3 changed (+42 -5)
56
+ Cost: $0.42
57
+ Elapsed: 4m12s
58
+ Receipt: .loki/runs/<run-id>/receipt.json
59
+ next: loki diff
60
+ ```
61
+
62
+ `Cost` reads `(estimated)` when the provider did not report it and `not
63
+ measured` when unknown. The `next:` line names the one command to run now.
64
+ `loki verify` re-checks the receipt; `loki undo` reverts the run. Exit codes
65
+ are in [exit-codes.md](exit-codes.md): usage errors are 64, and a CI gate
66
+ should be `loki verify || fail`.
67
+
68
+ ## 5. Talk to a run: loki chat --attach
69
+
70
+ ```bash
71
+ loki chat --attach # joins the running or last `loki start` session
72
+ ```
73
+
74
+ Inside: `/status`, `/steer <text>`, `/diff`, `/verify`, `/receipt`, `/stop`.
75
+ `loki chat` on its own is the interactive alternative: it starts in Plan mode
76
+ (read-only), `/build` allows edits, and `/run <brief>` starts a normal
77
+ `loki start` run with the chat's model and provider. Bare `loki` does not open
78
+ chat.
79
+
80
+ ## 6. Small changes: loki edit
81
+
82
+ ```bash
83
+ loki edit "rename fooBar to foo_bar"
84
+ loki edit src/foo.ts "rename X to Y"
85
+ loki edit --verify --commit src/a.ts "add null checks"
86
+ ```
87
+
88
+ One pass, no plan, council or PR. It prints the diff and one line with cost and
89
+ time. Use `loki quick "<task>"` when you want a verify loop.
90
+
91
+ ## 7. Local and other models
92
+
93
+ ```bash
94
+ loki models --local # finds Ollama, LM Studio, llama.cpp, vLLM
95
+ LOKI_MODEL_ROUTE=ollama/qwen3-coder loki start prd.md
96
+ LOKI_MODEL_ROUTE=openrouter/deepseek/deepseek-v3.2 loki start prd.md # needs OPENROUTER_API_KEY
97
+ loki start --provider codex prd.md # another coding CLI
98
+ ```
99
+
100
+ Routes: `openrouter`, `ollama`, `lmstudio`, `llamacpp`, `vllm`, and `custom`
101
+ (set `LOKI_MODEL_BASE_URL`). They run through the Claude harness, so cost,
102
+ kill blocking and receipts still apply.
103
+
104
+ ## Next
105
+
106
+ [User guide](v10/GUIDE.md), [core verbs](CLI-CORE-VERBS.md),
107
+ [custom agents](v10/GUIDE.md#custom-agents), [comparison with
108
+ opencode](COMPARE-OPENCODE.md).