1bcoder 0.1.4__tar.gz → 0.1.5__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.
- {1bcoder-0.1.4 → 1bcoder-0.1.5/1bcoder.egg-info}/PKG-INFO +219 -20
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/1bcoder.egg-info/SOURCES.txt +6 -1
- 1bcoder-0.1.4/README.md → 1bcoder-0.1.5/PKG-INFO +233 -19
- 1bcoder-0.1.4/1bcoder.egg-info/PKG-INFO → 1bcoder-0.1.5/README.md +1628 -1444
- 1bcoder-0.1.5/_bcoder_data/doc/OLLAMA_SERVER_PARAM.md +170 -0
- 1bcoder-0.1.5/_bcoder_data/proc/md.py +22 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/proc/mdx.py +11 -1
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/profiles.txt +7 -0
- 1bcoder-0.1.5/_bcoder_data/scripts/simargl-cli_index_files.txt +3 -0
- 1bcoder-0.1.5/_bcoder_data/scripts/simargl-cli_index_units.txt +3 -0
- 1bcoder-0.1.5/_bcoder_data/scripts/simargl-cli_search.txt +4 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/chat.py +8302 -7396
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/map_index.py +1 -1
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/pyproject.toml +1 -1
- 1bcoder-0.1.5/tests/test_utils.py +143 -0
- 1bcoder-0.1.4/_bcoder_data/proc/md.py +0 -14
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/1bcoder.egg-info/dependency_links.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/1bcoder.egg-info/entry_points.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/1bcoder.egg-info/requires.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/1bcoder.egg-info/top_level.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/LICENSE +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/__init__.py +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/agents/advance.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/agents/ask.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/agents/compact.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/agents/concepts.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/agents/fill.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/agents/planning.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/agents/scan.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/agents/sqlite.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/aliases.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/doc/MCP.md +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/doc/PARAM.md +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/doc/PROC.md +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/map.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/proc/action-required.py +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/proc/add-save.py +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/proc/assist.py +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/proc/collect-files.py +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/proc/ctx_cut.py +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/proc/extract-code.py +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/proc/extract-files.py +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/proc/extract-list.py +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/proc/grounding-check.py +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/proc/pattern-gate.py +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/proc/regexp-extract.py +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/proc/rude_words.py +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/proc/scan-save.py +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/proc/secret_check.py +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/proc/sql_readonly_guard.py +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/proc/tempctx-cut.py +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/prompts/analysis.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/prompts/sumarise.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/prompts.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/AddFunction.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/AskProject.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/CheckRequirements.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/DockerMySQL.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/DockerNginx.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/DockerPython.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/DockerStack.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/DuckDuckGoInstant.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/EnvTemplate.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/Explain.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/ExploreProjectStructure.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/GitIgnorePython.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/MySQLDump.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/NewScript.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/PipFreeze.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/PyPI.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/Refactor.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/RunAndFix.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/SQLiteSchema.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/WikiPage.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/WikiSearch.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/auto-bkup.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/edit-control.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/parallel_call.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/personal/content/create-regular-content.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/personal/content/plan.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/personal/test/collect-data-from-test-environment.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/plan.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/remote/create-content-on-remote-server.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/set_ctx.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/team-map-worker.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/team-search-worker.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/team-summarize.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/team-tree-worker.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/scripts/test.txt +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/_bcoder_data/teams/code-analysis.yaml +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/map_query.py +0 -0
- {1bcoder-0.1.4 → 1bcoder-0.1.5}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: 1bcoder
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Summary: AI coding assistant agent for 1B–7B local models (Ollama, LMStudio, llama.cpp). Terminal REPL with file editing, project map, agents, scripts, and parallel multi-model queries.
|
|
5
5
|
Project-URL: Homepage, https://github.com/szholobetsky/1bcoder
|
|
6
6
|
Project-URL: Repository, https://github.com/szholobetsky/1bcoder
|
|
@@ -15,15 +15,70 @@ Dynamic: license-file
|
|
|
15
15
|
|
|
16
16
|
# 1bcoder
|
|
17
17
|
|
|
18
|
-
AI coding assistant
|
|
18
|
+
AI coding assistant for small local models (0.5B–4B) — runs via [Ollama](https://ollama.com), [LMStudio](https://lmstudio.ai), or any OpenAI-compatible backend.
|
|
19
19
|
|
|
20
20
|
---
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
## The problem
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Small local models are widely available. Most users interact with them through a chat UI — and that works well for quick questions. But chat has hard limits: you cannot feed it a 2000-line log file, cannot ask it to run the tests and read the output, cannot have it walk through a large codebase one chunk at a time. For that kind of work you need an agentic system.
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
The problem is that every existing agentic system assumes a capable model underneath — typically 8B+ with native tool-calling support. Their system prompts alone consume more tokens than a 1B model's entire context window. Their tool-calling protocols are complex enough that small models hallucinate the format, miss instructions, or loop. So small models are treated as unusable and left out entirely.
|
|
27
|
+
|
|
28
|
+
This is wrong. Small and very small models are genuinely useful — they just require a different kind of tool.
|
|
29
|
+
|
|
30
|
+
## Privacy and security
|
|
31
|
+
|
|
32
|
+
Every prompt you send to a cloud-based AI assistant leaves your machine. Your code, your architecture decisions, your internal API names, your database schemas, your business logic — all of it travels to a third-party server, is logged, may be used for training, and is subject to the data retention policies of a company you don't control.
|
|
33
|
+
|
|
34
|
+
For personal projects this is an acceptable tradeoff. For professional work it rarely is. Most employment contracts prohibit sending proprietary code to external services. Many industries (finance, healthcare, defense, government) have regulatory requirements that make cloud AI assistance legally problematic or outright forbidden. Even where there is no explicit rule, leaking internal architecture to a vendor is a security risk that most engineering teams would not accept from any other tool.
|
|
35
|
+
|
|
36
|
+
1bcoder runs entirely on your hardware. The model runs locally. No prompt leaves your machine. No API key, no telemetry, no network connection required. Your code stays where it is — in your editor, on your filesystem, behind your firewall.
|
|
37
|
+
|
|
38
|
+
This is not a niche concern. It is the default requirement for any serious professional environment.
|
|
39
|
+
|
|
40
|
+
## What different model sizes can actually do
|
|
41
|
+
|
|
42
|
+
| Size | Reliable in 1bcoder |
|
|
43
|
+
|---|---|
|
|
44
|
+
| 0.5b | Explain a 10–20 line function; identify a known technology from a file name; write a standard construct in an unfamiliar language |
|
|
45
|
+
| 1b | Explain a full module; recognize a tech stack from a directory tree; answer questions about error messages and short log excerpts |
|
|
46
|
+
| 1b thinking | Explain whole-file logic; identify design patterns across a module — still unreliable for editing |
|
|
47
|
+
| 2b–4b | Edit files under instruction; write new functions; follow SEARCH/REPLACE format consistently |
|
|
48
|
+
|
|
49
|
+
Every tier is useful. Each requires a different approach to context preparation. 1bcoder provides the tools to do that preparation with surgical precision.
|
|
50
|
+
|
|
51
|
+
## How 1bcoder works
|
|
52
|
+
|
|
53
|
+
1bcoder does not depend on the model for navigation or file selection. The programmer controls what goes into context — using a command system to read files, inject logs, run shell commands, and prepare input before asking the model a question. The model's job is a single bounded subtask on pre-prepared input, not autonomous exploration.
|
|
54
|
+
|
|
55
|
+
This is **human-directed** work: the programmer covers what the small model cannot do, and the model handles what it actually does well.
|
|
56
|
+
|
|
57
|
+
Key design decisions:
|
|
58
|
+
|
|
59
|
+
- **Short agent system prompts, at most 5 tools per agent, one function per agent** — `ask`, `edit`, `fill`, `scan`, `compact`. Not universal agents with bloated skill sets.
|
|
60
|
+
- **Tolerant of long and malformed output** — post-processing is automatic; the programmer does not teach the model JSON syntax.
|
|
61
|
+
- **`/parallel`** — send the same context to several models simultaneously and combine results; a 0.5b and a 1b model working together often outperform either alone; designed to coordinate small models running on multiple machines or phones.
|
|
62
|
+
- **`/map`** — project structure index with structural diff; lets the model navigate a codebase without loading it into context.
|
|
63
|
+
- **`/ctx`** — surgical context management: savepoints, selective compaction, named context library, multi-turn rollback. Small models cannot afford wasted tokens.
|
|
64
|
+
- **`/scan`** — reads any large file chunk by chunk and builds a themed summary without overflowing context.
|
|
65
|
+
- **`/proc`** — parameterized command scripts for repeatable preparation workflows.
|
|
66
|
+
|
|
67
|
+
The combination is what matters: commands to build context precisely, agents scoped to one task, and parallel queries to cover what any single small model misses.
|
|
68
|
+
|
|
69
|
+
## The autonomy tradeoff
|
|
70
|
+
|
|
71
|
+
Most agent system developers aim for full autonomy: the agent reads the task, explores the codebase, writes the code, runs the tests, and ships — without human involvement. Full autonomy is a legitimate goal. It also requires the largest possible models: GPT-4-class or 70B+ locally, with long context, reliable tool-calling, and robust reasoning under uncertainty. Below that threshold, fully autonomous agents fail in ways that are hard to predict and slow to debug.
|
|
72
|
+
|
|
73
|
+
1bcoder takes the opposite side of this tradeoff deliberately.
|
|
74
|
+
|
|
75
|
+
We accept that the agent will only be partly autonomous. With a 4B model you can run `/agent ask` safely — it explores, reads, and reports, but does not edit. With a 1.5B model the agent loop is unreliable; use it for single bounded tasks with a clear success criterion. With a 0.5B model there is no autonomous loop at all — but the model is still useful for explaining a function, identifying a pattern, or generating a boilerplate construct when you hand it the exact 15 lines it needs.
|
|
76
|
+
|
|
77
|
+
**Partial autonomy is not a failure mode. It is the design.**
|
|
78
|
+
|
|
79
|
+
The programmer stays in the loop — confirming actions, choosing which files to load, deciding when the model is confused and needs a narrower question. This is not a weakness to be engineered away. It is the honest recognition that small models are precise tools, not general reasoners, and that the programmer's judgment is part of the system.
|
|
80
|
+
|
|
81
|
+
The payoff: 1bcoder works offline, on a laptop, on a phone, on hardware you already own. No subscription. No API key. No 30-second round trips. The model that runs on your machine right now — however small — is enough to start.
|
|
27
82
|
|
|
28
83
|
---
|
|
29
84
|
|
|
@@ -69,32 +124,34 @@ Tasks that require the model to decide *what to look at* — refactoring across
|
|
|
69
124
|
## Features
|
|
70
125
|
|
|
71
126
|
- Plain terminal REPL — works in any shell, IDE terminal, or SSH session; status line before each prompt shows active model, disk size, quantization, native context limit, and context fill %
|
|
72
|
-
- **`/read`** injects files without line numbers (clean text, ideal for `notes.txt` and structured data); **`/readln`** injects with line numbers (use before `/fix` or `/patch` when line references matter)
|
|
127
|
+
- **`/read`** injects files without line numbers (clean text, ideal for `notes.txt` and structured data); **`/readln`** injects with line numbers (use before `/fix` or `/patch` when line references matter); both accept comma- or space-separated file lists — use directly with `{{find_files}}` or `{{map_files}}` captured from `/find` or `/map find`
|
|
73
128
|
- **Command autocorrection** — typos in command names, file paths, and keywords are detected and fixed automatically before execution, for both human input and agent actions
|
|
74
129
|
- **`/tree [path]`** — display directory tree of the whole project or any subtree; ask to inject into context (or pass `ctx` to skip the prompt)
|
|
75
|
-
- **`/find <pattern>`** — search filenames and file content with regex; supports `-f`/`-c`/`-i`/`--ext` flags; highlights matches, asks to inject results into context
|
|
130
|
+
- **`/find <pattern>`** — search filenames and file content with regex; supports `-f`/`-c`/`-i`/`--ext` flags; highlights matches, asks to inject results into context; sets `{{find_files}}` after every search; **`/find <terms> -r`** ranked BM25 mode returns top-10 files by relevance; hidden directories (`.git`, `.venv`, etc.) excluded automatically
|
|
76
131
|
- AI proposes a **one-line fix** (`/fix`) or a **SEARCH/REPLACE patch** (`/patch`) — always shows a diff before applying
|
|
77
132
|
- **Apply AI code blocks directly** with `/edit <file> code` (new/full file) or `/patch <file> code` (SEARCH/REPLACE from reply, no line numbers needed) — preferred for agent mode
|
|
78
133
|
- **`<think>` tag support** — reasoning blocks shown in terminal by default; `/think hide` suppresses terminal display; `/think include` keeps reasoning in context for chained turns
|
|
79
134
|
- Run shell commands and inject their output with `/run`
|
|
80
135
|
- Save AI replies to files with `/save` (code-fence stripping, multiple files, append modes)
|
|
81
|
-
- **Session persistence** — `/ctx save` / `/ctx load` dump and restore full conversations; `/ctx list` browses the `.1bcoder/ctx/` project context library; `/ctx compact` summarizes and compresses the context via AI; `/ctx savepoint` marks a position for rollback or selective compaction; `/ctx clear N` drops the last N messages
|
|
82
|
-
- **
|
|
136
|
+
- **Session persistence** — `/ctx save` / `/ctx load` dump and restore full conversations; `/ctx list` browses the `.1bcoder/ctx/` project context library; `/ctx compact` summarizes and compresses the context via AI; `/ctx compact N` compacts last N messages in place; `/ctx savepoint` marks a position for rollback or selective compaction; `/ctx clear N` drops the last N messages
|
|
137
|
+
- **Context composer** — `/ctx compose` builds a merged context from multiple saved ctx files with content-level dedup (identical message blocks appear once); workflow: `/proj find` → numbered results → `/ctx compose add N,M` → `/ctx compose run task.ctx` → `/ctx load task.ctx`
|
|
138
|
+
- **Scripts** — reusable sequences of commands stored as `.txt` files; `/script run <file> [key=value ...]` runs all steps automatically; `/script apply` runs step-by-step with Y/n confirmation
|
|
83
139
|
- **Script from history** — `/script create ctx` captures this session's commands into a reusable script automatically
|
|
84
|
-
- **Project map** — scan any codebase into a searchable index (`/map index`), query it (`/map find`), trace call chains (`/map trace`), and diff changes (`/map idiff`) — now includes `ORPHAN_DRIFT` alert (dead code delta) and `GHOST ALERT` (deleted file that other files depended on)
|
|
140
|
+
- **Project map** — scan any codebase into a searchable index (`/map index`), query it (`/map find`), trace call chains (`/map trace`), and diff changes (`/map idiff`) — now includes `ORPHAN_DRIFT` alert (dead code delta) and `GHOST ALERT` (deleted file that other files depended on); `/map find` sets `{{map_files}}` after every hit; hidden directories excluded from indexing
|
|
85
141
|
- **Ask mode** — `/ask <question>` is an alias for `/agent ask`: a read-only research loop for 4B models that explores the project with tree/find/map tools, never edits files, auto-truncates large results to protect context
|
|
86
142
|
- **Agent mode** — `/agent <task>` runs an autonomous loop; stops when the model outputs plain text with no ACTION; after the loop a `[s]ummary / [a]ll / [n]one` prompt lets you pull agent results into main context
|
|
87
143
|
- **Named agents** — define custom agents in `.1bcoder/agents/<name>.txt` (system prompt, tools, max_turns, aliases, `on_done`, `params`, `before`, `gates`); call with `/agent <name> task` or `/<name> task` directly; agent-scoped aliases active only during that run
|
|
88
144
|
- **`/plan <goal>`** — planning agent: researches the project, writes a natural-language step-by-step plan to `plan.txt`; run `/agent <task> file: plan.txt` to execute it step by step
|
|
89
145
|
- **`/fill`** — fill agent: reads NaN session variables, scans project for `.var` files and config files, sets each value automatically
|
|
90
146
|
- **Session variables** — `{{name}}` placeholders substituted in any command; save/load from `.var` files for offline reuse without loading files into context
|
|
91
|
-
- **Project
|
|
147
|
+
- **Project context** — `/proj set <key>` creates `.1bcoder/projects/<key>/` with `project.txt` (description, keywords, file list); `/proj save`, `/proj find`, `/proj keyword add`, `/proj file add`, `/proj index` (regex-extracts file paths from saved ctx files); active project saved in config and auto-restored on next startup
|
|
148
|
+
- **Project config** — `/config save` persists session state (host, model, ctx, params, vars, procs, active project) to `.1bcoder/config.yml`; `/config save global` saves to `~/.1bcoder/config.yml`; on startup, the first config with `auto: true` (local → global) is applied automatically
|
|
92
149
|
- **Aliases** — define command shortcuts with `/alias /name = expansion` (supports `{{args}}`); persisted in `aliases.txt`; loaded from global then project directory at startup and survive `/clear`
|
|
93
150
|
- **Backup/restore** — `/bkup save` rotates existing backups (`file.bkup` → `file.bkup(1)`, `file.bkup(2)`…) so no snapshot is ever overwritten; `/bkup restore` always restores the latest
|
|
94
151
|
- **`/tempctx`** — agent-internal context control: `/tempctx N` sets a private token budget, `/tempctx cut` removes oldest messages, `/tempctx clear` resets to system+task, `/tempctx show` prints size; only active inside an agent loop so agents can't touch the main context; also settable via `params = agent_ctx = N` in agent files
|
|
95
152
|
- **Agent proc hooks** — `before =` (runs before every LLM call, injects output as `[context]`) and `gates =` (runs after every reply, `FAIL:` retries the current plan step); enables supervised loops, convention enforcement, and hallucination checks without changing the model
|
|
96
153
|
- **`/scan <file> <theme>`** — named agent that reads any file chunk by chunk, extracts info relevant to a theme, and builds a summary in `.1bcoder/scan_result.txt`; uses `/tempctx cut` between chunks so the agent context never overflows; result is injected into main context at the end
|
|
97
|
-
- **MCP support** — connect external tool servers (filesystem, web, git, database, browser…) via the Model Context Protocol
|
|
154
|
+
- **MCP support** — connect external tool servers (filesystem, web, git, database, browser…) via the Model Context Protocol; `/mcp connect <name> <command> [--cwd <dir>]` launches the server subprocess with an optional working directory override
|
|
98
155
|
- **Parallel queries** — send prompts to multiple models simultaneously with `/parallel`; control context sent (`--ctx`/`--last`/`--no-ctx`) and route replies back into main context (`ctx` output) for sub-agent workflows
|
|
99
156
|
- **Command hooks** — `/hook before|after <cmd> <script>` runs a script before or after edit/patch/fix/insert; `before` hook cancels the command if the script is missing; `{{file}}` and `{{range}}` injected automatically
|
|
100
157
|
- Switch model or host at runtime without restarting (`/model gemma3:1b`, `/host openai://localhost:1234`)
|
|
@@ -595,7 +652,7 @@ tools =
|
|
|
595
652
|
|
|
596
653
|
### Named agents
|
|
597
654
|
|
|
598
|
-
Custom agents are defined in `.1bcoder/agents/<name>.txt` (project-local) or
|
|
655
|
+
Custom agents are defined in `.1bcoder/agents/<name>.txt` (project-local) or `~/.1bcoder/agents/<name>.txt` (global). Local files override global ones. Call them with `/agent <name> task` or directly as `/<name> task`.
|
|
599
656
|
|
|
600
657
|
**Agent file format:**
|
|
601
658
|
|
|
@@ -782,6 +839,7 @@ Lines starting with `[v]` are already done and skipped. Lines starting with `#`
|
|
|
782
839
|
| `/script reset` | Unmark all done steps (also happens automatically when a script runs to completion) |
|
|
783
840
|
| `/script reapply [key=value ...]` | Reset all done steps then apply automatically; prompts for any NaN `{{variables}}` before running |
|
|
784
841
|
| `/script refresh` | Reload script from disk and show contents |
|
|
842
|
+
| `/script run <file> [key=value ...]` | **Run all steps automatically** — shorthand for `apply -y` |
|
|
785
843
|
| `/script apply [file] [key=value ...]` | Run steps one by one (Y/n/q per step) |
|
|
786
844
|
| `/script apply -y [file] [key=value ...]` | Run all pending steps automatically |
|
|
787
845
|
|
|
@@ -807,7 +865,8 @@ what is wrong in lines {{range}}?
|
|
|
807
865
|
```
|
|
808
866
|
|
|
809
867
|
```
|
|
810
|
-
/script
|
|
868
|
+
/script run fix-fn.txt file=calc.py range=1-4 hint="wrong operator"
|
|
869
|
+
/script apply fix-fn.txt file=calc.py range=1-4 # same but asks Y/n per step
|
|
811
870
|
```
|
|
812
871
|
|
|
813
872
|
Run a script non-interactively from the command line:
|
|
@@ -961,7 +1020,119 @@ procs:
|
|
|
961
1020
|
- collect-files output.txt
|
|
962
1021
|
```
|
|
963
1022
|
|
|
964
|
-
When `auto: true`, host and model are used at startup to connect; ctx, params, vars, and
|
|
1023
|
+
When `auto: true`, host and model are used at startup to connect; ctx, params, vars, procs, and active project are also restored.
|
|
1024
|
+
|
|
1025
|
+
---
|
|
1026
|
+
|
|
1027
|
+
### Project management (`/proj`)
|
|
1028
|
+
|
|
1029
|
+
Track ctx files and notes per project ticket, feature branch, or work item — stored locally in `.1bcoder/projects/` relative to the working directory. Each project has a human-editable `project.txt` with description, keywords, and file list.
|
|
1030
|
+
|
|
1031
|
+
```
|
|
1032
|
+
/proj set ABC-123 # activate project (creates .1bcoder/projects/ABC-123/)
|
|
1033
|
+
/proj set role-impl # any valid folder name works
|
|
1034
|
+
/proj status # show active project and project.txt
|
|
1035
|
+
/proj list # all projects, newest first (* = active)
|
|
1036
|
+
```
|
|
1037
|
+
|
|
1038
|
+
**Save and browse ctx files:**
|
|
1039
|
+
```
|
|
1040
|
+
/proj save session1.txt # save current ctx to .1bcoder/projects/ABC-123/session1.txt
|
|
1041
|
+
/proj show # list ctx files in active project (newest first)
|
|
1042
|
+
/proj load session1.txt # load ctx file from active project (path resolved automatically)
|
|
1043
|
+
```
|
|
1044
|
+
|
|
1045
|
+
**Annotate with keywords and files:**
|
|
1046
|
+
```
|
|
1047
|
+
/proj keyword add ppcon, payment, legacy
|
|
1048
|
+
/proj file add models.py, views.py, finance/amort.py
|
|
1049
|
+
```
|
|
1050
|
+
|
|
1051
|
+
**Index file paths from saved ctx files** (extracts from `/read`, `/edit`, `/patch`, `/save`, `/insert` command args):
|
|
1052
|
+
```
|
|
1053
|
+
/proj index
|
|
1054
|
+
```
|
|
1055
|
+
|
|
1056
|
+
**Search across all projects** in current working directory:
|
|
1057
|
+
```
|
|
1058
|
+
/proj find payment # fast: search project.txt + ctx filenames (default)
|
|
1059
|
+
/proj find payment -f # same as above (explicit)
|
|
1060
|
+
/proj find payment -c # content: also grep inside ctx files with line numbers
|
|
1061
|
+
```
|
|
1062
|
+
|
|
1063
|
+
`-f` output (compact):
|
|
1064
|
+
```
|
|
1065
|
+
ABC-123 — keywords: payment | role-impl — ctx: payment_flow.txt
|
|
1066
|
+
```
|
|
1067
|
+
|
|
1068
|
+
`-c` output (with content):
|
|
1069
|
+
```
|
|
1070
|
+
ABC-123 — keywords: payment
|
|
1071
|
+
[project: role-impl]
|
|
1072
|
+
[ctx: user_action_flow.txt]
|
|
1073
|
+
1021: system highlight current payment in the grid
|
|
1074
|
+
1122: when user request payment
|
|
1075
|
+
```
|
|
1076
|
+
|
|
1077
|
+
**Persist active project** — included in `/config save`, auto-restored on next startup:
|
|
1078
|
+
```
|
|
1079
|
+
/proj set ABC-123
|
|
1080
|
+
/config save
|
|
1081
|
+
# next startup: [proj] ABC-123
|
|
1082
|
+
```
|
|
1083
|
+
|
|
1084
|
+
**`project.txt` format** (human-editable):
|
|
1085
|
+
```
|
|
1086
|
+
Description: Fix amortization calculation in legacy Oracle module
|
|
1087
|
+
Keywords: ppcon, payment, legacy
|
|
1088
|
+
Files:
|
|
1089
|
+
models.py
|
|
1090
|
+
finance/amort.py
|
|
1091
|
+
views.py
|
|
1092
|
+
```
|
|
1093
|
+
|
|
1094
|
+
---
|
|
1095
|
+
|
|
1096
|
+
### Context composer (`/ctx compose`)
|
|
1097
|
+
|
|
1098
|
+
Build a merged context from multiple saved ctx files. Identical message blocks appear only once (content-level dedup) — shared tree/read results from different ctx files are merged into one root, then unique branches are appended.
|
|
1099
|
+
|
|
1100
|
+
**Workflow with `/proj find`:**
|
|
1101
|
+
```
|
|
1102
|
+
/proj find isbn # search projects — results numbered [1], [2], ...
|
|
1103
|
+
/ctx compose add 1,3 # add result #1 and #3 to queue
|
|
1104
|
+
/ctx compose add all # or add all results
|
|
1105
|
+
/ctx compose list # review: filename, size, accumulated total
|
|
1106
|
+
/ctx compose run task.ctx # merge → task.ctx (dedup applied)
|
|
1107
|
+
/ctx load task.ctx # load — LLM wakes up knowing all branches
|
|
1108
|
+
```
|
|
1109
|
+
|
|
1110
|
+
**Direct compose (no queue):**
|
|
1111
|
+
```
|
|
1112
|
+
/ctx compose book-html.txt models.txt requirements.txt
|
|
1113
|
+
```
|
|
1114
|
+
If no output file given with `run`, merges directly into current context.
|
|
1115
|
+
|
|
1116
|
+
**Path resolution** — bare filename is resolved automatically:
|
|
1117
|
+
1. `.1bcoder/ctx/<name>`
|
|
1118
|
+
2. `.1bcoder/projects/<active_key>/<name>`
|
|
1119
|
+
3. full path as-is
|
|
1120
|
+
|
|
1121
|
+
**Queue commands:**
|
|
1122
|
+
```
|
|
1123
|
+
/ctx compose add <file> add file to queue
|
|
1124
|
+
/ctx compose add 1,2,3 add by number from last /proj find
|
|
1125
|
+
/ctx compose add all add all /proj find results
|
|
1126
|
+
/ctx compose list show queue with sizes and running total
|
|
1127
|
+
/ctx compose clear clear queue
|
|
1128
|
+
/ctx compose run [out.txt] merge and write (or load into context)
|
|
1129
|
+
```
|
|
1130
|
+
|
|
1131
|
+
**`/ctx compact N`** — compact last N messages in place without touching the rest:
|
|
1132
|
+
```
|
|
1133
|
+
/ctx compact 1 # the LLM wrote 800 tokens — compress that one reply
|
|
1134
|
+
/ctx compact 3 # compress last 3 messages into one block
|
|
1135
|
+
```
|
|
965
1136
|
|
|
966
1137
|
---
|
|
967
1138
|
|
|
@@ -970,12 +1141,14 @@ When `auto: true`, host and model are used at startup to connect; ctx, params, v
|
|
|
970
1141
|
Connect external tool servers to give the AI access to filesystems, databases, web pages, and more.
|
|
971
1142
|
|
|
972
1143
|
```
|
|
973
|
-
/mcp connect <name> <command>
|
|
1144
|
+
/mcp connect <name> <command> [--cwd <dir>]
|
|
974
1145
|
/mcp tools [name]
|
|
975
|
-
/mcp call <server/tool>
|
|
1146
|
+
/mcp call <server/tool> {json_args}
|
|
976
1147
|
/mcp disconnect <name>
|
|
977
1148
|
```
|
|
978
1149
|
|
|
1150
|
+
`--cwd <dir>` sets the working directory for the subprocess — useful when the MCP server needs to find files relative to a specific project root.
|
|
1151
|
+
|
|
979
1152
|
```
|
|
980
1153
|
/mcp connect fs npx -y @modelcontextprotocol/server-filesystem .
|
|
981
1154
|
/mcp connect web uvx mcp-server-fetch
|
|
@@ -984,6 +1157,30 @@ Connect external tool servers to give the AI access to filesystems, databases, w
|
|
|
984
1157
|
/mcp disconnect fs
|
|
985
1158
|
```
|
|
986
1159
|
|
|
1160
|
+
**simargl** — semantic file search via task/commit history (see [simargl](https://github.com/szholobetsky/simargl)):
|
|
1161
|
+
|
|
1162
|
+
```bash
|
|
1163
|
+
pip install simargl
|
|
1164
|
+
cd C:/Project/my-app
|
|
1165
|
+
simargl index files .
|
|
1166
|
+
```
|
|
1167
|
+
|
|
1168
|
+
```
|
|
1169
|
+
# connect once per session (model loads here, ~30-60s first time)
|
|
1170
|
+
/mcp connect simargl simargl-mcp
|
|
1171
|
+
|
|
1172
|
+
# search — instant after connect
|
|
1173
|
+
/mcp call simargl/find {"query": "add author field to book class", "mode": "file"}
|
|
1174
|
+
|
|
1175
|
+
# or use the built-in script
|
|
1176
|
+
/script run simargl-find.txt query="add author field to book class" mode=file
|
|
1177
|
+
```
|
|
1178
|
+
|
|
1179
|
+
If you used a custom `--project` at index time, pass it at connect:
|
|
1180
|
+
```
|
|
1181
|
+
/mcp connect simargl simargl-mcp --project-id bookcrossing
|
|
1182
|
+
```
|
|
1183
|
+
|
|
987
1184
|
See `/doc MCP` for a full list of ready-to-use servers.
|
|
988
1185
|
|
|
989
1186
|
---
|
|
@@ -1122,9 +1319,10 @@ Save any useful message as a reusable template and load it later with `{{param}}
|
|
|
1122
1319
|
```
|
|
1123
1320
|
/prompt save ConvertJavaToPy # saves last user message as ConvertJavaToPy.txt
|
|
1124
1321
|
/prompt load # numbered list, select by number, fill {{params}} interactively
|
|
1322
|
+
/prompt load 2 # load prompt #2 directly, skipping the selection prompt
|
|
1125
1323
|
```
|
|
1126
1324
|
|
|
1127
|
-
Templates stored in
|
|
1325
|
+
Templates stored in `~/.1bcoder/prompts.txt` (one entry per line: `name: text`). Use `{{keyword}}` placeholders — values are prompted interactively on load.
|
|
1128
1326
|
|
|
1129
1327
|
---
|
|
1130
1328
|
|
|
@@ -1227,7 +1425,7 @@ workers:
|
|
|
1227
1425
|
/script apply team-summarize.txt --param keyword=auth --param task="404 on login"
|
|
1228
1426
|
```
|
|
1229
1427
|
|
|
1230
|
-
Built-in team scripts in
|
|
1428
|
+
Built-in team scripts in `~/.1bcoder/scripts/`:
|
|
1231
1429
|
|
|
1232
1430
|
| Script | Worker role |
|
|
1233
1431
|
|---|---|
|
|
@@ -1251,7 +1449,8 @@ Built-in team scripts in `<install>/.1bcoder/scripts/`:
|
|
|
1251
1449
|
| `/ctx clear <n>` | Remove last N messages from context |
|
|
1252
1450
|
| `/ctx cut` | Remove oldest messages until context fits |
|
|
1253
1451
|
| `/ctx compact` | Ask AI to summarize the conversation, replace context with summary |
|
|
1254
|
-
| `/ctx
|
|
1452
|
+
| `/ctx compact <N>` | Summarize last N messages in place, replace with one compact block |
|
|
1453
|
+
| `/ctx save <file>` | Save full conversation to file (global ctx folder) |
|
|
1255
1454
|
| `/ctx load <file>` | Restore a saved conversation (bare name resolved from `.1bcoder/ctx/`) |
|
|
1256
1455
|
| `/ctx list` | List files in `.1bcoder/ctx/` project context library |
|
|
1257
1456
|
| `/ctx savepoint set` | Mark current position as a savepoint |
|
|
@@ -24,6 +24,7 @@ _bcoder_data/agents/planning.txt
|
|
|
24
24
|
_bcoder_data/agents/scan.txt
|
|
25
25
|
_bcoder_data/agents/sqlite.txt
|
|
26
26
|
_bcoder_data/doc/MCP.md
|
|
27
|
+
_bcoder_data/doc/OLLAMA_SERVER_PARAM.md
|
|
27
28
|
_bcoder_data/doc/PARAM.md
|
|
28
29
|
_bcoder_data/doc/PROC.md
|
|
29
30
|
_bcoder_data/proc/action-required.py
|
|
@@ -72,6 +73,9 @@ _bcoder_data/scripts/edit-control.txt
|
|
|
72
73
|
_bcoder_data/scripts/parallel_call.txt
|
|
73
74
|
_bcoder_data/scripts/plan.txt
|
|
74
75
|
_bcoder_data/scripts/set_ctx.txt
|
|
76
|
+
_bcoder_data/scripts/simargl-cli_index_files.txt
|
|
77
|
+
_bcoder_data/scripts/simargl-cli_index_units.txt
|
|
78
|
+
_bcoder_data/scripts/simargl-cli_search.txt
|
|
75
79
|
_bcoder_data/scripts/team-map-worker.txt
|
|
76
80
|
_bcoder_data/scripts/team-search-worker.txt
|
|
77
81
|
_bcoder_data/scripts/team-summarize.txt
|
|
@@ -81,4 +85,5 @@ _bcoder_data/scripts/personal/content/create-regular-content.txt
|
|
|
81
85
|
_bcoder_data/scripts/personal/content/plan.txt
|
|
82
86
|
_bcoder_data/scripts/personal/test/collect-data-from-test-environment.txt
|
|
83
87
|
_bcoder_data/scripts/remote/create-content-on-remote-server.txt
|
|
84
|
-
_bcoder_data/teams/code-analysis.yaml
|
|
88
|
+
_bcoder_data/teams/code-analysis.yaml
|
|
89
|
+
tests/test_utils.py
|