mini-code-cli 0.2.1.1__tar.gz → 0.3.0.1__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.
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/PKG-INFO +161 -22
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/README.md +160 -20
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/agent_loop.py +1290 -152
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/compaction.py +53 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/config.py +21 -1
- mini_code_cli-0.3.0.1/mini_code_cli/media.py +194 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/persistence.py +6 -7
- mini_code_cli-0.3.0.1/mini_code_cli/planning.py +90 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/prompts.py +172 -10
- mini_code_cli-0.3.0.1/mini_code_cli/recovery.py +157 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/runner.py +1 -1
- mini_code_cli-0.3.0.1/mini_code_cli/settings.py +918 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/shell_safety_utils.py +0 -4
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/skills.py +0 -20
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/subagents/base.py +0 -1
- mini_code_cli-0.3.0.1/mini_code_cli/todos.py +202 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/tokens.py +6 -1
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/tools.py +258 -47
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/tui.py +682 -76
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/ui.py +148 -44
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/utils.py +144 -25
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli.egg-info/PKG-INFO +161 -22
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli.egg-info/SOURCES.txt +8 -1
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/pyproject.toml +2 -4
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/tests/test_advanced_features.py +407 -6
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/tests/test_background.py +6 -1
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/tests/test_config.py +22 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/tests/test_e2e_agent_loop.py +66 -2
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/tests/test_interactive.py +146 -24
- mini_code_cli-0.3.0.1/tests/test_media.py +64 -0
- mini_code_cli-0.3.0.1/tests/test_recovery.py +70 -0
- mini_code_cli-0.3.0.1/tests/test_settings.py +990 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/tests/test_subagents.py +1 -2
- mini_code_cli-0.3.0.1/tests/test_todos.py +83 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/tests/test_tokens.py +9 -7
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/tests/test_tools.py +93 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/tests/test_tui.py +534 -5
- mini_code_cli-0.2.1.1/mini_code_cli/planning.py +0 -29
- mini_code_cli-0.2.1.1/mini_code_cli.egg-info/requires.txt +0 -1
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/LICENSE +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/__init__.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/__main__.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/agent_files.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/background.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/permissions.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/plan.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/sandbox.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/subagents/__init__.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli/subagents/builtin.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli.egg-info/dependency_links.txt +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli.egg-info/entry_points.txt +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/mini_code_cli.egg-info/top_level.txt +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/setup.cfg +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/tests/test_cli_features.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/tests/test_permissions.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/tests/test_release_script.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/tests/test_runner.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.1}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mini-code-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0.1
|
|
4
4
|
Summary: Mini Coding Agent. Allows you to easily experiment with a small coding agent.
|
|
5
5
|
Author-email: Nikolai Rozanov <nikolai.rozanov@gmail.com>
|
|
6
6
|
License-Expression: AGPL-3.0-only
|
|
@@ -14,7 +14,6 @@ Classifier: Operating System :: OS Independent
|
|
|
14
14
|
Requires-Python: >=3.10
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
|
-
Requires-Dist: requests<3,>=2.31
|
|
18
17
|
Dynamic: license-file
|
|
19
18
|
|
|
20
19
|
# mini-code-cli
|
|
@@ -48,7 +47,7 @@ pip3 install mini-code-cli
|
|
|
48
47
|
```
|
|
49
48
|
|
|
50
49
|
- **PyPI:** <https://pypi.org/project/mini-code-cli/>
|
|
51
|
-
- **Python:** `>= 3.10` · **runtime
|
|
50
|
+
- **Python:** `>= 3.10` · **runtime dependencies:** none (stdlib only)
|
|
52
51
|
- **From source / contributing:** see [docs/README_DEV.md](docs/README_DEV.md)
|
|
53
52
|
|
|
54
53
|
## Quick start
|
|
@@ -91,7 +90,7 @@ given a reference implementation.
|
|
|
91
90
|
| `--url URL` | `http://0.0.0.0:30000` | API host |
|
|
92
91
|
| `--model MODEL` | — | model name |
|
|
93
92
|
| `--api-key KEY` | `$MINI_CODE_API_KEY` | API key for authentication |
|
|
94
|
-
| `--max-tokens N` |
|
|
93
|
+
| `--max-tokens N` | 32768, or half the model window | reply budget; also the output headroom used when deriving the compaction limit |
|
|
95
94
|
| `--temperature T` | `1.0` | sampling temperature |
|
|
96
95
|
| `--system-prompt TEXT` | built-in | replace the system prompt (an `--agent-md` file is appended *after* it) |
|
|
97
96
|
| `--prompt TEXT` | — | initial user prompt |
|
|
@@ -106,13 +105,20 @@ given a reference implementation.
|
|
|
106
105
|
| `--tui [auto\|on\|off]` | `auto` | fixed full-screen dashboard. `auto` enables it only on a known interactive TTY; `on` forces it; `off` uses the scrolling console |
|
|
107
106
|
| `--skills` | off | enable the `.mini` skills directory (`skill.md`s, `SKILLS.md`, runnable scripts). **`run_skill` executes those Python scripts — arbitrary code execution, even without `--enable-shell`**; only enable it for a directory you trust |
|
|
108
107
|
| `-p`, `--plan` | off | plan mode (`CURRENT_GOAL.md` / `CURRENT_PLAN.md`, printed plan, `/plan`, `/skip-plan`) |
|
|
109
|
-
| `--
|
|
108
|
+
| `--super` | off | kitchen-sink behaviour preset: plan-verify2 + strict verification, all shell/sub-agent/skill/sudo/background features, auto-mode, prompt-change recovery and dynamic todos. The model, URL and API key are left untouched |
|
|
109
|
+
| `--plan-strategy NAME` | `plan-verify2` | `plan-verify2`, `plan-verify`, `plan-verify-step` or `open-plan` (implies `--plan`) |
|
|
110
|
+
| `--allow-nudge` | off | plan mode only: ask the model to continue (or reply DONE) when it stops without a tool call, before running the plan review |
|
|
111
|
+
| `--nudge-limit N` | 1 | maximum continuation nudges per text-only stop with `--allow-nudge` |
|
|
112
|
+
| `--strict-verify` | off | use the evidence-based verification prompt for every plan review/verify stage; also verifies after `open-plan` work settles. Unproven requirements count as unfinished |
|
|
113
|
+
| `--runtime-strategy NAME` | `normal` | `normal`, `prompt-change` or `prompt-change-plan`: recover after 3 consecutive failures of the same call/tool |
|
|
110
114
|
| `--scratchpad` | off | give the agent a free-form `.mini/SCRATCHPAD.md` (plus further scratch files) for thoughts, plans and learnings |
|
|
115
|
+
| `--dynamic-todo-tracking` | off | give the agent a structured session-local todo list (`todo_write` / `todo_update` / `todo_list`), independent of plan mode and the scratchpad |
|
|
111
116
|
| `--compaction-strategy NAME` | `summarise` | `summarise`, `predict-files` or `predict-messages` |
|
|
112
117
|
| `--llm-timeout S` | `500` | HTTP timeout for LLM requests |
|
|
113
118
|
| `--tool-timeout S` | `120` | timeout for a single tool call |
|
|
114
119
|
| `--max-context-tokens N` | derived | input-token budget before the history is compacted |
|
|
115
120
|
| `--cache-dir DIR` | `~/.cache/mini/sessions/` | where session histories are stored |
|
|
121
|
+
| `--no-settings` | off | do not load, prompt for, or save session settings (useful for CI/benchmark runs) |
|
|
116
122
|
| `--restore-session PATH` | — | continue a specific previous session |
|
|
117
123
|
| `-l`, `--load-last-session` | off | continue the session recorded in the `.mini` pointer |
|
|
118
124
|
| `--all` | off | `--plan --enable-subagents --enable-shell --skills --auto-mode --sudo --background` |
|
|
@@ -132,9 +138,9 @@ parameter a model does not need is defaulted, so omitting it keeps the previous
|
|
|
132
138
|
| `edit` | replace an **exact** string (`old_string` → `new_string`); refuses a missing or ambiguous match unless `replace_all` |
|
|
133
139
|
| `grep` | regex search a file or directory; `recursive`, `include`, `ignore_case`, `line_numbers`, `max_results` (noise dirs skipped). Output is capped at 100k characters |
|
|
134
140
|
| `glob` | list files matching a glob (one per line, `**` supported), optionally against a `root`; capped at 2000 matches / 100k characters |
|
|
135
|
-
| `web_search` |
|
|
141
|
+
| `web_search` | DuckDuckGo Lite HTML search (POST), with DuckDuckGo Instant Answers and Wikipedia as fallbacks. Returns titles, URLs and snippets; never raises |
|
|
136
142
|
| `read_website` | fetch raw text/HTML of a **public http/https** URL (other schemes and private/link-local hosts are rejected; `MINI_CODE_ALLOW_PRIVATE_URLS=1` overrides); `max_chars` caps size |
|
|
137
|
-
| `run_shell_command` | run a shell command (needs `--enable-shell`); `cwd`, `timeout`, and stdout/stderr/exit code are all reported |
|
|
143
|
+
| `run_shell_command` | run a shell command (needs `--enable-shell`); `cwd`, `timeout`, and stdout/stderr/exit code are all reported. Output over 50k characters is capped in the reply and the full text is written to `.mini/tool-output/` so `read_file`/`grep` can page it |
|
|
138
144
|
| `background` | start/list/output/wait/cancel background **shell** tasks (needs `--background --enable-shell`) or **sub-agent** tasks (needs `--background --enable-subagents`); output is captured in a per-task log |
|
|
139
145
|
|
|
140
146
|
## Sub-agents
|
|
@@ -218,8 +224,11 @@ steps; it shows the last/current blocking activity rather than live-during the c
|
|
|
218
224
|
| `/reset [<n>]` | rewind to the end of turn `n` (`last` works too); drops everything after it |
|
|
219
225
|
| `/clear` | clear the screen (keeps the conversation history) |
|
|
220
226
|
| `/plan` | show the current goal + plan (plan mode only) |
|
|
227
|
+
| `/todo` | show the dynamic todo list; `/todo clear` empties it |
|
|
228
|
+
| `/image <path>` | stage a PNG/JPEG/WEBP/GIF for the next message; `/image clear` removes staged images |
|
|
221
229
|
| `/context` | show how the context window is used: tokens and percentages by category (system prompt, user/assistant messages, tool calls/outputs, reasoning, overhead) |
|
|
222
230
|
| `/background [id]` | show foreground activity + background tasks, or one task's output tail |
|
|
231
|
+
| `/settings [name|number] [value]` | show or change session settings; bare `/settings` opens the settings prompt |
|
|
223
232
|
| `/expand [n]` | show the full detail of the nth most recent tool call (default: the last one) |
|
|
224
233
|
| `/skip-plan <prompt>` | send `<prompt>` once without generating or reviewing a plan |
|
|
225
234
|
| `/help` | show this help |
|
|
@@ -270,6 +279,68 @@ scrolling console or `--tui=on` to force it. It is not part of `--all`.
|
|
|
270
279
|
> [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md#rewinding-reset-and-what-it-does-to-the-files)
|
|
271
280
|
> for the files involved.
|
|
272
281
|
|
|
282
|
+
### Session settings
|
|
283
|
+
|
|
284
|
+
Settings are stored per session in the cache, never in the project’s `.mini`:
|
|
285
|
+
|
|
286
|
+
```text
|
|
287
|
+
<cache-dir>/<session-id>/settings.json
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
The file has a single current layout (`version`, `values`, `api_keys`,
|
|
291
|
+
`api_key_envs`, with keys scoped by endpoint/model); older top-level key fields
|
|
292
|
+
are ignored rather than migrated. Startup deliberately does **not** load
|
|
293
|
+
previous-session settings: the resume offer
|
|
294
|
+
uses the CLI/environment/default configuration, so no settings notes or questions
|
|
295
|
+
appear before you choose. Settings are loaded only after that choice. Resuming
|
|
296
|
+
adopts the restored session’s settings; starting a **new** session resets ordinary
|
|
297
|
+
settings to their defaults (the previous per-model API-key archive is the one thing
|
|
298
|
+
kept) and asks the provider/model questions again, pre-selecting the current provider
|
|
299
|
+
so Enter keeps it. An explicit `--model` skips the questions. The saved model and API
|
|
300
|
+
key are checked after the model is known (after the restore, or after the
|
|
301
|
+
provider/model selection).
|
|
302
|
+
|
|
303
|
+
The wizard asks for the model provider (`localhost`, `deepseek`, or a custom URL)
|
|
304
|
+
and, when needed, the API key. For DeepSeek it then asks which model to use, offering
|
|
305
|
+
the ids from the live `/v1/models` response when a key is available (otherwise the
|
|
306
|
+
stable `deepseek-chat` / `deepseek-reasoner` aliases). The DeepSeek key prompt says
|
|
307
|
+
where to create a key and that `MINI_CODE_API_KEY` is used first. When the fixed TUI
|
|
308
|
+
applies, the wizard runs inside it (arrow keys or numbers select, and a typed key is
|
|
309
|
+
masked). If you type a key, mini-code asks clearly whether to write it to the session
|
|
310
|
+
file with mode `0600`; otherwise it stays in memory for this session only. Keys are
|
|
311
|
+
scoped to the endpoint/model: selecting another model loads its stored key, or asks
|
|
312
|
+
for one when none is stored. Once the model is known, a key found for it is checked
|
|
313
|
+
against `/v1/models`; an explicit `401`/`403` rejection reopens the key prompt.
|
|
314
|
+
|
|
315
|
+
Use `/settings` to inspect or change settings. The table marks values that rebuild
|
|
316
|
+
the tool list or generated system prompt — these invalidate the LLM prompt cache.
|
|
317
|
+
Cache-impacting edits from the plain `settings>` prompt are staged until you type
|
|
318
|
+
`apply`, so a batch rebuilds the prompt once.
|
|
319
|
+
|
|
320
|
+
In the fixed TUI the centered, unboxed ASCII mark and tagline (the same mark used by
|
|
321
|
+
`--tui off`) sit above the session view and stay visible in the settings views. The
|
|
322
|
+
settings table is a navigable overlay grouped into Model & connection, Generation,
|
|
323
|
+
Planning, Compaction, Tools & permissions, Runtime limits, Display, Agent behaviour
|
|
324
|
+
and Immutable/session sections (so e.g. `verbose` lives under Display). It starts at
|
|
325
|
+
the first setting and scrolls with the selection. Up/down or numbers select;
|
|
326
|
+
left/right toggle an on/off setting or rotate through a fixed-choice setting
|
|
327
|
+
(such as `plan-strategy`) in place. Values equal to their built-in default are marked
|
|
328
|
+
`(default)`. Enter opens a focused sub-window that shows only that setting's input
|
|
329
|
+
box (or its option list), where `exit` or Esc returns to the settings table. The full
|
|
330
|
+
table (including immutable rows) is always shown. `a` stages the same feature flags
|
|
331
|
+
as the CLI `--all` preset (plan, shell, sub-agents, skills, auto-mode, sudo,
|
|
332
|
+
background); `p` stages the CLI `--super` preset; `d` stages all defaults while
|
|
333
|
+
keeping the model, URL and API key. The
|
|
334
|
+
same presets are
|
|
335
|
+
available as `/settings all`, `/settings super` and `/settings default`. Changes are staged in the
|
|
336
|
+
table until you press `s` to save; `q` quits, and if there are unsaved changes it
|
|
337
|
+
asks whether to save them or cancel the changes. The table header shows a green
|
|
338
|
+
`saved` or yellow `unsaved` badge. Plan
|
|
339
|
+
mode is its own on/off setting;
|
|
340
|
+
the plan strategy keeps a concrete value even while plan mode is off, and changing
|
|
341
|
+
the strategy does not turn plan mode on. Changing the TUI, paths, the custom system
|
|
342
|
+
prompt or the initial prompt is not allowed mid-session.
|
|
343
|
+
|
|
273
344
|
## Development
|
|
274
345
|
|
|
275
346
|
Linting, the test suite, CI and the release process are documented in
|
|
@@ -332,16 +403,71 @@ on for later turns).
|
|
|
332
403
|
|
|
333
404
|
| Strategy | What happens |
|
|
334
405
|
| --- | --- |
|
|
335
|
-
| `plan-
|
|
336
|
-
| `plan-verify` |
|
|
406
|
+
| `plan-verify2` (default) | Author a plan, then verify completion with one machine-readable verdict (`STATUS: DONE` / `STATUS: INCOMPLETE` / `STATUS: IN PROGRESS`). `DONE` ends the turn immediately, without the post-review step; an unfinished verdict re-queues the outstanding work and the agent continues, with another verify after it settles. |
|
|
407
|
+
| `plan-verify` | Author a plan, review it once the work settles, then keep the post-review step only when it calls a tool. A no-tool answer is shown to you and ends the turn without being appended to the transcript. |
|
|
408
|
+
| `plan-verify-step` | The original behaviour: same plan + review, then always run one extra step and keep whatever that step says. |
|
|
337
409
|
| `open-plan` | The agent owns a plan document at `.mini/PLAN.md` inside `--allowed-dir`, reads and updates it with the normal file tools, and the loop neither authors nor reviews a plan. |
|
|
338
410
|
|
|
339
411
|
> [!NOTE]
|
|
340
412
|
> Plan mode also changes **history compaction**: after the transcript is compacted to a summary,
|
|
341
413
|
> `CURRENT_PLAN.md` and `CURRENT_GOAL.md` are re-injected, so the agent keeps working against the
|
|
342
414
|
> same goal. With `open-plan`, the agent's `.mini/PLAN.md` is re-injected instead. When the work
|
|
343
|
-
> looks done the plan is reviewed
|
|
344
|
-
> to you (except with
|
|
415
|
+
> looks done the plan is reviewed (or, with `plan-verify2`, verified with a DONE/INCOMPLETE
|
|
416
|
+
> verdict) and any outstanding task is re-queued before the agent returns to you (except with
|
|
417
|
+
> `open-plan`, unless `--strict-verify` is on).
|
|
418
|
+
|
|
419
|
+
`--strict-verify` makes the completion check evidence-based instead of trust-based. The verifier
|
|
420
|
+
must restate the goal as concrete requirements, cite the tool call/output that proves each one, and
|
|
421
|
+
mark missing or ambiguous evidence as unfinished. It applies to `plan-verify`, `plan-verify2` and
|
|
422
|
+
`plan-verify-step`, and with `open-plan` it adds a verification pass after the work settles without
|
|
423
|
+
taking ownership of the agent's plan document.
|
|
424
|
+
|
|
425
|
+
`--allow-nudge` adds a completion checkpoint to any plan strategy. When the model replies without
|
|
426
|
+
a tool call and the text does not explicitly say `DONE` / complete / finished, the loop appends a
|
|
427
|
+
short “continue with the next tool call, or reply DONE” message instead of immediately paying for a
|
|
428
|
+
plan review. `--nudge-limit N` controls how many nudges are allowed per text-only stop (default 1).
|
|
429
|
+
After the limit, the normal plan strategy takes over. This is useful for thinking models that tend
|
|
430
|
+
to emit an intermediate “let me do X” message and stop.
|
|
431
|
+
|
|
432
|
+
### Runtime recovery — `--runtime-strategy`
|
|
433
|
+
|
|
434
|
+
The runtime strategy decides what happens when tool use keeps failing. It is independent of plan
|
|
435
|
+
mode and applies to every turn:
|
|
436
|
+
|
|
437
|
+
| Strategy | What happens |
|
|
438
|
+
| --- | --- |
|
|
439
|
+
| `normal` (default) | No automatic prompts; the model sees tool errors and decides. |
|
|
440
|
+
| `prompt-change` | After three consecutive failures of the same call (same command/path/query) or of the same tool with different inputs, the loop injects: “You have tried TOOL N times and it failed. Rethink your approach and try something else.” It also shows the last failure. A success resets the streak; at most three prompts are issued per turn. |
|
|
441
|
+
| `prompt-change-plan` | The same prompt, then a fresh planning request for the current goal. In `open-plan` the loop injects the recovery plan but does not overwrite the agent's `.mini/PLAN.md`. |
|
|
442
|
+
|
|
443
|
+
Both recovery strategies are heuristics: they are meant to break repetitive command/tool loops
|
|
444
|
+
without changing the model's overall instruction. When `web_search`/`read_website` are available,
|
|
445
|
+
the prompt also tells the model to search the documentation or the web before retrying.
|
|
446
|
+
`runtime-strategy` and `strict-verify` are also available in `/settings`.
|
|
447
|
+
|
|
448
|
+
### Dynamic todo tracking — `--dynamic-todo-tracking`
|
|
449
|
+
|
|
450
|
+
This is separate from the scratchpad. It registers three structured tools and tells the agent to
|
|
451
|
+
keep a short checklist:
|
|
452
|
+
|
|
453
|
+
- `todo_write` replaces the list with a JSON array of `{"content", "status"}` objects;
|
|
454
|
+
- `todo_update` changes one item by id (`pending`, `in_progress`, `completed`);
|
|
455
|
+
- `todo_list` shows the current list.
|
|
456
|
+
|
|
457
|
+
The store is session-local (`<cache-dir>/<session-id>/todos.json`), not a project file, so it does
|
|
458
|
+
not pollute the worktree or a benchmark's filesystem checks. `/todo` shows it and `/todo clear`
|
|
459
|
+
empties it. A scratchpad remains useful for free-form notes; the todo list is for tracked,
|
|
460
|
+
verifiable steps.
|
|
461
|
+
|
|
462
|
+
### Images — `/image` and image-aware `read_file`
|
|
463
|
+
|
|
464
|
+
`/image PATH` stages a PNG/JPEG/WEBP/GIF for the next user message. The file is copied into the
|
|
465
|
+
session cache and the conversation stores a small reference, not base64; the bytes are resolved
|
|
466
|
+
into a data URI only when the request is built. `/image clear` drops staged images.
|
|
467
|
+
|
|
468
|
+
The agent's `read_file` is also image-aware: reading a supported image attaches it as an image
|
|
469
|
+
content block after the tool result. `read_file` still handles text as before. Images count toward
|
|
470
|
+
the context estimate and are flattened to `[image: name]` in plan/review/compaction prompts.
|
|
345
471
|
|
|
346
472
|
### Scratchpad — `--scratchpad`
|
|
347
473
|
|
|
@@ -416,26 +542,36 @@ Because a rollover leaves no trace in the transcript (the old turns really are g
|
|
|
416
542
|
console says in plain terms what happened — all of it without `--verbose`:
|
|
417
543
|
|
|
418
544
|
```
|
|
419
|
-
[!] Compacting the conversation: 42 messages -> a summary (51000 tokens in,
|
|
545
|
+
[!] Compacting the conversation: 42 messages -> a summary (51000 tokens in, 32768 reserved for the reply > 60000 budget). The current turn (1 message) is kept verbatim.
|
|
420
546
|
[!] Summary preview: The user asked for a token-based compaction trigger, then fixed ...
|
|
421
547
|
[!] Compacted history_0.json (42 messages) into a summary; history_1.json now starts with 3 messages (summary + 1 kept message).
|
|
422
548
|
```
|
|
423
549
|
|
|
424
550
|
So you can see *what* was folded away (a preview of the summary itself), *how much* (the
|
|
425
551
|
message count of the segment that was closed), *where it went* (`history_0.json` closed,
|
|
426
|
-
`history_1.json` started) and that nothing you just typed was lost.
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
552
|
+
`history_1.json` started) and that nothing you just typed was lost. The summary request is
|
|
553
|
+
itself size-bounded, so a single enormous tool output cannot make compaction overflow the
|
|
554
|
+
model's context window. If the summariser answers with an empty summary twice, or the call
|
|
555
|
+
fails, compaction falls back to a deterministic mechanical summary (the goal plus the newest
|
|
556
|
+
turns) and still rolls the segment over — keeping the over-long transcript would make every
|
|
557
|
+
later request fail.
|
|
430
558
|
|
|
431
559
|
### Exiting — the good-bye box
|
|
432
560
|
|
|
433
|
-
Quitting (`/quit`, `exit`, or EOF on stdin) saves the session
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
561
|
+
Quitting (`/quit`, `exit`, or EOF on stdin) saves the session, prints the centered
|
|
562
|
+
yellow Mini Code mark and tagline above the box, and then prints a short content-width
|
|
563
|
+
yellow box: the version, a sign-off, and what the session left behind — session id,
|
|
564
|
+
model, folder, the history segments on disk, how many turns were recorded, run duration,
|
|
565
|
+
token / call totals, background tasks cancelled on exit, and a `--load-last-session`
|
|
566
|
+
resume hint.
|
|
437
567
|
|
|
438
568
|
```
|
|
569
|
+
__ __ ___ _ _ ___ ___ ___ ___ ___
|
|
570
|
+
| \/ |_ _| \| |_ _| / __/ _ \| \| __|
|
|
571
|
+
| |\/| || || .` || | | (_| (_) | |) | _|
|
|
572
|
+
|_| |_|___|_|\_|___| \___\___/|___/|___|
|
|
573
|
+
a minimal coding agent CLI
|
|
574
|
+
|
|
439
575
|
╔══════════ MiniCodeCLI v0.1.1.2 - goodbye ═════════════════════╗
|
|
440
576
|
║ Goodbye, and thanks for using MiniCodeCLI! ║
|
|
441
577
|
║ ║
|
|
@@ -459,7 +595,10 @@ the old per-field `Token usage (this session)` block is printed above it as well
|
|
|
459
595
|
|
|
460
596
|
## Serving a model locally
|
|
461
597
|
|
|
462
|
-
|
|
598
|
+
For a one-GPU quick start, `scripts/run_model.sh` starts the small
|
|
599
|
+
`ornith-ai/Ornith-1.5-35B-A3B` checkpoint on port 30000 and waits for `/health`.
|
|
600
|
+
Edit its model/tensor-parallel line for a larger checkpoint. Tested with vLLM
|
|
601
|
+
v0.30 (tool calling enabled):
|
|
463
602
|
|
|
464
603
|
```bash
|
|
465
604
|
vllm serve ornith-ai/Ornith-1.5-397B-FP8 \
|
|
@@ -481,7 +620,7 @@ If you use `mini-code-cli` in your research or writing, please cite it:
|
|
|
481
620
|
author = {Rozanov, Nikolai},
|
|
482
621
|
title = {mini-code-cli: A minimal, dependency-light coding agent},
|
|
483
622
|
year = {2026},
|
|
484
|
-
version = {0.
|
|
623
|
+
version = {0.3.0.1},
|
|
485
624
|
howpublished = {\url{https://github.com/ai-nikolai/mini-code-cli}},
|
|
486
625
|
note = {A no-bloat, dependency-light agent CLI for experimenting.}
|
|
487
626
|
}
|
|
@@ -29,7 +29,7 @@ pip3 install mini-code-cli
|
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
- **PyPI:** <https://pypi.org/project/mini-code-cli/>
|
|
32
|
-
- **Python:** `>= 3.10` · **runtime
|
|
32
|
+
- **Python:** `>= 3.10` · **runtime dependencies:** none (stdlib only)
|
|
33
33
|
- **From source / contributing:** see [docs/README_DEV.md](docs/README_DEV.md)
|
|
34
34
|
|
|
35
35
|
## Quick start
|
|
@@ -72,7 +72,7 @@ given a reference implementation.
|
|
|
72
72
|
| `--url URL` | `http://0.0.0.0:30000` | API host |
|
|
73
73
|
| `--model MODEL` | — | model name |
|
|
74
74
|
| `--api-key KEY` | `$MINI_CODE_API_KEY` | API key for authentication |
|
|
75
|
-
| `--max-tokens N` |
|
|
75
|
+
| `--max-tokens N` | 32768, or half the model window | reply budget; also the output headroom used when deriving the compaction limit |
|
|
76
76
|
| `--temperature T` | `1.0` | sampling temperature |
|
|
77
77
|
| `--system-prompt TEXT` | built-in | replace the system prompt (an `--agent-md` file is appended *after* it) |
|
|
78
78
|
| `--prompt TEXT` | — | initial user prompt |
|
|
@@ -87,13 +87,20 @@ given a reference implementation.
|
|
|
87
87
|
| `--tui [auto\|on\|off]` | `auto` | fixed full-screen dashboard. `auto` enables it only on a known interactive TTY; `on` forces it; `off` uses the scrolling console |
|
|
88
88
|
| `--skills` | off | enable the `.mini` skills directory (`skill.md`s, `SKILLS.md`, runnable scripts). **`run_skill` executes those Python scripts — arbitrary code execution, even without `--enable-shell`**; only enable it for a directory you trust |
|
|
89
89
|
| `-p`, `--plan` | off | plan mode (`CURRENT_GOAL.md` / `CURRENT_PLAN.md`, printed plan, `/plan`, `/skip-plan`) |
|
|
90
|
-
| `--
|
|
90
|
+
| `--super` | off | kitchen-sink behaviour preset: plan-verify2 + strict verification, all shell/sub-agent/skill/sudo/background features, auto-mode, prompt-change recovery and dynamic todos. The model, URL and API key are left untouched |
|
|
91
|
+
| `--plan-strategy NAME` | `plan-verify2` | `plan-verify2`, `plan-verify`, `plan-verify-step` or `open-plan` (implies `--plan`) |
|
|
92
|
+
| `--allow-nudge` | off | plan mode only: ask the model to continue (or reply DONE) when it stops without a tool call, before running the plan review |
|
|
93
|
+
| `--nudge-limit N` | 1 | maximum continuation nudges per text-only stop with `--allow-nudge` |
|
|
94
|
+
| `--strict-verify` | off | use the evidence-based verification prompt for every plan review/verify stage; also verifies after `open-plan` work settles. Unproven requirements count as unfinished |
|
|
95
|
+
| `--runtime-strategy NAME` | `normal` | `normal`, `prompt-change` or `prompt-change-plan`: recover after 3 consecutive failures of the same call/tool |
|
|
91
96
|
| `--scratchpad` | off | give the agent a free-form `.mini/SCRATCHPAD.md` (plus further scratch files) for thoughts, plans and learnings |
|
|
97
|
+
| `--dynamic-todo-tracking` | off | give the agent a structured session-local todo list (`todo_write` / `todo_update` / `todo_list`), independent of plan mode and the scratchpad |
|
|
92
98
|
| `--compaction-strategy NAME` | `summarise` | `summarise`, `predict-files` or `predict-messages` |
|
|
93
99
|
| `--llm-timeout S` | `500` | HTTP timeout for LLM requests |
|
|
94
100
|
| `--tool-timeout S` | `120` | timeout for a single tool call |
|
|
95
101
|
| `--max-context-tokens N` | derived | input-token budget before the history is compacted |
|
|
96
102
|
| `--cache-dir DIR` | `~/.cache/mini/sessions/` | where session histories are stored |
|
|
103
|
+
| `--no-settings` | off | do not load, prompt for, or save session settings (useful for CI/benchmark runs) |
|
|
97
104
|
| `--restore-session PATH` | — | continue a specific previous session |
|
|
98
105
|
| `-l`, `--load-last-session` | off | continue the session recorded in the `.mini` pointer |
|
|
99
106
|
| `--all` | off | `--plan --enable-subagents --enable-shell --skills --auto-mode --sudo --background` |
|
|
@@ -113,9 +120,9 @@ parameter a model does not need is defaulted, so omitting it keeps the previous
|
|
|
113
120
|
| `edit` | replace an **exact** string (`old_string` → `new_string`); refuses a missing or ambiguous match unless `replace_all` |
|
|
114
121
|
| `grep` | regex search a file or directory; `recursive`, `include`, `ignore_case`, `line_numbers`, `max_results` (noise dirs skipped). Output is capped at 100k characters |
|
|
115
122
|
| `glob` | list files matching a glob (one per line, `**` supported), optionally against a `root`; capped at 2000 matches / 100k characters |
|
|
116
|
-
| `web_search` |
|
|
123
|
+
| `web_search` | DuckDuckGo Lite HTML search (POST), with DuckDuckGo Instant Answers and Wikipedia as fallbacks. Returns titles, URLs and snippets; never raises |
|
|
117
124
|
| `read_website` | fetch raw text/HTML of a **public http/https** URL (other schemes and private/link-local hosts are rejected; `MINI_CODE_ALLOW_PRIVATE_URLS=1` overrides); `max_chars` caps size |
|
|
118
|
-
| `run_shell_command` | run a shell command (needs `--enable-shell`); `cwd`, `timeout`, and stdout/stderr/exit code are all reported |
|
|
125
|
+
| `run_shell_command` | run a shell command (needs `--enable-shell`); `cwd`, `timeout`, and stdout/stderr/exit code are all reported. Output over 50k characters is capped in the reply and the full text is written to `.mini/tool-output/` so `read_file`/`grep` can page it |
|
|
119
126
|
| `background` | start/list/output/wait/cancel background **shell** tasks (needs `--background --enable-shell`) or **sub-agent** tasks (needs `--background --enable-subagents`); output is captured in a per-task log |
|
|
120
127
|
|
|
121
128
|
## Sub-agents
|
|
@@ -199,8 +206,11 @@ steps; it shows the last/current blocking activity rather than live-during the c
|
|
|
199
206
|
| `/reset [<n>]` | rewind to the end of turn `n` (`last` works too); drops everything after it |
|
|
200
207
|
| `/clear` | clear the screen (keeps the conversation history) |
|
|
201
208
|
| `/plan` | show the current goal + plan (plan mode only) |
|
|
209
|
+
| `/todo` | show the dynamic todo list; `/todo clear` empties it |
|
|
210
|
+
| `/image <path>` | stage a PNG/JPEG/WEBP/GIF for the next message; `/image clear` removes staged images |
|
|
202
211
|
| `/context` | show how the context window is used: tokens and percentages by category (system prompt, user/assistant messages, tool calls/outputs, reasoning, overhead) |
|
|
203
212
|
| `/background [id]` | show foreground activity + background tasks, or one task's output tail |
|
|
213
|
+
| `/settings [name|number] [value]` | show or change session settings; bare `/settings` opens the settings prompt |
|
|
204
214
|
| `/expand [n]` | show the full detail of the nth most recent tool call (default: the last one) |
|
|
205
215
|
| `/skip-plan <prompt>` | send `<prompt>` once without generating or reviewing a plan |
|
|
206
216
|
| `/help` | show this help |
|
|
@@ -251,6 +261,68 @@ scrolling console or `--tui=on` to force it. It is not part of `--all`.
|
|
|
251
261
|
> [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md#rewinding-reset-and-what-it-does-to-the-files)
|
|
252
262
|
> for the files involved.
|
|
253
263
|
|
|
264
|
+
### Session settings
|
|
265
|
+
|
|
266
|
+
Settings are stored per session in the cache, never in the project’s `.mini`:
|
|
267
|
+
|
|
268
|
+
```text
|
|
269
|
+
<cache-dir>/<session-id>/settings.json
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
The file has a single current layout (`version`, `values`, `api_keys`,
|
|
273
|
+
`api_key_envs`, with keys scoped by endpoint/model); older top-level key fields
|
|
274
|
+
are ignored rather than migrated. Startup deliberately does **not** load
|
|
275
|
+
previous-session settings: the resume offer
|
|
276
|
+
uses the CLI/environment/default configuration, so no settings notes or questions
|
|
277
|
+
appear before you choose. Settings are loaded only after that choice. Resuming
|
|
278
|
+
adopts the restored session’s settings; starting a **new** session resets ordinary
|
|
279
|
+
settings to their defaults (the previous per-model API-key archive is the one thing
|
|
280
|
+
kept) and asks the provider/model questions again, pre-selecting the current provider
|
|
281
|
+
so Enter keeps it. An explicit `--model` skips the questions. The saved model and API
|
|
282
|
+
key are checked after the model is known (after the restore, or after the
|
|
283
|
+
provider/model selection).
|
|
284
|
+
|
|
285
|
+
The wizard asks for the model provider (`localhost`, `deepseek`, or a custom URL)
|
|
286
|
+
and, when needed, the API key. For DeepSeek it then asks which model to use, offering
|
|
287
|
+
the ids from the live `/v1/models` response when a key is available (otherwise the
|
|
288
|
+
stable `deepseek-chat` / `deepseek-reasoner` aliases). The DeepSeek key prompt says
|
|
289
|
+
where to create a key and that `MINI_CODE_API_KEY` is used first. When the fixed TUI
|
|
290
|
+
applies, the wizard runs inside it (arrow keys or numbers select, and a typed key is
|
|
291
|
+
masked). If you type a key, mini-code asks clearly whether to write it to the session
|
|
292
|
+
file with mode `0600`; otherwise it stays in memory for this session only. Keys are
|
|
293
|
+
scoped to the endpoint/model: selecting another model loads its stored key, or asks
|
|
294
|
+
for one when none is stored. Once the model is known, a key found for it is checked
|
|
295
|
+
against `/v1/models`; an explicit `401`/`403` rejection reopens the key prompt.
|
|
296
|
+
|
|
297
|
+
Use `/settings` to inspect or change settings. The table marks values that rebuild
|
|
298
|
+
the tool list or generated system prompt — these invalidate the LLM prompt cache.
|
|
299
|
+
Cache-impacting edits from the plain `settings>` prompt are staged until you type
|
|
300
|
+
`apply`, so a batch rebuilds the prompt once.
|
|
301
|
+
|
|
302
|
+
In the fixed TUI the centered, unboxed ASCII mark and tagline (the same mark used by
|
|
303
|
+
`--tui off`) sit above the session view and stay visible in the settings views. The
|
|
304
|
+
settings table is a navigable overlay grouped into Model & connection, Generation,
|
|
305
|
+
Planning, Compaction, Tools & permissions, Runtime limits, Display, Agent behaviour
|
|
306
|
+
and Immutable/session sections (so e.g. `verbose` lives under Display). It starts at
|
|
307
|
+
the first setting and scrolls with the selection. Up/down or numbers select;
|
|
308
|
+
left/right toggle an on/off setting or rotate through a fixed-choice setting
|
|
309
|
+
(such as `plan-strategy`) in place. Values equal to their built-in default are marked
|
|
310
|
+
`(default)`. Enter opens a focused sub-window that shows only that setting's input
|
|
311
|
+
box (or its option list), where `exit` or Esc returns to the settings table. The full
|
|
312
|
+
table (including immutable rows) is always shown. `a` stages the same feature flags
|
|
313
|
+
as the CLI `--all` preset (plan, shell, sub-agents, skills, auto-mode, sudo,
|
|
314
|
+
background); `p` stages the CLI `--super` preset; `d` stages all defaults while
|
|
315
|
+
keeping the model, URL and API key. The
|
|
316
|
+
same presets are
|
|
317
|
+
available as `/settings all`, `/settings super` and `/settings default`. Changes are staged in the
|
|
318
|
+
table until you press `s` to save; `q` quits, and if there are unsaved changes it
|
|
319
|
+
asks whether to save them or cancel the changes. The table header shows a green
|
|
320
|
+
`saved` or yellow `unsaved` badge. Plan
|
|
321
|
+
mode is its own on/off setting;
|
|
322
|
+
the plan strategy keeps a concrete value even while plan mode is off, and changing
|
|
323
|
+
the strategy does not turn plan mode on. Changing the TUI, paths, the custom system
|
|
324
|
+
prompt or the initial prompt is not allowed mid-session.
|
|
325
|
+
|
|
254
326
|
## Development
|
|
255
327
|
|
|
256
328
|
Linting, the test suite, CI and the release process are documented in
|
|
@@ -313,16 +385,71 @@ on for later turns).
|
|
|
313
385
|
|
|
314
386
|
| Strategy | What happens |
|
|
315
387
|
| --- | --- |
|
|
316
|
-
| `plan-
|
|
317
|
-
| `plan-verify` |
|
|
388
|
+
| `plan-verify2` (default) | Author a plan, then verify completion with one machine-readable verdict (`STATUS: DONE` / `STATUS: INCOMPLETE` / `STATUS: IN PROGRESS`). `DONE` ends the turn immediately, without the post-review step; an unfinished verdict re-queues the outstanding work and the agent continues, with another verify after it settles. |
|
|
389
|
+
| `plan-verify` | Author a plan, review it once the work settles, then keep the post-review step only when it calls a tool. A no-tool answer is shown to you and ends the turn without being appended to the transcript. |
|
|
390
|
+
| `plan-verify-step` | The original behaviour: same plan + review, then always run one extra step and keep whatever that step says. |
|
|
318
391
|
| `open-plan` | The agent owns a plan document at `.mini/PLAN.md` inside `--allowed-dir`, reads and updates it with the normal file tools, and the loop neither authors nor reviews a plan. |
|
|
319
392
|
|
|
320
393
|
> [!NOTE]
|
|
321
394
|
> Plan mode also changes **history compaction**: after the transcript is compacted to a summary,
|
|
322
395
|
> `CURRENT_PLAN.md` and `CURRENT_GOAL.md` are re-injected, so the agent keeps working against the
|
|
323
396
|
> same goal. With `open-plan`, the agent's `.mini/PLAN.md` is re-injected instead. When the work
|
|
324
|
-
> looks done the plan is reviewed
|
|
325
|
-
> to you (except with
|
|
397
|
+
> looks done the plan is reviewed (or, with `plan-verify2`, verified with a DONE/INCOMPLETE
|
|
398
|
+
> verdict) and any outstanding task is re-queued before the agent returns to you (except with
|
|
399
|
+
> `open-plan`, unless `--strict-verify` is on).
|
|
400
|
+
|
|
401
|
+
`--strict-verify` makes the completion check evidence-based instead of trust-based. The verifier
|
|
402
|
+
must restate the goal as concrete requirements, cite the tool call/output that proves each one, and
|
|
403
|
+
mark missing or ambiguous evidence as unfinished. It applies to `plan-verify`, `plan-verify2` and
|
|
404
|
+
`plan-verify-step`, and with `open-plan` it adds a verification pass after the work settles without
|
|
405
|
+
taking ownership of the agent's plan document.
|
|
406
|
+
|
|
407
|
+
`--allow-nudge` adds a completion checkpoint to any plan strategy. When the model replies without
|
|
408
|
+
a tool call and the text does not explicitly say `DONE` / complete / finished, the loop appends a
|
|
409
|
+
short “continue with the next tool call, or reply DONE” message instead of immediately paying for a
|
|
410
|
+
plan review. `--nudge-limit N` controls how many nudges are allowed per text-only stop (default 1).
|
|
411
|
+
After the limit, the normal plan strategy takes over. This is useful for thinking models that tend
|
|
412
|
+
to emit an intermediate “let me do X” message and stop.
|
|
413
|
+
|
|
414
|
+
### Runtime recovery — `--runtime-strategy`
|
|
415
|
+
|
|
416
|
+
The runtime strategy decides what happens when tool use keeps failing. It is independent of plan
|
|
417
|
+
mode and applies to every turn:
|
|
418
|
+
|
|
419
|
+
| Strategy | What happens |
|
|
420
|
+
| --- | --- |
|
|
421
|
+
| `normal` (default) | No automatic prompts; the model sees tool errors and decides. |
|
|
422
|
+
| `prompt-change` | After three consecutive failures of the same call (same command/path/query) or of the same tool with different inputs, the loop injects: “You have tried TOOL N times and it failed. Rethink your approach and try something else.” It also shows the last failure. A success resets the streak; at most three prompts are issued per turn. |
|
|
423
|
+
| `prompt-change-plan` | The same prompt, then a fresh planning request for the current goal. In `open-plan` the loop injects the recovery plan but does not overwrite the agent's `.mini/PLAN.md`. |
|
|
424
|
+
|
|
425
|
+
Both recovery strategies are heuristics: they are meant to break repetitive command/tool loops
|
|
426
|
+
without changing the model's overall instruction. When `web_search`/`read_website` are available,
|
|
427
|
+
the prompt also tells the model to search the documentation or the web before retrying.
|
|
428
|
+
`runtime-strategy` and `strict-verify` are also available in `/settings`.
|
|
429
|
+
|
|
430
|
+
### Dynamic todo tracking — `--dynamic-todo-tracking`
|
|
431
|
+
|
|
432
|
+
This is separate from the scratchpad. It registers three structured tools and tells the agent to
|
|
433
|
+
keep a short checklist:
|
|
434
|
+
|
|
435
|
+
- `todo_write` replaces the list with a JSON array of `{"content", "status"}` objects;
|
|
436
|
+
- `todo_update` changes one item by id (`pending`, `in_progress`, `completed`);
|
|
437
|
+
- `todo_list` shows the current list.
|
|
438
|
+
|
|
439
|
+
The store is session-local (`<cache-dir>/<session-id>/todos.json`), not a project file, so it does
|
|
440
|
+
not pollute the worktree or a benchmark's filesystem checks. `/todo` shows it and `/todo clear`
|
|
441
|
+
empties it. A scratchpad remains useful for free-form notes; the todo list is for tracked,
|
|
442
|
+
verifiable steps.
|
|
443
|
+
|
|
444
|
+
### Images — `/image` and image-aware `read_file`
|
|
445
|
+
|
|
446
|
+
`/image PATH` stages a PNG/JPEG/WEBP/GIF for the next user message. The file is copied into the
|
|
447
|
+
session cache and the conversation stores a small reference, not base64; the bytes are resolved
|
|
448
|
+
into a data URI only when the request is built. `/image clear` drops staged images.
|
|
449
|
+
|
|
450
|
+
The agent's `read_file` is also image-aware: reading a supported image attaches it as an image
|
|
451
|
+
content block after the tool result. `read_file` still handles text as before. Images count toward
|
|
452
|
+
the context estimate and are flattened to `[image: name]` in plan/review/compaction prompts.
|
|
326
453
|
|
|
327
454
|
### Scratchpad — `--scratchpad`
|
|
328
455
|
|
|
@@ -397,26 +524,36 @@ Because a rollover leaves no trace in the transcript (the old turns really are g
|
|
|
397
524
|
console says in plain terms what happened — all of it without `--verbose`:
|
|
398
525
|
|
|
399
526
|
```
|
|
400
|
-
[!] Compacting the conversation: 42 messages -> a summary (51000 tokens in,
|
|
527
|
+
[!] Compacting the conversation: 42 messages -> a summary (51000 tokens in, 32768 reserved for the reply > 60000 budget). The current turn (1 message) is kept verbatim.
|
|
401
528
|
[!] Summary preview: The user asked for a token-based compaction trigger, then fixed ...
|
|
402
529
|
[!] Compacted history_0.json (42 messages) into a summary; history_1.json now starts with 3 messages (summary + 1 kept message).
|
|
403
530
|
```
|
|
404
531
|
|
|
405
532
|
So you can see *what* was folded away (a preview of the summary itself), *how much* (the
|
|
406
533
|
message count of the segment that was closed), *where it went* (`history_0.json` closed,
|
|
407
|
-
`history_1.json` started) and that nothing you just typed was lost.
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
534
|
+
`history_1.json` started) and that nothing you just typed was lost. The summary request is
|
|
535
|
+
itself size-bounded, so a single enormous tool output cannot make compaction overflow the
|
|
536
|
+
model's context window. If the summariser answers with an empty summary twice, or the call
|
|
537
|
+
fails, compaction falls back to a deterministic mechanical summary (the goal plus the newest
|
|
538
|
+
turns) and still rolls the segment over — keeping the over-long transcript would make every
|
|
539
|
+
later request fail.
|
|
411
540
|
|
|
412
541
|
### Exiting — the good-bye box
|
|
413
542
|
|
|
414
|
-
Quitting (`/quit`, `exit`, or EOF on stdin) saves the session
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
543
|
+
Quitting (`/quit`, `exit`, or EOF on stdin) saves the session, prints the centered
|
|
544
|
+
yellow Mini Code mark and tagline above the box, and then prints a short content-width
|
|
545
|
+
yellow box: the version, a sign-off, and what the session left behind — session id,
|
|
546
|
+
model, folder, the history segments on disk, how many turns were recorded, run duration,
|
|
547
|
+
token / call totals, background tasks cancelled on exit, and a `--load-last-session`
|
|
548
|
+
resume hint.
|
|
418
549
|
|
|
419
550
|
```
|
|
551
|
+
__ __ ___ _ _ ___ ___ ___ ___ ___
|
|
552
|
+
| \/ |_ _| \| |_ _| / __/ _ \| \| __|
|
|
553
|
+
| |\/| || || .` || | | (_| (_) | |) | _|
|
|
554
|
+
|_| |_|___|_|\_|___| \___\___/|___/|___|
|
|
555
|
+
a minimal coding agent CLI
|
|
556
|
+
|
|
420
557
|
╔══════════ MiniCodeCLI v0.1.1.2 - goodbye ═════════════════════╗
|
|
421
558
|
║ Goodbye, and thanks for using MiniCodeCLI! ║
|
|
422
559
|
║ ║
|
|
@@ -440,7 +577,10 @@ the old per-field `Token usage (this session)` block is printed above it as well
|
|
|
440
577
|
|
|
441
578
|
## Serving a model locally
|
|
442
579
|
|
|
443
|
-
|
|
580
|
+
For a one-GPU quick start, `scripts/run_model.sh` starts the small
|
|
581
|
+
`ornith-ai/Ornith-1.5-35B-A3B` checkpoint on port 30000 and waits for `/health`.
|
|
582
|
+
Edit its model/tensor-parallel line for a larger checkpoint. Tested with vLLM
|
|
583
|
+
v0.30 (tool calling enabled):
|
|
444
584
|
|
|
445
585
|
```bash
|
|
446
586
|
vllm serve ornith-ai/Ornith-1.5-397B-FP8 \
|
|
@@ -462,7 +602,7 @@ If you use `mini-code-cli` in your research or writing, please cite it:
|
|
|
462
602
|
author = {Rozanov, Nikolai},
|
|
463
603
|
title = {mini-code-cli: A minimal, dependency-light coding agent},
|
|
464
604
|
year = {2026},
|
|
465
|
-
version = {0.
|
|
605
|
+
version = {0.3.0.1},
|
|
466
606
|
howpublished = {\url{https://github.com/ai-nikolai/mini-code-cli}},
|
|
467
607
|
note = {A no-bloat, dependency-light agent CLI for experimenting.}
|
|
468
608
|
}
|