anixcode 0.8.0__tar.gz → 0.10.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 (54) hide show
  1. {anixcode-0.8.0 → anixcode-0.10.0}/PKG-INFO +272 -241
  2. {anixcode-0.8.0 → anixcode-0.10.0}/README.md +48 -18
  3. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/__init__.py +1 -1
  4. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/agent.py +68 -37
  5. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/cli.py +21 -2
  6. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/commands.py +16 -6
  7. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/compaction.py +45 -7
  8. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/i18n_en.py +60 -1
  9. anixcode-0.10.0/anixcode/images.py +331 -0
  10. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/llm.py +5 -0
  11. anixcode-0.10.0/anixcode/mcp.py +596 -0
  12. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/mentions.py +48 -14
  13. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/settings.py +4 -0
  14. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/storage.py +5 -1
  15. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/tools/base.py +1 -1
  16. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/tools/files.py +5 -4
  17. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/tools/search.py +5 -4
  18. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/tui/anim.py +24 -23
  19. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/tui/app.py +285 -19
  20. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/tui/app.tcss +13 -0
  21. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/tui/screens.py +6 -6
  22. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/tui/widgets.py +84 -7
  23. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode.egg-info/PKG-INFO +272 -241
  24. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode.egg-info/SOURCES.txt +4 -0
  25. {anixcode-0.8.0 → anixcode-0.10.0}/pyproject.toml +4 -3
  26. {anixcode-0.8.0 → anixcode-0.10.0}/setup.cfg +4 -4
  27. {anixcode-0.8.0 → anixcode-0.10.0}/tests/test_i18n.py +4 -4
  28. anixcode-0.10.0/tests/test_images.py +203 -0
  29. anixcode-0.10.0/tests/test_mcp.py +233 -0
  30. {anixcode-0.8.0 → anixcode-0.10.0}/tests/test_reliability.py +1 -1
  31. {anixcode-0.8.0 → anixcode-0.10.0}/LICENSE +0 -0
  32. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/__main__.py +0 -0
  33. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/airpc.py +0 -0
  34. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/checkpoints.py +0 -0
  35. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/danger.py +0 -0
  36. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/i18n.py +0 -0
  37. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/projects.py +0 -0
  38. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/prompts.py +0 -0
  39. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/providers.py +0 -0
  40. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/tools/__init__.py +0 -0
  41. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/tools/shell.py +0 -0
  42. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode/tui/__init__.py +0 -0
  43. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode.egg-info/dependency_links.txt +0 -0
  44. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode.egg-info/entry_points.txt +0 -0
  45. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode.egg-info/requires.txt +0 -0
  46. {anixcode-0.8.0 → anixcode-0.10.0}/anixcode.egg-info/top_level.txt +0 -0
  47. {anixcode-0.8.0 → anixcode-0.10.0}/tests/test_agent.py +0 -0
  48. {anixcode-0.8.0 → anixcode-0.10.0}/tests/test_commands.py +0 -0
  49. {anixcode-0.8.0 → anixcode-0.10.0}/tests/test_llm.py +0 -0
  50. {anixcode-0.8.0 → anixcode-0.10.0}/tests/test_projects.py +0 -0
  51. {anixcode-0.8.0 → anixcode-0.10.0}/tests/test_providers.py +0 -0
  52. {anixcode-0.8.0 → anixcode-0.10.0}/tests/test_safety_mentions.py +0 -0
  53. {anixcode-0.8.0 → anixcode-0.10.0}/tests/test_settings.py +0 -0
  54. {anixcode-0.8.0 → anixcode-0.10.0}/tests/test_tools.py +0 -0
@@ -1,241 +1,272 @@
1
- Metadata-Version: 2.4
2
- Name: anixcode
3
- Version: 0.8.0
4
- Summary: AI coding agent for the terminal. Bring your own API key.
5
- Author: an1zy
6
- License: MIT
7
- Project-URL: Homepage, https://github.com/an1zy/anixcode
8
- Project-URL: Issues, https://github.com/an1zy/anixcode/issues
9
- Keywords: ai,agent,coding,terminal,tui,llm,deepseek,openai
10
- Classifier: Development Status :: 3 - Alpha
11
- Classifier: Environment :: Console
12
- Classifier: License :: OSI Approved :: MIT License
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Topic :: Software Development
15
- Requires-Python: >=3.11
16
- Description-Content-Type: text/markdown
17
- License-File: LICENSE
18
- Requires-Dist: textual>=1.0
19
- Requires-Dist: httpx>=0.27
20
- Provides-Extra: dev
21
- Requires-Dist: pytest>=8; extra == "dev"
22
- Requires-Dist: ruff>=0.5; extra == "dev"
23
- Dynamic: license-file
24
-
25
- # ANIX Code
26
-
27
- [![tests](https://github.com/an1zy/anixcode/actions/workflows/tests.yml/badge.svg)](https://github.com/an1zy/anixcode/actions/workflows/tests.yml)
28
- ![python](https://img.shields.io/badge/python-3.11%2B-blue) ![license](https://img.shields.io/badge/license-MIT-green)
29
- ![status](https://img.shields.io/badge/status-alpha-orange)
30
-
31
- 🇬🇧 English · 🇷🇺 [Русский](README.ru.md)
32
-
33
- > ⚠️ Early version. The main things work, but bugs are possible: please report them in Issues.
34
-
35
- An AI coding agent for your terminal. Paste an API key from any provider, describe a task, and the agent
36
- reads the project, edits files and runs commands by itself. Every change is shown as a diff, and nothing
37
- is changed without your approval (unless you turn on full access).
38
-
39
- ```
40
- ◆ ANIX Code ~/projects/my-app BUILD
41
- ▎ add a /health endpoint to api.py with a test
42
- ✓ → read api.py 84 lines
43
- ✓ ⌕ grep def test_ 6 matches
44
- ✓ ✎ edit api.py +7 −0
45
- ✓ $ pytest -q → 0
46
- Done: added GET /health and a test in tests/test_api.py, all 7 tests pass.
47
- ```
48
-
49
- ## Install
50
-
51
- Python 3.11+ is required.
52
-
53
- ```bash
54
- pipx install git+https://github.com/an1zy/anixcode # one command
55
- # or for development:
56
- git clone https://github.com/an1zy/anixcode && cd anixcode
57
- pip install -e .
58
- anixcode # open in the current folder
59
- anixcode ~/proj # or in a specific one
60
- ```
61
-
62
- On the first start a connection window opens: choose a provider, paste the key and press “Model list”.
63
- Any OpenAI-compatible server works:
64
-
65
- | Provider | Key |
66
- |---|---|
67
- | DeepSeek | platform.deepseek.com |
68
- | OpenAI, Anthropic, Google Gemini, Groq | in their consoles |
69
- | ANIX Router, Ollama, LM Studio | not needed, they run locally |
70
- | ★ Your own providers | “+ Own” button: name, `/v1` address, key, “Check” |
71
-
72
- The model has to support tool calling (function calling).
73
-
74
- If you start ANIX Code from your home folder or `C:\Windows\System32` (a fresh cmd window), it asks which
75
- project to work in. Switch projects any time with `Ctrl+P` or by clicking the path in the header; you can
76
- also paste a `https://github.com/...` link there to clone a repository.
77
-
78
- The interface language follows your system (Russian or English). Switch it with `/language`.
79
-
80
- ## Usage
81
-
82
- | Keys | |
83
- |---|---|
84
- | `Enter` / `Ctrl+J` | send / new line |
85
- | `Tab` / `Shift+Tab` | **Build** (edits code) ↔ **Plan** (only reads and plans) |
86
- | `Esc` | stop the agent |
87
- | `Ctrl+P` | choose a project: recent, found git repositories, browse disks, clone by link |
88
- | `F2` | full access on/off |
89
- | `Ctrl+O` | model and key |
90
- | `Ctrl+N` / `Ctrl+S` | new session / past sessions |
91
- | `Ctrl+T` | theme picker with preview: ANIX (peach), Noir (black & white), Tokyo Night, Catppuccin, Dracula, Nord… |
92
- | `F1` | help |
93
-
94
- Click an action card to expand its diff or command output.
95
- Logo and progress animations can be turned off in `settings.json`: `"animations": false`.
96
-
97
- **Approvals.** When the agent wants to change a file or run a command, a line appears above the input
98
- (the diff or the command is shown in the card in the chat): `Enter` allows, `Esc` denies, typing text and
99
- pressing `Enter` denies and tells the agent what to do instead. Dangerous commands (`rm -rf`,
100
- `Remove-Item -Recurse`, `del /s`, `git push --force`, `git reset --hard`…) are highlighted in red.
101
- **Full access** (`F2` or click “🔒 ask first” at the bottom right): the agent works without asking until
102
- you turn it off.
103
-
104
- **@files.** Type `@` in a prompt to get suggestions of project files (↑↓, Enter or Tab). The whole file is
105
- sent with the prompt and the agent can edit it right away: `fix the bug in @src/api.py`.
106
- `@folder/` attaches a listing of the folder.
107
-
108
- **Project rules.** `/init`: the agent studies the project and writes `AGENTS.md` (what the project is,
109
- structure, build and test commands, code style). Add your own rules there, for example “tests use vitest,
110
- don't touch the legacy folder”. The agent reads this file before every task.
111
-
112
- **Reliability:**
113
- - `/undo` reverts all file changes from the agent's last answer (several times in a row, also after a
114
- restart); `/redo` brings them back. Terminal commands (`bash`) are not undone.
115
- - The bottom right shows how full the model context is. At 80% the history is compressed automatically:
116
- old command outputs are removed first, then old steps are folded into a summary. Manually: `/compact`.
117
- - On network failures, timeouts, 429 and 5xx responses the request is retried up to 4 times.
118
- - The context size is guessed from the model name. For your own model set it in `settings.json`:
119
- `"context_window": 128000`.
120
-
121
- ## Commands
122
-
123
- Type `/` to get the list with descriptions (↑↓, `Tab` completes, `Enter` runs).
124
- The set follows Claude Code and OpenCode.
125
-
126
- | Command | |
127
- |---|---|
128
- | `/init` | study the project and write `AGENTS.md` |
129
- | `/review [focus]` | review uncommitted changes (or the last commit) |
130
- | `/commit [details]` | commit with a good message in the project's style |
131
- | `/test [what]` | find and run the tests, fix failing ones |
132
- | `/fix <error>` | fix an error from its text or a description |
133
- | `/explain <@file>` | explain code |
134
- | `/pr` | pull request description for the current branch |
135
- | `/undo` / `/redo` | undo the last answer's changes / bring them back |
136
- | `/compact` | compress the history |
137
- | `/new`, `/clear`, `/sessions`, `/resume` | sessions |
138
- | `/model`, `/connect` | model and key |
139
- | `/project` | choose a project |
140
- | `/theme`, `/mode`, `/permissions` | theme, Build/Plan, full access |
141
- | `/status` | summary: project, model, tokens, context |
142
- | `/export` | save the session as Markdown |
143
- | `/doctor` | check git, ripgrep, connection to the model, AI-RPC |
144
- | `/language` | interface language: Русский / English (after a restart) |
145
-
146
- **Quick input:**
147
- - `!command` runs a command in the terminal yourself, without the model; the agent sees the output:
148
- `!pytest -q`, then “fix it”.
149
- - `# text` saves a rule to `AGENTS.md`: `# use pnpm, not npm`.
150
-
151
- **Own commands.** A Markdown file in `.anixcode/commands/name.md` (this project) or in
152
- `%APPDATA%\anixcode\commands\name.md` / `~/.config/anixcode/commands/name.md` (all projects) becomes the
153
- command `/name`. `$ARGUMENTS` is replaced with everything after the command, `$1`, `$2` with single words.
154
- An example is in `.anixcode/commands/check.md`:
155
-
156
- ```markdown
157
- ---
158
- description: run the project tests and show the result
159
- ---
160
- Run `pytest -q`. If tests fail, show the failing test names and the short reason for each. $ARGUMENTS
161
- ```
162
-
163
- Prompt commands also work without the interface: `anixcode run "/review"`.
164
-
165
- **Without the interface:**
166
- ```bash
167
- anixcode run "find where the discount is calculated and explain it" --plan
168
- anixcode run "fix the failing test" -y # -y: allow everything without asking
169
- anixcode connect # connect a model from the console
170
- anixcode models # list the provider's models
171
- ```
172
-
173
- ## Tools
174
-
175
- | Tool | |
176
- |---|---|
177
- | `read` | reads a file with line numbers, big files in parts |
178
- | `ls`, `glob` | folder tree, find files by pattern |
179
- | `grep` | search in code (ripgrep if installed) |
180
- | `edit` | precise text replacement; the file must have been read and not changed since |
181
- | `write` | new file or full rewrite |
182
- | `bash` | commands: tests, git, builds (PowerShell on Windows) |
183
-
184
- File tools never leave the project folder. Edits and commands need approval unless full access is on.
185
- Fine-tuning in `settings.json`: `"permissions": {"edit": "ask", "exec": "ask"}` (`ask` / `allow` / `deny`).
186
-
187
- **AI-RPC.** If [AI-RPC](https://github.com/an1zy/ai-rpc) is running, Discord shows “ANIX Code · Generating”.
188
-
189
- ## Updates and keys
190
-
191
- Keys and settings are stored **outside the code folder**, so you can unpack a new version over the old one
192
- or into another folder: keys, own providers and sessions stay. To move to another computer, copy the whole
193
- folder below.
194
-
195
- `%APPDATA%\anixcode\` (Windows) or `~/.config/anixcode/`:
196
- - `settings.json`: provider, model, theme, permissions, language;
197
- - `auth.json`: API keys (only on your computer, readable only by your user);
198
- - `sessions.db`: session history.
199
-
200
- ## Development
201
-
202
- ```bash
203
- pip install -e ".[dev]" && pytest
204
- ```
205
-
206
- **Full self-test:** `python selftest.py` (on Windows you can double-click `selftest.bat`). It runs the unit
207
- tests, then starts the interface invisibly with a fake model and checks the answers, approvals, full access,
208
- `/undo` and `/redo`, `/` and `@` suggestions, `!command`, `# note`, Build/Plan, `/status`, `/doctor`,
209
- `/export`, `/compact`, all windows, stopping with Esc and `/new`. No API key needed, no money spent, your
210
- settings and sessions are not touched.
211
-
212
- Translations: interface strings are written in Russian in the code as `tr("…")`; English versions live in
213
- `anixcode/i18n_en.py` (a test checks that every string has one).
214
-
215
- ```
216
- anixcode/
217
- llm.py OpenAI-compatible API client: streaming, tool calls, readable errors, retries
218
- agent.py the agent loop, approvals, Build/Plan modes, undo/redo
219
- tools/ read, ls, glob, grep, edit, write, bash
220
- prompts.py system prompt + AGENTS.md
221
- storage.py sessions and file snapshots in SQLite
222
- checkpoints.py file snapshots for /undo
223
- compaction.py history compression to fit the context
224
- danger.py spotting dangerous commands
225
- mentions.py @files: suggestions and attaching
226
- commands.py /commands: built-in, ready-made prompts, own ones from .md
227
- i18n.py Russian / English interface
228
- providers.py provider list
229
- tui/ the Textual interface
230
- ```
231
-
232
- ## Roadmap
233
-
234
- - [x] Undo (`/undo`, `/redo`)
235
- - [x] History compression, retries on failures
236
- - [x] `@file` in prompts, `/init`, dangerous-command highlighting
237
- - [x] `/review`, `/commit`, `/test`…, own commands from `.md`, `!` and `#`
238
- - [x] English interface
239
- - [ ] MCP servers
240
- - [ ] Several agents in parallel
241
- - [ ] Desktop version
1
+ Metadata-Version: 2.4
2
+ Name: anixcode
3
+ Version: 0.10.0
4
+ Summary: AI coding agent for the terminal. Bring your own API key.
5
+ Author: an1zy
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/an1zy/anixcode
8
+ Project-URL: Repository, https://github.com/an1zy/anixcode
9
+ Project-URL: Issues, https://github.com/an1zy/anixcode/issues
10
+ Project-URL: PyPI, https://pypi.org/project/anixcode/
11
+ Keywords: ai,agent,coding,terminal,tui,llm,deepseek,openai
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Software Development
16
+ Requires-Python: >=3.11
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: textual>=1.0
20
+ Requires-Dist: httpx>=0.27
21
+ Provides-Extra: dev
22
+ Requires-Dist: pytest>=8; extra == "dev"
23
+ Requires-Dist: ruff>=0.5; extra == "dev"
24
+ Dynamic: license-file
25
+
26
+ <div align="center">
27
+
28
+ # ● anixcode
29
+ ### *Terminal AI Coding Agent with Diffs, Checkpoints & MCP Support*
30
+
31
+ [![CI](https://github.com/an1zy/anixcode/actions/workflows/tests.yml/badge.svg?style=for-the-badge)](https://github.com/an1zy/anixcode/actions/workflows/tests.yml)
32
+ [![PyPI](https://img.shields.io/pypi/v/anixcode?style=for-the-badge&color=18181b)](https://pypi.org/project/anixcode/)
33
+ [![Python](https://img.shields.io/badge/python-3.11%2B-18181b.svg?style=for-the-badge&logo=python&logoColor=white)](https://www.python.org/)
34
+ [![License: MIT](https://img.shields.io/badge/license-MIT-18181b.svg?style=for-the-badge)](LICENSE)
35
+
36
+ **English** · [Русский](README.ru.md)
37
+
38
+ <br/>
39
+
40
+ <img src="assets/demo.svg" alt="anixcode demo" width="880" />
41
+
42
+ </div>
43
+
44
+ ---
45
+
46
+ Terminal AI coding agent. Paste an API key from any OpenAI-compatible provider, describe a task, and the agent reads the project, edits files, and runs commands. Every change is shown as a diff, and edits or commands require approval unless full access is enabled.
47
+
48
+ ```
49
+ ◆ ANIX Code ~/projects/my-app BUILD
50
+ ▎ add a /health endpoint to api.py with a test
51
+ ✓ → read api.py 84 lines
52
+ ✓ ⌕ grep def test_ 6 matches
53
+ ✓ ✎ edit api.py +7 −0
54
+ ✓ $ pytest -q → 0
55
+ Done: added GET /health and a test in tests/test_api.py, all 7 tests pass.
56
+ ```
57
+
58
+ ## Install
59
+
60
+ Python 3.11+ is required.
61
+
62
+ ```bash
63
+ pip install anixcode # or: pipx install anixcode
64
+ # or for development:
65
+ git clone https://github.com/an1zy/anixcode && cd anixcode
66
+ pip install -e .
67
+ anixcode # open in the current folder
68
+ anixcode ~/proj # or in a specific one
69
+ ```
70
+
71
+ On the first start a connection window opens: choose a provider, paste the key and press “Model list”.
72
+ Any OpenAI-compatible server works:
73
+
74
+ | Provider | Key |
75
+ |---|---|
76
+ | DeepSeek | platform.deepseek.com |
77
+ | OpenAI, Anthropic, Google Gemini, Groq | in their consoles |
78
+ | ANIX Router, Ollama, LM Studio | not needed, they run locally |
79
+ | ★ Your own providers | “+ Own” button: name, `/v1` address, key, “Check” |
80
+
81
+ The model has to support tool calling (function calling).
82
+
83
+ If you start ANIX Code from your home folder or `C:\Windows\System32` (a fresh cmd window), it asks which
84
+ project to work in. Switch projects any time with `Ctrl+P` or by clicking the path in the header; you can
85
+ also paste a `https://github.com/...` link there to clone a repository.
86
+
87
+ The interface language follows your system (Russian or English). Switch it with `/language`.
88
+
89
+ ## Usage
90
+
91
+ | Keys | |
92
+ |---|---|
93
+ | `Enter` / `Ctrl+J` | send / new line |
94
+ | `Tab` / `Shift+Tab` | **Build** (edits code) ↔ **Plan** (only reads and plans) |
95
+ | `Esc` | stop the agent |
96
+ | `Ctrl+P` | choose a project: recent, found git repositories, browse disks, clone by link |
97
+ | `F2` | full access on/off |
98
+ | `Ctrl+O` | model and key |
99
+ | `Ctrl+N` / `Ctrl+S` | new session / past sessions |
100
+ | `Ctrl+T` | theme picker with preview: ANIX (peach), Noir (black & white), Tokyo Night, Catppuccin, Dracula, Nord… |
101
+ | `Alt+V` | paste an image from clipboard (screenshot or copied file) |
102
+ | `F1` | help |
103
+
104
+ Click an action card to expand its diff or command output.
105
+ Logo and progress animations can be turned off in `settings.json`: `"animations": false`.
106
+
107
+ **Approvals.** When the agent wants to change a file or run a command, a line appears above the input
108
+ (the diff or the command is shown in the card in the chat): `Enter` allows, `Esc` denies, typing text and
109
+ pressing `Enter` denies and tells the agent what to do instead. Dangerous commands (`rm -rf`,
110
+ `Remove-Item -Recurse`, `del /s`, `git push --force`, `git reset --hard`…) are highlighted in red.
111
+ **Full access** (`F2` or click “🔒 ask first” at the bottom right): the agent works without asking until
112
+ you turn it off.
113
+
114
+ **@files.** Type `@` in a prompt to get suggestions of project files (↑↓, Enter or Tab). The whole file is
115
+ sent with the prompt and the agent can edit it right away: `fix the bug in @src/api.py`.
116
+ `@folder/` attaches a listing of the folder. Images (`PNG`, `JPG`, `WEBP`, `GIF`) can be attached via `@image.png`,
117
+ `Alt+V` / `Ctrl+V` from clipboard, drag & drop into the terminal, or `/image [path]`.
118
+
119
+ **Project rules.** `/init`: the agent studies the project and writes `AGENTS.md` (what the project is,
120
+ structure, build and test commands, code style). Add your own rules there, for example “tests use vitest,
121
+ don't touch the legacy folder”. The agent reads this file before every task.
122
+
123
+ **Reliability:**
124
+ - `/undo` reverts all file changes from the agent's last answer (several times in a row, also after a
125
+ restart); `/redo` brings them back. Terminal commands (`bash`) are not undone.
126
+ - The bottom right shows how full the model context is. At 80% the history is compressed automatically:
127
+ old command outputs are removed first, then old steps are folded into a summary. Manually: `/compact`.
128
+ - On network failures, timeouts, 429 and 5xx responses the request is retried up to 4 times.
129
+ - The context size is guessed from the model name. For your own model set it in `settings.json`:
130
+ `"context_window": 128000`.
131
+
132
+ ## Commands
133
+
134
+ Type `/` to get the list with descriptions (↑↓, `Tab` completes, `Enter` runs).
135
+ The set follows Claude Code and OpenCode.
136
+
137
+ | Command | |
138
+ |---|---|
139
+ | `/init` | study the project and write `AGENTS.md` |
140
+ | `/review [focus]` | review uncommitted changes (or the last commit) |
141
+ | `/commit [details]` | commit with a good message in the project's style |
142
+ | `/test [what]` | find and run the tests, fix failing ones |
143
+ | `/fix <error>` | fix an error from its text or a description |
144
+ | `/explain <@file>` | explain code |
145
+ | `/pr` | pull request description for the current branch |
146
+ | `/undo` / `/redo` | undo the last answer's changes / bring them back |
147
+ | `/compact` | compress the history |
148
+ | `/new`, `/clear`, `/sessions`, `/resume` | sessions |
149
+ | `/model`, `/connect` | model and key |
150
+ | `/project` | choose a project |
151
+ | `/theme`, `/mode`, `/permissions` | theme, Build/Plan, full access |
152
+ | `/status` | summary: project, model, tokens, context |
153
+ | `/export` | save the session as Markdown |
154
+ | `/doctor` | check git, ripgrep, connection to the model, AI-RPC |
155
+ | `/mcp [add|remove|on|off|tools|reload]` | MCP servers: list, add, remove, turn on/off, show tools, restart |
156
+ | `/image [path\|clear]`, `/img` | attach an image from clipboard or file, or clear attachments |
157
+ | `/language` | interface language: Русский / English (after a restart) |
158
+
159
+ **Quick input:**
160
+ - `!command` runs a command in the terminal yourself, without the model; the agent sees the output:
161
+ `!pytest -q`, then “fix it”.
162
+ - `# text` saves a rule to `AGENTS.md`: `# use pnpm, not npm`.
163
+
164
+ **Own commands.** A Markdown file in `.anixcode/commands/name.md` (this project) or in
165
+ `%APPDATA%\anixcode\commands\name.md` / `~/.config/anixcode/commands/name.md` (all projects) becomes the
166
+ command `/name`. `$ARGUMENTS` is replaced with everything after the command, `$1`, `$2` with single words.
167
+ An example is in `.anixcode/commands/check.md`:
168
+
169
+ ```markdown
170
+ ---
171
+ description: run the project tests and show the result
172
+ ---
173
+ Run `pytest -q`. If tests fail, show the failing test names and the short reason for each. $ARGUMENTS
174
+ ```
175
+
176
+ Prompt commands also work without the interface: `anixcode run "/review"`.
177
+
178
+ **Without the interface:**
179
+ ```bash
180
+ anixcode run "find where the discount is calculated and explain it" --plan
181
+ anixcode run "fix the failing test" -y # -y: allow everything without asking
182
+ anixcode run -i screen.png "fix the layout" # attach one or more images
183
+ anixcode connect # connect a model from the console
184
+ anixcode models # list the provider's models
185
+ ```
186
+
187
+ ## Tools
188
+
189
+ | Tool | |
190
+ |---|---|
191
+ | `read` | reads a file with line numbers, big files in parts |
192
+ | `ls`, `glob` | folder tree, find files by pattern |
193
+ | `grep` | search in code (ripgrep if installed) |
194
+ | `edit` | precise text replacement; the file must have been read and not changed since |
195
+ | `write` | new file or full rewrite |
196
+ | `bash` | commands: tests, git, builds (PowerShell on Windows) |
197
+
198
+ File tools never leave the project folder. Edits and commands need approval unless full access is on.
199
+ Fine-tuning in `settings.json`: `"permissions": {"edit": "ask", "exec": "ask"}` (`ask` / `allow` / `deny`).
200
+
201
+ **AI-RPC.** If [AI-RPC](https://github.com/an1zy/ai-rpc) is running, Discord shows “ANIX Code · Generating”.
202
+
203
+ ## Updates and keys
204
+
205
+ Keys and settings are stored **outside the code folder**, so you can unpack a new version over the old one
206
+ or into another folder: keys, own providers and sessions stay. To move to another computer, copy the whole
207
+ folder below.
208
+
209
+ `%APPDATA%\anixcode\` (Windows) or `~/.config/anixcode/`:
210
+ - `settings.json`: provider, model, theme, permissions, language;
211
+ - `auth.json`: API keys (only on your computer, readable only by your user);
212
+ - `sessions.db`: session history.
213
+
214
+ ## Development
215
+
216
+ ```bash
217
+ pip install -e ".[dev]" && pytest
218
+ ```
219
+
220
+ Translations: interface strings are written in Russian in the code as `tr("…")`; English versions live in
221
+ `anixcode/i18n_en.py` (a test checks that every string has one).
222
+
223
+ ## MCP servers
224
+
225
+ Add servers via `/mcp add` or directly in `settings.json` (same format as `mcpServers` in Claude Desktop and Cursor):
226
+
227
+ ```json
228
+ "mcp_servers": {
229
+ "github": {"command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"],
230
+ "env": {"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"}},
231
+ "context7": {"url": "https://mcp.context7.com/mcp"},
232
+ "big": {"command": "uvx", "args": ["some-server"], "tools": ["search"], "timeout": 300},
233
+ "old": {"command": "...", "disabled": true}
234
+ }
235
+ ```
236
+
237
+ - `command` + `args` + `env`: a local server (stdio), started in the project folder.
238
+ - `url` + `headers`: a remote server (Streamable HTTP).
239
+ - `${VAR}` is taken from the environment, so tokens don't have to be in the file.
240
+ - `tools`: keep only these tools (saves context). `timeout`: seconds per call (default 120).
241
+ - The model sees them as `mcp__<server>__<tool>`. They ask for approval like edits and commands; `"permissions": {"mcp": "allow"}` turns that off.
242
+ - `/mcp`, `/status` and `/doctor` show which servers connected.
243
+
244
+ ```
245
+ anixcode/
246
+ llm.py OpenAI-compatible API client: streaming, tool calls, readable errors, retries
247
+ agent.py the agent loop, approvals, Build/Plan modes, undo/redo
248
+ tools/ read, ls, glob, grep, edit, write, bash
249
+ mcp.py MCP client (stdio + Streamable HTTP)
250
+ prompts.py system prompt + AGENTS.md
251
+ storage.py sessions and file snapshots in SQLite
252
+ checkpoints.py file snapshots for /undo
253
+ compaction.py history compression to fit the context
254
+ danger.py spotting dangerous commands
255
+ mentions.py @files: suggestions and attaching
256
+ images.py image attachments: files, drag & drop, clipboard
257
+ commands.py /commands: built-in, ready-made prompts, own ones from .md
258
+ i18n.py Russian / English interface
259
+ providers.py provider list
260
+ tui/ the Textual interface
261
+ ```
262
+
263
+ ## Roadmap
264
+
265
+ - [x] Undo (`/undo`, `/redo`)
266
+ - [x] History compression, retries on failures
267
+ - [x] `@file` in prompts, `/init`, dangerous-command highlighting
268
+ - [x] `/review`, `/commit`, `/test`…, own commands from `.md`, `!` and `#`
269
+ - [x] English interface
270
+ - [x] MCP servers
271
+ - [ ] Several agents in parallel
272
+ - [ ] Desktop version