anixcode 0.8.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 (50) hide show
  1. anixcode-0.8.0/LICENSE +21 -0
  2. anixcode-0.8.0/PKG-INFO +241 -0
  3. anixcode-0.8.0/README.md +217 -0
  4. anixcode-0.8.0/anixcode/__init__.py +3 -0
  5. anixcode-0.8.0/anixcode/__main__.py +4 -0
  6. anixcode-0.8.0/anixcode/agent.py +358 -0
  7. anixcode-0.8.0/anixcode/airpc.py +59 -0
  8. anixcode-0.8.0/anixcode/checkpoints.py +87 -0
  9. anixcode-0.8.0/anixcode/cli.py +185 -0
  10. anixcode-0.8.0/anixcode/commands.py +218 -0
  11. anixcode-0.8.0/anixcode/compaction.py +91 -0
  12. anixcode-0.8.0/anixcode/danger.py +85 -0
  13. anixcode-0.8.0/anixcode/i18n.py +67 -0
  14. anixcode-0.8.0/anixcode/i18n_en.py +293 -0
  15. anixcode-0.8.0/anixcode/llm.py +258 -0
  16. anixcode-0.8.0/anixcode/mentions.py +116 -0
  17. anixcode-0.8.0/anixcode/projects.py +142 -0
  18. anixcode-0.8.0/anixcode/prompts.py +64 -0
  19. anixcode-0.8.0/anixcode/providers.py +67 -0
  20. anixcode-0.8.0/anixcode/settings.py +105 -0
  21. anixcode-0.8.0/anixcode/storage.py +129 -0
  22. anixcode-0.8.0/anixcode/tools/__init__.py +15 -0
  23. anixcode-0.8.0/anixcode/tools/base.py +203 -0
  24. anixcode-0.8.0/anixcode/tools/files.py +248 -0
  25. anixcode-0.8.0/anixcode/tools/search.py +107 -0
  26. anixcode-0.8.0/anixcode/tools/shell.py +86 -0
  27. anixcode-0.8.0/anixcode/tui/__init__.py +0 -0
  28. anixcode-0.8.0/anixcode/tui/anim.py +242 -0
  29. anixcode-0.8.0/anixcode/tui/app.py +812 -0
  30. anixcode-0.8.0/anixcode/tui/app.tcss +281 -0
  31. anixcode-0.8.0/anixcode/tui/screens.py +556 -0
  32. anixcode-0.8.0/anixcode/tui/widgets.py +374 -0
  33. anixcode-0.8.0/anixcode.egg-info/PKG-INFO +241 -0
  34. anixcode-0.8.0/anixcode.egg-info/SOURCES.txt +48 -0
  35. anixcode-0.8.0/anixcode.egg-info/dependency_links.txt +1 -0
  36. anixcode-0.8.0/anixcode.egg-info/entry_points.txt +2 -0
  37. anixcode-0.8.0/anixcode.egg-info/requires.txt +6 -0
  38. anixcode-0.8.0/anixcode.egg-info/top_level.txt +1 -0
  39. anixcode-0.8.0/pyproject.toml +46 -0
  40. anixcode-0.8.0/setup.cfg +4 -0
  41. anixcode-0.8.0/tests/test_agent.py +101 -0
  42. anixcode-0.8.0/tests/test_commands.py +77 -0
  43. anixcode-0.8.0/tests/test_i18n.py +41 -0
  44. anixcode-0.8.0/tests/test_llm.py +48 -0
  45. anixcode-0.8.0/tests/test_projects.py +52 -0
  46. anixcode-0.8.0/tests/test_providers.py +26 -0
  47. anixcode-0.8.0/tests/test_reliability.py +130 -0
  48. anixcode-0.8.0/tests/test_safety_mentions.py +102 -0
  49. anixcode-0.8.0/tests/test_settings.py +11 -0
  50. anixcode-0.8.0/tests/test_tools.py +100 -0
anixcode-0.8.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 an1zy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,241 @@
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
@@ -0,0 +1,217 @@
1
+ # ANIX Code
2
+
3
+ [![tests](https://github.com/an1zy/anixcode/actions/workflows/tests.yml/badge.svg)](https://github.com/an1zy/anixcode/actions/workflows/tests.yml)
4
+ ![python](https://img.shields.io/badge/python-3.11%2B-blue) ![license](https://img.shields.io/badge/license-MIT-green)
5
+ ![status](https://img.shields.io/badge/status-alpha-orange)
6
+
7
+ 🇬🇧 English · 🇷🇺 [Русский](README.ru.md)
8
+
9
+ > ⚠️ Early version. The main things work, but bugs are possible: please report them in Issues.
10
+
11
+ An AI coding agent for your terminal. Paste an API key from any provider, describe a task, and the agent
12
+ reads the project, edits files and runs commands by itself. Every change is shown as a diff, and nothing
13
+ is changed without your approval (unless you turn on full access).
14
+
15
+ ```
16
+ ◆ ANIX Code ~/projects/my-app BUILD
17
+ ▎ add a /health endpoint to api.py with a test
18
+ ✓ → read api.py 84 lines
19
+ ✓ ⌕ grep def test_ 6 matches
20
+ ✓ ✎ edit api.py +7 −0
21
+ ✓ $ pytest -q → 0
22
+ Done: added GET /health and a test in tests/test_api.py, all 7 tests pass.
23
+ ```
24
+
25
+ ## Install
26
+
27
+ Python 3.11+ is required.
28
+
29
+ ```bash
30
+ pipx install git+https://github.com/an1zy/anixcode # one command
31
+ # or for development:
32
+ git clone https://github.com/an1zy/anixcode && cd anixcode
33
+ pip install -e .
34
+ anixcode # open in the current folder
35
+ anixcode ~/proj # or in a specific one
36
+ ```
37
+
38
+ On the first start a connection window opens: choose a provider, paste the key and press “Model list”.
39
+ Any OpenAI-compatible server works:
40
+
41
+ | Provider | Key |
42
+ |---|---|
43
+ | DeepSeek | platform.deepseek.com |
44
+ | OpenAI, Anthropic, Google Gemini, Groq | in their consoles |
45
+ | ANIX Router, Ollama, LM Studio | not needed, they run locally |
46
+ | ★ Your own providers | “+ Own” button: name, `/v1` address, key, “Check” |
47
+
48
+ The model has to support tool calling (function calling).
49
+
50
+ If you start ANIX Code from your home folder or `C:\Windows\System32` (a fresh cmd window), it asks which
51
+ project to work in. Switch projects any time with `Ctrl+P` or by clicking the path in the header; you can
52
+ also paste a `https://github.com/...` link there to clone a repository.
53
+
54
+ The interface language follows your system (Russian or English). Switch it with `/language`.
55
+
56
+ ## Usage
57
+
58
+ | Keys | |
59
+ |---|---|
60
+ | `Enter` / `Ctrl+J` | send / new line |
61
+ | `Tab` / `Shift+Tab` | **Build** (edits code) ↔ **Plan** (only reads and plans) |
62
+ | `Esc` | stop the agent |
63
+ | `Ctrl+P` | choose a project: recent, found git repositories, browse disks, clone by link |
64
+ | `F2` | full access on/off |
65
+ | `Ctrl+O` | model and key |
66
+ | `Ctrl+N` / `Ctrl+S` | new session / past sessions |
67
+ | `Ctrl+T` | theme picker with preview: ANIX (peach), Noir (black & white), Tokyo Night, Catppuccin, Dracula, Nord… |
68
+ | `F1` | help |
69
+
70
+ Click an action card to expand its diff or command output.
71
+ Logo and progress animations can be turned off in `settings.json`: `"animations": false`.
72
+
73
+ **Approvals.** When the agent wants to change a file or run a command, a line appears above the input
74
+ (the diff or the command is shown in the card in the chat): `Enter` allows, `Esc` denies, typing text and
75
+ pressing `Enter` denies and tells the agent what to do instead. Dangerous commands (`rm -rf`,
76
+ `Remove-Item -Recurse`, `del /s`, `git push --force`, `git reset --hard`…) are highlighted in red.
77
+ **Full access** (`F2` or click “🔒 ask first” at the bottom right): the agent works without asking until
78
+ you turn it off.
79
+
80
+ **@files.** Type `@` in a prompt to get suggestions of project files (↑↓, Enter or Tab). The whole file is
81
+ sent with the prompt and the agent can edit it right away: `fix the bug in @src/api.py`.
82
+ `@folder/` attaches a listing of the folder.
83
+
84
+ **Project rules.** `/init`: the agent studies the project and writes `AGENTS.md` (what the project is,
85
+ structure, build and test commands, code style). Add your own rules there, for example “tests use vitest,
86
+ don't touch the legacy folder”. The agent reads this file before every task.
87
+
88
+ **Reliability:**
89
+ - `/undo` reverts all file changes from the agent's last answer (several times in a row, also after a
90
+ restart); `/redo` brings them back. Terminal commands (`bash`) are not undone.
91
+ - The bottom right shows how full the model context is. At 80% the history is compressed automatically:
92
+ old command outputs are removed first, then old steps are folded into a summary. Manually: `/compact`.
93
+ - On network failures, timeouts, 429 and 5xx responses the request is retried up to 4 times.
94
+ - The context size is guessed from the model name. For your own model set it in `settings.json`:
95
+ `"context_window": 128000`.
96
+
97
+ ## Commands
98
+
99
+ Type `/` to get the list with descriptions (↑↓, `Tab` completes, `Enter` runs).
100
+ The set follows Claude Code and OpenCode.
101
+
102
+ | Command | |
103
+ |---|---|
104
+ | `/init` | study the project and write `AGENTS.md` |
105
+ | `/review [focus]` | review uncommitted changes (or the last commit) |
106
+ | `/commit [details]` | commit with a good message in the project's style |
107
+ | `/test [what]` | find and run the tests, fix failing ones |
108
+ | `/fix <error>` | fix an error from its text or a description |
109
+ | `/explain <@file>` | explain code |
110
+ | `/pr` | pull request description for the current branch |
111
+ | `/undo` / `/redo` | undo the last answer's changes / bring them back |
112
+ | `/compact` | compress the history |
113
+ | `/new`, `/clear`, `/sessions`, `/resume` | sessions |
114
+ | `/model`, `/connect` | model and key |
115
+ | `/project` | choose a project |
116
+ | `/theme`, `/mode`, `/permissions` | theme, Build/Plan, full access |
117
+ | `/status` | summary: project, model, tokens, context |
118
+ | `/export` | save the session as Markdown |
119
+ | `/doctor` | check git, ripgrep, connection to the model, AI-RPC |
120
+ | `/language` | interface language: Русский / English (after a restart) |
121
+
122
+ **Quick input:**
123
+ - `!command` runs a command in the terminal yourself, without the model; the agent sees the output:
124
+ `!pytest -q`, then “fix it”.
125
+ - `# text` saves a rule to `AGENTS.md`: `# use pnpm, not npm`.
126
+
127
+ **Own commands.** A Markdown file in `.anixcode/commands/name.md` (this project) or in
128
+ `%APPDATA%\anixcode\commands\name.md` / `~/.config/anixcode/commands/name.md` (all projects) becomes the
129
+ command `/name`. `$ARGUMENTS` is replaced with everything after the command, `$1`, `$2` with single words.
130
+ An example is in `.anixcode/commands/check.md`:
131
+
132
+ ```markdown
133
+ ---
134
+ description: run the project tests and show the result
135
+ ---
136
+ Run `pytest -q`. If tests fail, show the failing test names and the short reason for each. $ARGUMENTS
137
+ ```
138
+
139
+ Prompt commands also work without the interface: `anixcode run "/review"`.
140
+
141
+ **Without the interface:**
142
+ ```bash
143
+ anixcode run "find where the discount is calculated and explain it" --plan
144
+ anixcode run "fix the failing test" -y # -y: allow everything without asking
145
+ anixcode connect # connect a model from the console
146
+ anixcode models # list the provider's models
147
+ ```
148
+
149
+ ## Tools
150
+
151
+ | Tool | |
152
+ |---|---|
153
+ | `read` | reads a file with line numbers, big files in parts |
154
+ | `ls`, `glob` | folder tree, find files by pattern |
155
+ | `grep` | search in code (ripgrep if installed) |
156
+ | `edit` | precise text replacement; the file must have been read and not changed since |
157
+ | `write` | new file or full rewrite |
158
+ | `bash` | commands: tests, git, builds (PowerShell on Windows) |
159
+
160
+ File tools never leave the project folder. Edits and commands need approval unless full access is on.
161
+ Fine-tuning in `settings.json`: `"permissions": {"edit": "ask", "exec": "ask"}` (`ask` / `allow` / `deny`).
162
+
163
+ **AI-RPC.** If [AI-RPC](https://github.com/an1zy/ai-rpc) is running, Discord shows “ANIX Code · Generating”.
164
+
165
+ ## Updates and keys
166
+
167
+ Keys and settings are stored **outside the code folder**, so you can unpack a new version over the old one
168
+ or into another folder: keys, own providers and sessions stay. To move to another computer, copy the whole
169
+ folder below.
170
+
171
+ `%APPDATA%\anixcode\` (Windows) or `~/.config/anixcode/`:
172
+ - `settings.json`: provider, model, theme, permissions, language;
173
+ - `auth.json`: API keys (only on your computer, readable only by your user);
174
+ - `sessions.db`: session history.
175
+
176
+ ## Development
177
+
178
+ ```bash
179
+ pip install -e ".[dev]" && pytest
180
+ ```
181
+
182
+ **Full self-test:** `python selftest.py` (on Windows you can double-click `selftest.bat`). It runs the unit
183
+ tests, then starts the interface invisibly with a fake model and checks the answers, approvals, full access,
184
+ `/undo` and `/redo`, `/` and `@` suggestions, `!command`, `# note`, Build/Plan, `/status`, `/doctor`,
185
+ `/export`, `/compact`, all windows, stopping with Esc and `/new`. No API key needed, no money spent, your
186
+ settings and sessions are not touched.
187
+
188
+ Translations: interface strings are written in Russian in the code as `tr("…")`; English versions live in
189
+ `anixcode/i18n_en.py` (a test checks that every string has one).
190
+
191
+ ```
192
+ anixcode/
193
+ llm.py OpenAI-compatible API client: streaming, tool calls, readable errors, retries
194
+ agent.py the agent loop, approvals, Build/Plan modes, undo/redo
195
+ tools/ read, ls, glob, grep, edit, write, bash
196
+ prompts.py system prompt + AGENTS.md
197
+ storage.py sessions and file snapshots in SQLite
198
+ checkpoints.py file snapshots for /undo
199
+ compaction.py history compression to fit the context
200
+ danger.py spotting dangerous commands
201
+ mentions.py @files: suggestions and attaching
202
+ commands.py /commands: built-in, ready-made prompts, own ones from .md
203
+ i18n.py Russian / English interface
204
+ providers.py provider list
205
+ tui/ the Textual interface
206
+ ```
207
+
208
+ ## Roadmap
209
+
210
+ - [x] Undo (`/undo`, `/redo`)
211
+ - [x] History compression, retries on failures
212
+ - [x] `@file` in prompts, `/init`, dangerous-command highlighting
213
+ - [x] `/review`, `/commit`, `/test`…, own commands from `.md`, `!` and `#`
214
+ - [x] English interface
215
+ - [ ] MCP servers
216
+ - [ ] Several agents in parallel
217
+ - [ ] Desktop version
@@ -0,0 +1,3 @@
1
+ """ANIX Code: an AI coding agent for your terminal. Bring your own API key."""
2
+
3
+ __version__ = "0.8.0"
@@ -0,0 +1,4 @@
1
+ from anixcode.cli import main
2
+
3
+ if __name__ == "__main__":
4
+ raise SystemExit(main())