lcode-cli 0.15.0__tar.gz → 0.17.0__tar.gz

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 (134) hide show
  1. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/CHANGELOG.md +37 -1
  2. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/PKG-INFO +7 -4
  3. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/README.md +6 -3
  4. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/bench.md +6 -0
  5. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/commands.md +2 -1
  6. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/configuration.md +6 -1
  7. lcode_cli-0.17.0/docs/git.md +98 -0
  8. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/installation.md +5 -0
  9. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/quickstart.md +1 -1
  10. lcode_cli-0.17.0/docs/servers.md +136 -0
  11. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/usage.md +4 -0
  12. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/mkdocs.yml +2 -0
  13. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/pyproject.toml +2 -0
  14. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/__init__.py +1 -1
  15. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/agent.py +13 -2
  16. lcode_cli-0.17.0/src/lcode/backends.py +430 -0
  17. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/bench.py +10 -5
  18. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/cli.py +108 -18
  19. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/codesearch.py +6 -1
  20. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/config.py +17 -0
  21. lcode_cli-0.17.0/src/lcode/gitflow.py +640 -0
  22. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/ollama.py +6 -0
  23. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/repl.py +50 -5
  24. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/tools.py +6 -0
  25. lcode_cli-0.17.0/tests/test_backends.py +340 -0
  26. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_extensions.py +3 -3
  27. lcode_cli-0.17.0/tests/test_gitflow.py +260 -0
  28. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/.editorconfig +0 -0
  29. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/.github/CODEOWNERS +0 -0
  30. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  31. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  32. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  33. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/.github/ISSUE_TEMPLATE/model_request.yml +0 -0
  34. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  35. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/.github/dependabot.yml +0 -0
  36. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/.github/workflows/ci.yml +0 -0
  37. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/.github/workflows/docs.yml +0 -0
  38. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/.github/workflows/release.yml +0 -0
  39. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/.gitignore +0 -0
  40. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/.pre-commit-config.yaml +0 -0
  41. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/AGENTS.md +0 -0
  42. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/CODE_OF_CONDUCT.md +0 -0
  43. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/CONTRIBUTING.md +0 -0
  44. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/LICENSE +0 -0
  45. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/SECURITY.md +0 -0
  46. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/agents.md +0 -0
  47. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/assets/demo.svg +0 -0
  48. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/assets/extra.css +0 -0
  49. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/assets/logo.svg +0 -0
  50. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/assets/social-preview.png +0 -0
  51. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/changelog.md +0 -0
  52. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/contributing.md +0 -0
  53. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/hooks.md +0 -0
  54. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/how-it-works.md +0 -0
  55. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/index.md +0 -0
  56. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/lsp.md +0 -0
  57. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/mcp.md +0 -0
  58. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/memory.md +0 -0
  59. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/models.md +0 -0
  60. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/sandbox.md +0 -0
  61. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/search.md +0 -0
  62. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/docs/troubleshooting.md +0 -0
  63. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/examples/README.md +0 -0
  64. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/examples/commands/review.md +0 -0
  65. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/examples/skills/commit-message/SKILL.md +0 -0
  66. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/examples/skills/commit-message/scripts/staged.sh +0 -0
  67. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/install.sh +0 -0
  68. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/overrides/main.html +0 -0
  69. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/scripts/record_demo.py +0 -0
  70. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/scripts/social-preview.html +0 -0
  71. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/__main__.py +0 -0
  72. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/bench_backend.py +0 -0
  73. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/catalog.py +0 -0
  74. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/checkpoints.py +0 -0
  75. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/context.py +0 -0
  76. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/extensions.py +0 -0
  77. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/frontmatter.py +0 -0
  78. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/hardware.py +0 -0
  79. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/hooks.py +0 -0
  80. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/limits.py +0 -0
  81. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/lsp.py +0 -0
  82. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/mcp/__init__.py +0 -0
  83. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/mcp/auth.py +0 -0
  84. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/mcp/catalog.py +0 -0
  85. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/mcp/catalog.toml +0 -0
  86. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/mcp/client.py +0 -0
  87. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/mcp/commands.py +0 -0
  88. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/mcp/config.py +0 -0
  89. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/mcp/http.py +0 -0
  90. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/mcp/manager.py +0 -0
  91. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/mcp/protocol.py +0 -0
  92. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/mcp/server.py +0 -0
  93. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/mcp/stdio.py +0 -0
  94. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/memory.py +0 -0
  95. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/models.toml +0 -0
  96. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/permissions.py +0 -0
  97. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/planning.py +0 -0
  98. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/render.py +0 -0
  99. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/repomap.py +0 -0
  100. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/sandbox.py +0 -0
  101. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/servers/__init__.py +0 -0
  102. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/servers/encord.py +0 -0
  103. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/servers/valohai.py +0 -0
  104. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/sessions.py +0 -0
  105. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/subagents.py +0 -0
  106. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/vision.py +0 -0
  107. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/src/lcode/web.py +0 -0
  108. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/conftest.py +0 -0
  109. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/fake_lsp_server.py +0 -0
  110. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/fake_mcp_server.py +0 -0
  111. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_agent.py +0 -0
  112. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_bench.py +0 -0
  113. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_catalog.py +0 -0
  114. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_checkpoints.py +0 -0
  115. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_cli.py +0 -0
  116. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_codesearch.py +0 -0
  117. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_config.py +0 -0
  118. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_context.py +0 -0
  119. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_context_picker.py +0 -0
  120. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_hooks.py +0 -0
  121. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_lsp.py +0 -0
  122. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_mcp.py +0 -0
  123. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_memory.py +0 -0
  124. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_permissions.py +0 -0
  125. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_plan_mode.py +0 -0
  126. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_repomap.py +0 -0
  127. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_sandbox.py +0 -0
  128. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_servers.py +0 -0
  129. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_sessions.py +0 -0
  130. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_subagents.py +0 -0
  131. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_tools.py +0 -0
  132. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_vision.py +0 -0
  133. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/tests/test_web.py +0 -0
  134. {lcode_cli-0.15.0 → lcode_cli-0.17.0}/uv.lock +0 -0
@@ -6,6 +6,40 @@ All notable changes to lcode are documented here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.17.0] - 2026-10-06
10
+
11
+ ### Added
12
+
13
+ - `/commit` writes a commit message in the repository's style, from the diff, the conversation
14
+ and recent commits, and commits once you approve it. It commits what you staged, or every
15
+ change except files the model thinks are unrelated and files that may hold secrets.
16
+ - `/review [base]` reviews the uncommitted changes, or the branch against a base, and reports
17
+ findings with `path:line`. The model can read but not change anything during a review.
18
+ - `/pr [base]` pushes the branch and opens a GitHub pull request with `gh` after you approve the
19
+ title and description; commits made on `main` itself go to a new branch.
20
+ - A command of your own called `commit`, `review` or `pr` replaces the built-in one.
21
+ - `lcode --worktree [NAME]` (`-w`) runs the session in a git worktree on its own branch, so
22
+ several sessions can work on one repository at once. It's removed at the end if nothing
23
+ changed. See [Git workflow](https://nasser1941.github.io/lcode/git/).
24
+
25
+ ### Fixed
26
+
27
+ - With another model server, `/ctx` no longer says the model reloads: it changes how much of the
28
+ server's context window lcode uses.
29
+
30
+ ## [0.16.0] - 2026-10-05
31
+
32
+ ### Added
33
+
34
+ - Other model servers: LM Studio, llama.cpp's llama-server, vLLM, MLX's server, or any other
35
+ server with an OpenAI-compatible API, instead of Ollama. `lcode config set backend lmstudio` (or
36
+ `llama.cpp`, `vllm`, `mlx`, `openai` with `base_url`); a key can come from `LCODE_API_KEY`. Tool
37
+ calls, streaming, reasoning (on and off), images and structured answers work as with Ollama.
38
+ lcode reads the context window from the server, matches the model setting to the models it
39
+ serves, and moves thinking that a server sends as part of the answer out of it. `lcode doctor`,
40
+ `lcode models`, `lcode bench` and `lcode index` work with every backend. See
41
+ [Other model servers](https://nasser1941.github.io/lcode/servers/), with setup for each.
42
+
9
43
  ## [0.15.0] - 2026-10-05
10
44
 
11
45
  ### Added
@@ -385,7 +419,9 @@ First public release.
385
419
  - `AGENTS.md` project instructions and `/init` to generate them.
386
420
  - One-line installer for Linux and macOS.
387
421
 
388
- [Unreleased]: https://github.com/nasser1941/lcode/compare/v0.15.0...HEAD
422
+ [Unreleased]: https://github.com/nasser1941/lcode/compare/v0.17.0...HEAD
423
+ [0.17.0]: https://github.com/nasser1941/lcode/compare/v0.16.0...v0.17.0
424
+ [0.16.0]: https://github.com/nasser1941/lcode/compare/v0.15.0...v0.16.0
389
425
  [0.15.0]: https://github.com/nasser1941/lcode/compare/v0.14.0...v0.15.0
390
426
  [0.14.0]: https://github.com/nasser1941/lcode/compare/v0.13.0...v0.14.0
391
427
  [0.13.0]: https://github.com/nasser1941/lcode/compare/v0.12.0...v0.13.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: lcode-cli
3
- Version: 0.15.0
3
+ Version: 0.17.0
4
4
  Summary: A local-first terminal coding agent powered by open-weight models on your own GPU or Mac, via Ollama.
5
5
  Project-URL: Homepage, https://nasser1941.github.io/lcode/
6
6
  Project-URL: Documentation, https://nasser1941.github.io/lcode/
@@ -101,8 +101,11 @@ through [Ollama](https://ollama.com), and when it needs current information it c
101
101
  - **Remembers what matters.** Corrections, decisions and where things live carry over to the next
102
102
  session as short notes, saved by the model, by you (`/remember`) or by a quick check at the end
103
103
  of a session. Not whole conversations, and never secrets.
104
+ - **Git workflow.** `/commit` writes messages in your repository's style, `/review` checks the
105
+ changes with `file:line` findings, `/pr` opens the pull request, each after you approve it, and
106
+ `lcode --worktree` runs parallel sessions on one repository.
104
107
  - **Bring your own model.** Eight curated open-weight models, all tested end to end, or any Ollama model
105
- with tool calling.
108
+ with tool calling. Or use LM Studio, llama.cpp, vLLM or MLX instead of Ollama.
106
109
  - **MCP servers, ready to go.** Connect Jira and Confluence, GitHub, AWS, Google Drive, Grafana,
107
110
  Google Cloud, Sentry, Linear, Notion, Postgres, Kubernetes, Metabase, Encord, Valohai and more with one command
108
111
  (`lcode mcp add atlassian`), image generation with ComfyUI, or any other MCP server. Browser sign-in (OAuth) is built in.
@@ -208,8 +211,8 @@ fills up. Details: [How it works](https://nasser1941.github.io/lcode/how-it-work
208
211
 
209
212
  See the pinned [Roadmap issue](https://github.com/nasser1941/lcode/issues/10). Next up:
210
213
 
211
- - [More local backends: LM Studio, llama.cpp, vLLM and MLX](https://github.com/nasser1941/lcode/issues/47)
212
- - [Git workflow: /commit, /review, /pr and parallel worktrees](https://github.com/nasser1941/lcode/issues/50)
214
+ - [Automation: JSON output, a Python API and a GitHub Action for self-hosted runners](https://github.com/nasser1941/lcode/issues/48)
215
+ - [Editor integration through the Agent Client Protocol](https://github.com/nasser1941/lcode/issues/49)
213
216
  - More models in the catalog, and test reports from your hardware ([report one](https://github.com/nasser1941/lcode/issues/new?template=model_request.yml))
214
217
 
215
218
  ## Contributing
@@ -65,8 +65,11 @@ through [Ollama](https://ollama.com), and when it needs current information it c
65
65
  - **Remembers what matters.** Corrections, decisions and where things live carry over to the next
66
66
  session as short notes, saved by the model, by you (`/remember`) or by a quick check at the end
67
67
  of a session. Not whole conversations, and never secrets.
68
+ - **Git workflow.** `/commit` writes messages in your repository's style, `/review` checks the
69
+ changes with `file:line` findings, `/pr` opens the pull request, each after you approve it, and
70
+ `lcode --worktree` runs parallel sessions on one repository.
68
71
  - **Bring your own model.** Eight curated open-weight models, all tested end to end, or any Ollama model
69
- with tool calling.
72
+ with tool calling. Or use LM Studio, llama.cpp, vLLM or MLX instead of Ollama.
70
73
  - **MCP servers, ready to go.** Connect Jira and Confluence, GitHub, AWS, Google Drive, Grafana,
71
74
  Google Cloud, Sentry, Linear, Notion, Postgres, Kubernetes, Metabase, Encord, Valohai and more with one command
72
75
  (`lcode mcp add atlassian`), image generation with ComfyUI, or any other MCP server. Browser sign-in (OAuth) is built in.
@@ -172,8 +175,8 @@ fills up. Details: [How it works](https://nasser1941.github.io/lcode/how-it-work
172
175
 
173
176
  See the pinned [Roadmap issue](https://github.com/nasser1941/lcode/issues/10). Next up:
174
177
 
175
- - [More local backends: LM Studio, llama.cpp, vLLM and MLX](https://github.com/nasser1941/lcode/issues/47)
176
- - [Git workflow: /commit, /review, /pr and parallel worktrees](https://github.com/nasser1941/lcode/issues/50)
178
+ - [Automation: JSON output, a Python API and a GitHub Action for self-hosted runners](https://github.com/nasser1941/lcode/issues/48)
179
+ - [Editor integration through the Agent Client Protocol](https://github.com/nasser1941/lcode/issues/49)
177
180
  - More models in the catalog, and test reports from your hardware ([report one](https://github.com/nasser1941/lcode/issues/new?template=model_request.yml))
178
181
 
179
182
  ## Contributing
@@ -12,6 +12,10 @@ lcode bench --json results.json # also save machine-readable results
12
12
  lcode bench --markdown # also print a table to paste into a test report
13
13
  ```
14
14
 
15
+ `lcode bench` also runs against [other model servers](servers.md), such as llama-server or LM
16
+ Studio: `LCODE_BACKEND=llama.cpp lcode bench`. The server keeps the model loaded and doesn't report
17
+ its memory use, so those columns stay empty.
18
+
15
19
  ```text
16
20
  lcode bench · NVIDIA GeForce RTX 4080 Laptop GPU (12 GB VRAM), 31 GB RAM · Ollama 0.32.15
17
21
 
@@ -158,6 +162,7 @@ existing fields keep their meaning until `schema` changes.
158
162
  "schema": 1,
159
163
  "lcode": "0.3.1",
160
164
  "ollama": "0.32.15",
165
+ "server": "Ollama 0.32.15",
161
166
  "date": "2026-09-30T19:09:09+02:00",
162
167
  "hardware": {
163
168
  "os": "linux", "cpu": "13th Gen Intel(R) Core(TM) i9-13980HX", "ram_gib": 30.96,
@@ -197,6 +202,7 @@ existing fields keep their meaning until `schema` changes.
197
202
 
198
203
  | Field | Meaning |
199
204
  |---|---|
205
+ | `ollama`, `server` | The Ollama version, or `null` with [another model server](servers.md); `server` names the server either way |
200
206
  | `runs[].model` | The name you gave (catalog key or Ollama tag); `ollama_model` is the model that ran |
201
207
  | `runs[].context`, `num_batch`, `think` | The settings used. lcode lowers the batch size or context if the GPU runs out of memory, and reports what it ended up using |
202
208
  | `runs[].memory_gb`, `gpu_percent` | From Ollama's `/api/ps`; `null` if unavailable |
@@ -46,7 +46,8 @@ Report bugs first, with `path:line`, then missing tests. Don't change any files.
46
46
  | `~/.config/lcode/commands/<name>.md` | For every repository |
47
47
 
48
48
  The file name is the command's name. A repository's command overrides one of yours with the same
49
- name; built-in commands such as `/help` can't be replaced.
49
+ name. A command called `review`, `commit` or `pr` replaces lcode's [built-in one](git.md), so a team
50
+ can use its own checklist; other built-in commands such as `/help` can't be replaced.
50
51
 
51
52
  ## Skills
52
53
 
@@ -15,11 +15,13 @@ lcode config path # print the file location
15
15
 
16
16
  | Setting | Default | Meaning |
17
17
  |---|---|---|
18
- | `model` | `qwen3.6-35b` | Catalog key (see `lcode models`) or any installed Ollama model tag |
18
+ | `model` | `qwen3.6-35b` | Catalog key (see `lcode models`) or any installed Ollama model tag; with another [backend](servers.md), a model the server serves |
19
19
  | `context` | largest that fits | Context window in tokens; accepts `128k`, `1m` |
20
20
  | `num_batch` | 512 | Prompt batch size. Larger reads prompts faster but needs more GPU memory |
21
21
  | `keep_alive` | `30m` | How long Ollama keeps the model in memory after the last request |
22
22
  | `ollama_host` | `http://localhost:11434` | Ollama server URL |
23
+ | `backend` | `ollama` | The model server: `ollama`, `lmstudio`, `llama.cpp`, `vllm`, `mlx` or `openai` (any OpenAI-compatible API); see [Other model servers](servers.md) |
24
+ | `base_url` | the backend's | The server's OpenAI-compatible address, e.g. `http://localhost:1234/v1` |
23
25
  | `permission_mode` | `ask` | `ask`, `plan`, `auto-edit` or `yolo` |
24
26
  | `think` | `true` | Let the model reason before answering |
25
27
  | `web` | `on` | Web search and page fetching: `on`, `ask` (before each search/website) or `off` |
@@ -65,6 +67,9 @@ Environment variables override the file, which is useful for one-off runs and CI
65
67
  | `LCODE_NUM_BATCH` | `num_batch` |
66
68
  | `LCODE_KEEP_ALIVE` | `keep_alive` |
67
69
  | `OLLAMA_HOST` | `ollama_host` (same variable the Ollama CLI uses) |
70
+ | `LCODE_BACKEND` | `backend` |
71
+ | `LCODE_BASE_URL` | `base_url` |
72
+ | `LCODE_API_KEY` or `OPENAI_API_KEY` | API key for an [OpenAI-compatible server](servers.md) that needs one (never stored in the config file) |
68
73
  | `LCODE_WEB` | `web` |
69
74
  | `LCODE_SANDBOX` | `sandbox` |
70
75
  | `LCODE_MEMORY` | `memory` |
@@ -0,0 +1,98 @@
1
+ # Git workflow
2
+
3
+ The everyday git steps, without spelling them out each time:
4
+ - **`/commit`** writes a message in your repository's style;
5
+ - **`/review`** checks the changes before you commit or merge;
6
+ - **`/pr`** opens a pull request;
7
+ - **`lcode --worktree`** runs several sessions on one repository without them getting in each other's way.
8
+
9
+ lcode never commits, pushes or opens a pull request until you say yes, also in `yolo` mode.
10
+
11
+ ## /commit
12
+
13
+ ```text
14
+ ❯ /commit
15
+ ╭─ Commit message ───────────────────────────────────────────────╮
16
+ │ feat: add median() │
17
+ │ │
18
+ │ Add a median() function to stats.py and its tests. It raises │
19
+ │ ValueError on empty input, consistent with mean(). │
20
+ ╰────────────────────────────────────────────────────────────────╯
21
+ Files stats.py, test_stats.py
22
+ Left out (unrelated, the model thinks): debug.log
23
+ [y] commit · [e] edit the message · [n] cancel: y
24
+ ✓ Committed fecd803 feat: add median()
25
+ ```
26
+
27
+ - **What goes in.**
28
+ - If you staged files (`git add`), exactly those.
29
+ - Otherwise every changed and new file, except:
30
+ - files the model thinks are unrelated to the work, listed so you can see them;
31
+ - files that may hold secrets (`.env`, `*.pem`, keys, credentials and the like). These only go in when you stage them yourself.
32
+ - **The message.** It's written from the diff, from what the conversation knows about why you made the change, and from the repository's recent commits: their prefixes, tense, length and trailers. `/commit mention ticket ABC-12` adds your own notes.
33
+ - **Editing.** `e` opens the message in your editor (`$EDITOR`).
34
+ - **Hooks.** Your git hooks run as usual: a failing pre-commit hook stops the commit and shows why.
35
+
36
+ ## /review
37
+
38
+ | | Reviews |
39
+ |---|---|
40
+ | `/review` | The uncommitted changes if any tracked file changed; otherwise the branch's changes compared with the default branch (`main`) |
41
+ | `/review develop` | The branch, and any uncommitted changes, compared with `develop` |
42
+
43
+ The model reads the code around the changes where it needs to. During a review it can't change
44
+ files or run commands that change anything. It reports findings with `path:line`, the kind of
45
+ problem (bug, test, security or clarity), what's wrong and how to fix it, most important first:
46
+
47
+ ```text
48
+ stats.py:18 — bug
49
+ The even-length median is broken: for median([1, 3, 2, 4]) the old code returns 2.5, the new
50
+ code returns 3. Revert line 18 to (s[mid - 1] + s[mid]) / 2.
51
+
52
+ test_stats.py:13 — test
53
+ test_median() asserts median([1, 3, 2, 4]) == 2.5, so it fails with this change.
54
+ ```
55
+
56
+ Then ask it to fix what you agree with, in the same conversation.
57
+
58
+ **Your own checklist:** put review guidelines in `AGENTS.md` or in a [skill](commands.md#skills),
59
+ and the review follows them. To replace `/review` entirely, write a
60
+ [command](commands.md#commands) of your own called `review`. The same goes for `/commit` and `/pr`.
61
+
62
+ ## /pr
63
+
64
+ Pushes the branch and opens a GitHub pull request. It needs the [GitHub CLI](https://cli.github.com),
65
+ signed in with `gh auth login`.
66
+
67
+ - **Into which branch.** The default branch, or the one you name: `/pr develop`. Anything else you
68
+ type is a note for the description: `/pr develop link it to #12`.
69
+ - **Before you start.** Commit first: `/pr` stops while there are uncommitted changes.
70
+ - **Commits made on `main` itself** go to a new branch named after the change. Your local `main`
71
+ still has them, so reset it once the pull request is merged.
72
+ - **The title and description** are written from the commits, the diff and the conversation, and
73
+ follow the repository's pull request template if it has one. You see them before anything is
74
+ pushed: `y` to push and open, `e` to edit, `n` to stop.
75
+ - **A branch with an open pull request:** `/pr` offers to push the new commits instead.
76
+
77
+ ## Parallel sessions: lcode --worktree
78
+
79
+ ```bash
80
+ lcode --worktree fix-login # a session on a new branch fix-login, in a folder of its own
81
+ lcode -w # the same, with a generated name
82
+ ```
83
+
84
+ A [git worktree](https://git-scm.com/docs/git-worktree) is a second working folder of the same
85
+ repository, on its own branch. Sessions in different worktrees can edit, test and commit at the
86
+ same time without touching each other's files, or yours.
87
+
88
+ - **Where it starts.** The worktree starts from your current commit. Uncommitted changes in your
89
+ own folder don't come along.
90
+ - **Where it lives.** lcode keeps worktree folders in `~/.local/state/lcode/worktrees/` and prints
91
+ the path. They're outside the repository so the model can't mistake your folder for its own.
92
+ - **When the session ends.**
93
+ - If nothing changed (no commits and no uncommitted changes), the worktree and its branch are
94
+ removed.
95
+ - Otherwise it stays, and lcode tells you how to continue (`lcode --worktree fix-login` again),
96
+ merge it (`git merge fix-login`) or remove it.
97
+ - **What's separate.** Sessions (`/resume`, `lcode -c`) and [checkpoints](usage.md#undo-and-checkpoints)
98
+ belong to each worktree. [Memory notes](memory.md) are shared with the repository.
@@ -151,6 +151,11 @@ lcode config set ollama_host http://gpu-server:11434
151
151
  Your prompts and the code the model reads are then sent to that server. Ollama has no
152
152
  authentication; only expose it on a network you trust (or through an SSH tunnel).
153
153
 
154
+ ### LM Studio, llama.cpp, vLLM or MLX instead of Ollama
155
+
156
+ lcode also works with any server that has an OpenAI-compatible API: `lcode config set backend
157
+ lmstudio` (or `llama.cpp`, `vllm`, `mlx`). See [Other model servers](servers.md).
158
+
154
159
  ### Windows
155
160
 
156
161
  Use [WSL2](https://learn.microsoft.com/windows/wsl/install) with Ubuntu and follow the Ubuntu
@@ -12,7 +12,7 @@ lcode
12
12
 
13
13
  ```text
14
14
  ╭──────────────────────────────────────────────╮
15
- │ lcode v0.15.0 — local coding agent │
15
+ │ lcode v0.17.0 — local coding agent │
16
16
  │ │
17
17
  │ model lcode-qwen3.6-35b │
18
18
  │ context 256K tokens │
@@ -0,0 +1,136 @@
1
+ # Other model servers
2
+
3
+ lcode is built around [Ollama](https://ollama.com), but it also works with any server that has an
4
+ OpenAI-compatible API: [LM Studio](https://lmstudio.ai),
5
+ [llama.cpp](https://github.com/ggml-org/llama.cpp)'s `llama-server`, [vLLM](https://docs.vllm.ai)
6
+ and the [MLX](https://github.com/ml-explore/mlx-lm) server. Tool calls, streaming answers, reasoning
7
+ and all of lcode's tools work the same.
8
+
9
+ ```bash
10
+ lcode config set backend lmstudio # or llama.cpp, vllm, mlx
11
+ lcode doctor # checks the server, the model and its context window
12
+ lcode
13
+ ```
14
+
15
+ | `backend` | Server | Default address |
16
+ |---|---|---|
17
+ | `ollama` (default) | Ollama | `ollama_host`, `http://localhost:11434` |
18
+ | `lmstudio` | LM Studio | `http://localhost:1234/v1` |
19
+ | `llama.cpp` | llama-server | `http://localhost:8080/v1` |
20
+ | `vllm` | vLLM | `http://localhost:8000/v1` |
21
+ | `mlx` | `mlx_lm.server` | `http://localhost:8080/v1` |
22
+ | `openai` | Any other OpenAI-compatible API | Set `base_url` |
23
+
24
+ - **Another address:** `lcode config set base_url http://gpu-box:8000/v1`.
25
+ - **A server that needs a key:** put it in `LCODE_API_KEY` (or `OPENAI_API_KEY`). lcode sends it as a
26
+ bearer token and never writes it to the config file.
27
+ - **For one run:** `LCODE_BACKEND=llama.cpp lcode`.
28
+
29
+ Your prompts and the code the model reads go to that server, so use one you run yourself or trust.
30
+
31
+ ## Choosing the model
32
+
33
+ The `model` setting names a model the server serves. `lcode models` lists them:
34
+
35
+ ```text
36
+ $ lcode models
37
+ Models served by LM Studio at http://localhost:1234/v1
38
+ google/gemma-4-12b
39
+ qwen/qwen3.6-35b-a3b current
40
+ ```
41
+
42
+ Part of the name is enough when only one model matches (`lcode -m gemma`). A server with a single
43
+ model, like llama-server, uses it whatever the setting says. `lcode setup` only installs models
44
+ into Ollama: download models in the server itself.
45
+
46
+ ## The context window
47
+
48
+ With Ollama, lcode chooses the context window and loads the model with it. Other servers load the
49
+ model themselves, with their own window, so lcode reads its size from the server:
50
+
51
+ - llama-server: the `-c` option;
52
+ - vLLM: `--max-model-len`;
53
+ - LM Studio: the context length the model was loaded with.
54
+
55
+ lcode then summarizes the conversation before it outgrows that window. The MLX server and Ollama's
56
+ own OpenAI endpoint don't report a size, so lcode assumes 32K; set the real size with
57
+ `lcode config set context 64k`. A smaller value than the server's is fine (`/ctx 16k`): lcode just
58
+ summarizes sooner.
59
+
60
+ lcode's instructions and tool definitions take about 6K tokens, so give the model at least 32K.
61
+
62
+ ## Setting up each server
63
+
64
+ ### LM Studio
65
+
66
+ 1. Download a model that supports tool use, such as Qwen3.6 35B A3B or Gemma 4.
67
+ 2. Load it with a context length of 32K or more. LM Studio's default of 4K is too small for a
68
+ coding agent.
69
+ 3. Start the server: in the Developer tab, or with `lms server start`.
70
+ 4. Point lcode at it:
71
+
72
+ ```bash
73
+ lcode config set backend lmstudio
74
+ lcode models # the ids LM Studio serves
75
+ lcode config set model qwen/qwen3.6-35b-a3b
76
+ ```
77
+
78
+ On a Mac, LM Studio's MLX models are the fastest route. Load the model before you start lcode: a
79
+ model that LM Studio loads on request gets LM Studio's default context length.
80
+
81
+ ### llama.cpp (llama-server)
82
+
83
+ ```bash
84
+ llama-server -m Qwen3.6-35B-A3B-Q4_K_M.gguf --alias qwen3.6-35b --jinja -c 65536 -ngl 99 --n-cpu-moe 20
85
+ lcode config set backend llama.cpp
86
+ ```
87
+
88
+ - `--jinja` is required for tool calls.
89
+ - `-c` sets the context window, which lcode reads.
90
+ - `--alias` gives the model a short name; otherwise its name is the file's path.
91
+ - On a GPU too small for the whole model, `--n-cpu-moe N` (or `--cpu-moe`) keeps a mixture-of-experts
92
+ model's expert layers in RAM.
93
+
94
+ With Docker and an NVIDIA GPU:
95
+
96
+ ```bash
97
+ docker run -d --gpus all -p 127.0.0.1:8080:8080 -v ~/models:/models ghcr.io/ggml-org/llama.cpp:server-cuda \
98
+ -m /models/Qwen3.6-35B-A3B-Q4_K_M.gguf --alias qwen3.6-35b --jinja -c 65536 -ngl 99 --n-cpu-moe 20 \
99
+ --host 0.0.0.0
100
+ ```
101
+
102
+ ### vLLM
103
+
104
+ ```bash
105
+ vllm serve Qwen/Qwen3-32B --max-model-len 32768 \
106
+ --enable-auto-tool-choice --tool-call-parser hermes --reasoning-parser qwen3
107
+ lcode config set backend vllm
108
+ ```
109
+
110
+ vLLM needs `--enable-auto-tool-choice` and the tool-call parser for the model's family (see vLLM's
111
+ [tool calling](https://docs.vllm.ai/en/latest/features/tool_calling.html) page). A reasoning parser
112
+ keeps the model's thinking out of its answers.
113
+
114
+ ### MLX (Apple silicon)
115
+
116
+ ```bash
117
+ pip install mlx-lm
118
+ mlx_lm.server --model mlx-community/Qwen3-30B-A3B-4bit
119
+ lcode config set backend mlx
120
+ lcode config set context 32k
121
+ ```
122
+
123
+ ## What's different from Ollama
124
+
125
+ | | Ollama | Other servers |
126
+ |---|---|---|
127
+ | Context window | lcode chooses it, and falls back to a smaller one when the GPU runs out of memory | The server's; lcode reads it |
128
+ | Reasoning on and off (`/think`, `--no-think`) | Yes | Yes, for models whose chat template has a switch (Qwen and others) on llama-server and vLLM |
129
+ | Thinking shown separately | Yes | Yes. When a server sends the thinking as part of the answer, lcode moves it out |
130
+ | Images | The model's own vision, or `vision_model` | Set `vision_model` to a model the server serves that can see images |
131
+ | [Code search](search.md#semantic-code-search) | Any installed embedding model | Needs the server to serve an embedding model too, as LM Studio can |
132
+ | Freeing the GPU for MCP tools that need it | Yes | No: the server decides what stays loaded |
133
+ | `lcode bench` memory columns | Measured | Empty: the server doesn't report them |
134
+
135
+ `lcode bench` works the same way with any backend, so you can compare the same model on two
136
+ servers: `LCODE_BACKEND=llama.cpp lcode bench`.
@@ -20,6 +20,7 @@ lcode mcp [catalog|add|list] # connect MCP servers: Jira, GitHub, AWS, databases
20
20
  | `-r, --repo DIR` | Work in another directory |
21
21
  | `-c, --continue` | Continue the most recently used session in this directory |
22
22
  | `--resume [SESSION]` | Resume a saved session: pick from a list, or give its number, name or id |
23
+ | `-w, --worktree [NAME]` | Work in a [git worktree](git.md#parallel-sessions-lcode-worktree) of its own, on branch NAME; removed at the end if nothing changed |
23
24
  | `--plan` | Start in [plan mode](#plan-mode): agree on a plan before anything changes |
24
25
  | `--auto-edit` | Apply file edits without asking (commands still ask) |
25
26
  | `--yolo` | Never ask for permission |
@@ -74,6 +75,9 @@ reasoning is on.
74
75
  | `/mode [ask\|plan\|auto-edit\|yolo]` | Set the permission mode |
75
76
  | `/cd DIR` | Change the working directory |
76
77
  | `/todos` | Show the model's task list |
78
+ | `/commit [notes]` | [Commit](git.md#commit) the changes with a message in the repository's style, once you approve it |
79
+ | `/review [base]` | [Review](git.md#review) the uncommitted changes, or the branch against a base |
80
+ | `/pr [base] [notes]` | Push the branch and open a GitHub [pull request](git.md#pr), once you approve it |
77
81
  | `/exit` | Quit |
78
82
 
79
83
  ## What the model can do
@@ -95,9 +95,11 @@ nav:
95
95
  - Memory: memory.md
96
96
  - Subagents: agents.md
97
97
  - Commands and skills: commands.md
98
+ - Git workflow: git.md
98
99
  - Code intelligence: lsp.md
99
100
  - Repository map and code search: search.md
100
101
  - Models & context windows: models.md
102
+ - Other model servers: servers.md
101
103
  - Benchmarking models: bench.md
102
104
  - MCP servers: mcp.md
103
105
  - Sandbox: sandbox.md
@@ -83,6 +83,8 @@ ignore = [
83
83
  "src/lcode/repomap.py" = ["E501"]
84
84
  "src/lcode/codesearch.py" = ["E501"]
85
85
  "src/lcode/bench_backend.py" = ["E501"]
86
+ "src/lcode/backends.py" = ["E501"]
87
+ "src/lcode/gitflow.py" = ["E501"]
86
88
 
87
89
  [tool.pytest.ini_options]
88
90
  testpaths = ["tests"]
@@ -1,3 +1,3 @@
1
1
  """lcode — a local-first terminal coding agent powered by open-weight models via Ollama."""
2
2
 
3
- __version__ = "0.15.0"
3
+ __version__ = "0.17.0"
@@ -130,7 +130,14 @@ def git_info(cwd: Path) -> str:
130
130
  return "not a git repository"
131
131
  changed = git("status", "--short").stdout.strip().splitlines()
132
132
  log = git("log", "--oneline", "-5").stdout.strip() or "(no commits)"
133
- return f"branch {branch.stdout.strip()}, {len(changed)} changed file(s)\nRecent commits:\n{log}"
133
+ dirs = git("rev-parse", "--path-format=absolute", "--git-dir", "--git-common-dir").stdout.split()
134
+ worktree = (
135
+ "\nThis folder is a git worktree, separate from the repository's main checkout: read, change and "
136
+ "commit files only here, with paths inside this folder."
137
+ if len(dirs) == 2 and dirs[0] != dirs[1]
138
+ else ""
139
+ )
140
+ return f"branch {branch.stdout.strip()}, {len(changed)} changed file(s){worktree}\nRecent commits:\n{log}"
134
141
  except (OSError, subprocess.TimeoutExpired):
135
142
  return "unknown"
136
143
 
@@ -242,6 +249,7 @@ class Agent:
242
249
  # Set on subagents (see lcode.subagents):
243
250
  self.allowed_tools: set[str] | None = None # None: every tool
244
251
  self.read_only = False # only read-only shell commands
252
+ self.no_changes = "" # set during a review: why nothing may change (read-only tools only)
245
253
  self.cancel: threading.Event | None = None # set from another thread to stop
246
254
  self.on_tool = None # called with (name, arguments) before each tool runs
247
255
  self.response = None # the streaming response, so another thread can abort it
@@ -570,7 +578,8 @@ class Agent:
570
578
  self.console.print(f"[dim]{self.settings.model} does not support reasoning; continuing without.[/]")
571
579
  yield from self.chat(messages, tools, False)
572
580
  return
573
- if any(marker in error for marker in GPU_MEMORY_ERRORS):
581
+ # Only Ollama loads the model with lcode's settings; other servers manage their own memory.
582
+ if getattr(self.ollama, "kind", "ollama") == "ollama" and any(m in error for m in GPU_MEMORY_ERRORS):
574
583
  batch = self.settings.num_batch
575
584
  if not started and batch and batch > SAFE_NUM_BATCH:
576
585
  # Larger batches read prompts faster but need extra VRAM that isn't always free.
@@ -930,4 +939,6 @@ class Agent:
930
939
  else:
931
940
  note = ""
932
941
  self.settings.context = tokens
942
+ if getattr(self.ollama, "kind", "ollama") != "ollama": # the server keeps its own window
943
+ return f"lcode now uses {format_tokens(tokens)} tokens of the context window{note}, and summarizes sooner."
933
944
  return f"Context window set to {format_tokens(tokens)} tokens{note}. The model reloads on the next request."