aru-code 0.1.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 (47) hide show
  1. aru_code-0.1.0/LICENSE +21 -0
  2. aru_code-0.1.0/PKG-INFO +385 -0
  3. aru_code-0.1.0/README.md +341 -0
  4. aru_code-0.1.0/aru/__init__.py +1 -0
  5. aru_code-0.1.0/aru/agents/__init__.py +0 -0
  6. aru_code-0.1.0/aru/agents/base.py +188 -0
  7. aru_code-0.1.0/aru/agents/executor.py +32 -0
  8. aru_code-0.1.0/aru/agents/planner.py +85 -0
  9. aru_code-0.1.0/aru/cli.py +1993 -0
  10. aru_code-0.1.0/aru/config.py +237 -0
  11. aru_code-0.1.0/aru/context.py +287 -0
  12. aru_code-0.1.0/aru/providers.py +433 -0
  13. aru_code-0.1.0/aru/tools/__init__.py +0 -0
  14. aru_code-0.1.0/aru/tools/ast_tools.py +422 -0
  15. aru_code-0.1.0/aru/tools/codebase.py +1328 -0
  16. aru_code-0.1.0/aru/tools/gitignore.py +109 -0
  17. aru_code-0.1.0/aru/tools/mcp_client.py +156 -0
  18. aru_code-0.1.0/aru/tools/ranker.py +220 -0
  19. aru_code-0.1.0/aru/tools/tasklist.py +183 -0
  20. aru_code-0.1.0/aru_code.egg-info/PKG-INFO +385 -0
  21. aru_code-0.1.0/aru_code.egg-info/SOURCES.txt +45 -0
  22. aru_code-0.1.0/aru_code.egg-info/dependency_links.txt +1 -0
  23. aru_code-0.1.0/aru_code.egg-info/entry_points.txt +2 -0
  24. aru_code-0.1.0/aru_code.egg-info/requires.txt +29 -0
  25. aru_code-0.1.0/aru_code.egg-info/top_level.txt +1 -0
  26. aru_code-0.1.0/pyproject.toml +80 -0
  27. aru_code-0.1.0/setup.cfg +4 -0
  28. aru_code-0.1.0/tests/test_agents_base.py +64 -0
  29. aru_code-0.1.0/tests/test_ast_tools.py +762 -0
  30. aru_code-0.1.0/tests/test_cli.py +550 -0
  31. aru_code-0.1.0/tests/test_cli_advanced.py +436 -0
  32. aru_code-0.1.0/tests/test_cli_base.py +94 -0
  33. aru_code-0.1.0/tests/test_cli_completers.py +494 -0
  34. aru_code-0.1.0/tests/test_cli_new.py +267 -0
  35. aru_code-0.1.0/tests/test_cli_run_cli.py +1 -0
  36. aru_code-0.1.0/tests/test_cli_session.py +621 -0
  37. aru_code-0.1.0/tests/test_cli_shell.py +169 -0
  38. aru_code-0.1.0/tests/test_codebase.py +703 -0
  39. aru_code-0.1.0/tests/test_config.py +378 -0
  40. aru_code-0.1.0/tests/test_context.py +246 -0
  41. aru_code-0.1.0/tests/test_executor.py +81 -0
  42. aru_code-0.1.0/tests/test_gitignore.py +285 -0
  43. aru_code-0.1.0/tests/test_main.py +206 -0
  44. aru_code-0.1.0/tests/test_mcp_client.py +1133 -0
  45. aru_code-0.1.0/tests/test_planner.py +107 -0
  46. aru_code-0.1.0/tests/test_providers.py +303 -0
  47. aru_code-0.1.0/tests/test_ranker.py +442 -0
aru_code-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Estevao
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,385 @@
1
+ Metadata-Version: 2.4
2
+ Name: aru-code
3
+ Version: 0.1.0
4
+ Summary: A Claude Code clone built with Agno agents
5
+ Author-email: Estevao <estevaofon@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/estevaofon/aru
8
+ Project-URL: Repository, https://github.com/estevaofon/aru
9
+ Project-URL: Issues, https://github.com/estevaofon/aru/issues
10
+ Keywords: ai,coding-assistant,claude,cli,agents
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
16
+ Requires-Python: >=3.13
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: agno<3,>=2.5.10
20
+ Requires-Dist: anthropic
21
+ Requires-Dist: httpx
22
+ Requires-Dist: pathspec>=0.12
23
+ Requires-Dist: python-dotenv>=1.2.2
24
+ Requires-Dist: prompt-toolkit>=3.0
25
+ Requires-Dist: rich
26
+ Requires-Dist: tree-sitter>=0.23
27
+ Requires-Dist: tree-sitter-python>=0.23
28
+ Requires-Dist: mcp>=1.0
29
+ Requires-Dist: openai>=2.29.0
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=8.0; extra == "dev"
32
+ Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
33
+ Provides-Extra: openai
34
+ Requires-Dist: openai>=1.0; extra == "openai"
35
+ Provides-Extra: ollama
36
+ Requires-Dist: ollama>=0.4; extra == "ollama"
37
+ Provides-Extra: groq
38
+ Requires-Dist: groq>=0.4; extra == "groq"
39
+ Provides-Extra: all-providers
40
+ Requires-Dist: openai>=1.0; extra == "all-providers"
41
+ Requires-Dist: ollama>=0.4; extra == "all-providers"
42
+ Requires-Dist: groq>=0.4; extra == "all-providers"
43
+ Dynamic: license-file
44
+
45
+ # aru
46
+
47
+ An intelligent coding assistant for the terminal, powered by LLMs and [Agno](https://github.com/agno-agi/agno) agents.
48
+ </br></br>
49
+ <img width="600" alt="image" src="https://github.com/user-attachments/assets/36001faa-3163-4374-84fd-da8704a4ed9d" />
50
+
51
+
52
+
53
+ ## Highlights
54
+
55
+ - **Multi-Agent Architecture** — Specialized agents for planning, execution, and conversation
56
+ - **Interactive CLI** — Streaming responses, multi-line paste, session management
57
+ - **16 Integrated Tools** — File operations, code search, shell, web search, task delegation
58
+ - **Task Planning** — Break down complex tasks into steps with automatic execution
59
+ - **Multi-Provider** — Anthropic, OpenAI, Ollama, Groq, OpenRouter, DeepSeek, and others via custom configuration
60
+ - **Custom Commands and Skills** — Extend aru via the `.agents/` directory
61
+ - **MCP Support** — Integration with Model Context Protocol servers
62
+
63
+ ## Quick Start
64
+
65
+ ### 1. Install
66
+
67
+ ```bash
68
+ pip install -e .
69
+ ```
70
+
71
+ > **Requirements:** Python 3.13+
72
+
73
+ ### 2. Configure the API Key
74
+
75
+ Aru uses **Claude Sonnet 4.6** from Anthropic as the default model. You need an [Anthropic API key](https://console.anthropic.com/) to get started.
76
+
77
+ Create a `.env` file in the project root:
78
+
79
+ ```bash
80
+ cp .env.example .env
81
+ ```
82
+
83
+ Edit the `.env` with your key:
84
+
85
+ ```env
86
+ ANTHROPIC_API_KEY=sk-ant-your-key-here
87
+ ```
88
+
89
+ > Using another provider? See the [Models and Providers](#models-and-providers) section to configure OpenAI, Ollama, Groq, etc.
90
+
91
+ ### 3. Run
92
+
93
+ ```bash
94
+ aru
95
+ ```
96
+
97
+ ### Global Installation (run `aru` from anywhere)
98
+
99
+ To use aru as a global command in the terminal, create a dedicated virtual environment and a wrapper script:
100
+
101
+ <details>
102
+ <summary><strong>Windows</strong></summary>
103
+
104
+ 1. Create the virtual environment and install:
105
+ ```bash
106
+ python -m venv C:\aru-env
107
+ C:\aru-env\Scripts\pip install -e C:\path\to\aru
108
+ ```
109
+
110
+ 2. Create `aru.bat` in a folder on your `PATH` (e.g., `C:\Users\<user>\bin\`):
111
+ ```bat
112
+ @echo off
113
+ C:\aru-env\Scripts\python -m aru.cli %*
114
+ ```
115
+
116
+ </details>
117
+
118
+ <details>
119
+ <summary><strong>Linux / macOS</strong></summary>
120
+
121
+ 1. Create the virtual environment and install:
122
+ ```bash
123
+ python3 -m venv ~/.aru-env
124
+ ~/.aru-env/bin/pip install -e /path/to/aru
125
+ ```
126
+
127
+ 2. Create the script `~/.local/bin/aru`:
128
+ ```bash
129
+ #!/bin/bash
130
+ ~/.aru-env/bin/python -m aru.cli "$@"
131
+ ```
132
+
133
+ 3. Make it executable:
134
+ ```bash
135
+ chmod +x ~/.local/bin/aru
136
+ ```
137
+
138
+ </details>
139
+
140
+ Done — now `aru` works from any directory.
141
+
142
+ ## Usage
143
+
144
+ ### Commands
145
+
146
+ | Command | Description |
147
+ |---------|-------------|
148
+ | Natural language | Just type — aru handles the rest |
149
+ | `/plan <task>` | Creates a detailed implementation plan |
150
+ | `/model [provider/model]` | Switch models and providers |
151
+ | `/mcp` | List available MCP servers and tools |
152
+ | `/commands` | List custom commands |
153
+ | `/skills` | List available skills |
154
+ | `/sessions` | List recent sessions |
155
+ | `/help` | Show all commands |
156
+ | `! <command>` | Execute shell commands |
157
+ | `/quit` or `/exit` | Exit aru |
158
+
159
+ ### CLI Options
160
+
161
+ ```bash
162
+ aru # Start new session
163
+ aru --resume <id> # Resume session
164
+ aru --resume last # Resume last session
165
+ aru --list # List sessions
166
+ aru --dangerously-skip-permissions # Skip permission prompts
167
+ ```
168
+
169
+ ### Examples
170
+
171
+ ```
172
+ aru> /plan create a REST API with FastAPI to manage users
173
+
174
+ aru> refactor the authentication module to use JWT tokens
175
+
176
+ aru> ! pytest tests/ -v
177
+
178
+ aru> /model ollama/codellama
179
+ ```
180
+
181
+ ## Configuration
182
+
183
+ ### Models and Providers
184
+
185
+ By default, aru uses **Claude Sonnet 4.6** (Anthropic). You can switch to any supported provider during a session with `/model`:
186
+
187
+ | Provider | Command | API Key (`.env`) | Extra Installation |
188
+ |----------|---------|-------------------|------------------|
189
+ | **Anthropic** | `/model anthropic/claude-sonnet-4-6` | `ANTHROPIC_API_KEY` | — (included) |
190
+ | **Ollama** | `/model ollama/llama3.1` | — (local) | `pip install -e ".[ollama]"` |
191
+ | **OpenAI** | `/model openai/gpt-4o` | `OPENAI_API_KEY` | `pip install -e ".[openai]"` |
192
+ | **Groq** | `/model groq/llama-3.3-70b-versatile` | `GROQ_API_KEY` | `pip install -e ".[groq]"` |
193
+ | **OpenRouter** | `/model openrouter/deepseek/deepseek-chat-v3-0324` | `OPENROUTER_API_KEY` | `pip install -e ".[openai]"` |
194
+
195
+ To install all providers at once:
196
+
197
+ ```bash
198
+ pip install -e ".[all-providers]"
199
+ ```
200
+
201
+ #### Ollama (local models)
202
+
203
+ To run models locally without an API key, install [Ollama](https://ollama.com/), start the server, and use any installed model:
204
+
205
+ ```bash
206
+ ollama serve # Start the Ollama server
207
+ ollama pull codellama # Download a model
208
+ aru # Start aru
209
+ # Inside aru:
210
+ /model ollama/codellama
211
+ ```
212
+
213
+ #### Configuring the default model
214
+
215
+ You can set the default provider/model in `aru.json` so you don't need to switch manually every session:
216
+
217
+ ```json
218
+ {
219
+ "models": {
220
+ "default": "openrouter/deepseek/deepseek-chat-v3-0324",
221
+ "minimax": "openrouter/minimax/minimax-m2.5",
222
+ "deepseek-v3": "openrouter/deepseek/deepseek-chat-v3-0324",
223
+ "sonnet-4-6": "anthropic/claude-sonnet-4-6",
224
+ "opus-4-6": "anthropic/claude-opus-4-6"
225
+ }
226
+ }
227
+ ```
228
+
229
+ The `default` field sets the main model. The other fields are aliases that can be used with `/model <alias>`.
230
+
231
+ #### Custom providers
232
+
233
+ You can configure custom providers with specific token limits:
234
+
235
+ ```json
236
+ {
237
+ "providers": {
238
+ "deepseek": {
239
+ "models": {
240
+ "deepseek-chat-v3-0324": {"id": "deepseek-chat-v3-0324", "max_tokens": 16384}
241
+ }
242
+ },
243
+ "openrouter": {
244
+ "models": {
245
+ "minimax/minimax-m2.5": {"id": "minimax/minimax-m2.5", "max_tokens": 65536}
246
+ }
247
+ }
248
+ }
249
+ }
250
+ ```
251
+
252
+ ### Permissions (`aru.json`)
253
+
254
+ The `aru.json` file in the project root controls which shell commands aru can execute **without asking for confirmation**:
255
+
256
+ ```json
257
+ {
258
+ "permission": {
259
+ "allow": [
260
+ "git *",
261
+ "npm *",
262
+ "pytest *",
263
+ "python *",
264
+ "uv run pytest *"
265
+ ]
266
+ }
267
+ }
268
+ ```
269
+
270
+ Each entry is a glob pattern. Any command that doesn't match a listed pattern will prompt for confirmation before executing.
271
+
272
+ > `aru.json` can also be placed at `.aru/config.json`.
273
+
274
+ ### AGENTS.md
275
+
276
+ Place an `AGENTS.md` file in your project root with custom instructions that will be appended to all agent system prompts.
277
+
278
+ ### `.agents/` Directory
279
+
280
+ ```
281
+ .agents/
282
+ ├── commands/ # Custom slash commands (filename = command name)
283
+ │ └── deploy.md # Usage: /deploy <args>
284
+ └── skills/ # Custom skills/personas
285
+ └── review.md # Loaded as additional agent instructions
286
+ ```
287
+
288
+ Command files support frontmatter with `description` and the `$INPUT` template variable for arguments.
289
+
290
+ ### MCP Support (Model Context Protocol)
291
+
292
+ Aru can load tools from MCP servers. Configure in `.aru/mcp_config.json`:
293
+
294
+ ```json
295
+ {
296
+ "mcpServers": {
297
+ "filesystem": {
298
+ "command": "npx",
299
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "/allowed/path"]
300
+ }
301
+ }
302
+ }
303
+ ```
304
+
305
+ ## Agents
306
+
307
+ | Agent | Role | Tools |
308
+ |-------|------|-------|
309
+ | **Planner** | Analyzes codebase, creates structured implementation plans | Read-only tools, search, web |
310
+ | **Executor** | Implements code changes based on plans or instructions | All tools including delegation |
311
+ | **General** | Handles conversation and simple operations | All tools including delegation |
312
+
313
+ ## Tools
314
+
315
+ ### File Operations
316
+ - `read_file` — Reads files with line range support and binary detection
317
+ - `read_file_smart` — Smart file reading focused on relevant snippets for the query
318
+ - `write_file` / `write_files` — Writes single or batch files
319
+ - `edit_file` / `edit_files` — Find-replace edits across multiple files
320
+
321
+ ### Search & Discovery
322
+ - `glob_search` — Find files by pattern (respects .gitignore)
323
+ - `grep_search` — Content search with regex and file filtering
324
+ - `list_directory` — Directory listing with gitignore filtering
325
+ - `rank_files` — Multi-factor file relevance ranking (name, structure, recency)
326
+
327
+ ### Code Analysis
328
+ - `code_structure` — Extracts classes, functions, imports via tree-sitter AST
329
+ - `find_dependencies` — Analyzes import relationships between files
330
+
331
+ ### Shell & Web
332
+ - `bash` — Executes shell commands with permission gates
333
+ - `web_search` — Web search via DuckDuckGo
334
+ - `web_fetch` — Fetches URLs and converts HTML to readable text
335
+
336
+ ### Advanced
337
+ - `delegate_task` — Spawns autonomous sub-agents for parallel task execution
338
+
339
+ ## Architecture
340
+
341
+ ```
342
+ aru-code/
343
+ ├── aru/
344
+ │ ├── cli.py # Interactive CLI with streaming display
345
+ │ ├── config.py # Configuration loader (AGENTS.md, .agents/)
346
+ │ ├── providers.py # Multi-provider LLM abstraction
347
+ │ ├── agents/
348
+ │ │ ├── planner.py # Planning agent
349
+ │ │ └── executor.py # Execution agent
350
+ │ └── tools/
351
+ │ ├── codebase.py # 16 core tools
352
+ │ ├── ast_tools.py # Tree-sitter code analysis
353
+ │ ├── ranker.py # File relevance ranking
354
+ │ ├── mcp_client.py # MCP client
355
+ │ └── gitignore.py # Gitignore-aware filtering
356
+ ├── aru.json # Permissions and model configuration
357
+ ├── .env # API keys (not committed)
358
+ ├── .aru/ # Local data (sessions)
359
+ └── pyproject.toml
360
+ ```
361
+
362
+ ## Built With
363
+
364
+ - **[Agno](https://github.com/agno-agi/agno)** — Agent framework with tool orchestration
365
+ - **[Anthropic Claude](https://www.anthropic.com/)** — Sonnet 4.6, Opus 4.6, Haiku 4.5
366
+ - **[tree-sitter](https://tree-sitter.github.io/)** — AST-based code analysis
367
+ - **[Rich](https://rich.readthedocs.io/)** — Terminal UI
368
+ - **[prompt-toolkit](https://python-prompt-toolkit.readthedocs.io/)** — Advanced input handling
369
+
370
+ ## Development
371
+
372
+ ```bash
373
+ # Install with development dependencies
374
+ pip install -e ".[dev]"
375
+
376
+ # Run tests
377
+ pytest
378
+
379
+ # Run tests with coverage
380
+ pytest --cov=aru --cov-report=term-missing
381
+ ```
382
+
383
+ ---
384
+
385
+ Built with Claude and Agno