devorch 0.2.1__tar.gz → 0.4.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 (86) hide show
  1. devorch-0.4.0/DEVORCH.md +48 -0
  2. devorch-0.4.0/LICENSE +21 -0
  3. devorch-0.4.0/PKG-INFO +485 -0
  4. devorch-0.4.0/README.md +443 -0
  5. devorch-0.4.0/cli/commands/_shared.py +338 -0
  6. devorch-0.4.0/cli/commands/ask.py +71 -0
  7. devorch-0.4.0/cli/commands/edit.py +52 -0
  8. devorch-0.4.0/cli/commands/run.py +62 -0
  9. devorch-0.4.0/cli/constants.py +166 -0
  10. {devorch-0.2.1 → devorch-0.4.0}/cli/main.py +825 -388
  11. {devorch-0.2.1 → devorch-0.4.0}/core/agent.py +126 -73
  12. devorch-0.4.0/core/context.py +233 -0
  13. {devorch-0.2.1 → devorch-0.4.0}/core/executor.py +7 -0
  14. devorch-0.4.0/core/loop_detector.py +185 -0
  15. {devorch-0.2.1 → devorch-0.4.0}/core/mcp.py +32 -0
  16. {devorch-0.2.1 → devorch-0.4.0}/core/modes.py +6 -8
  17. devorch-0.4.0/core/project_context.py +193 -0
  18. devorch-0.4.0/core/project_memory.py +317 -0
  19. {devorch-0.2.1 → devorch-0.4.0}/providers/anthropic.py +14 -1
  20. devorch-0.4.0/providers/base.py +141 -0
  21. {devorch-0.2.1 → devorch-0.4.0}/providers/custom.py +23 -24
  22. {devorch-0.2.1 → devorch-0.4.0}/providers/deepseek.py +21 -24
  23. {devorch-0.2.1 → devorch-0.4.0}/providers/gemini.py +17 -1
  24. {devorch-0.2.1 → devorch-0.4.0}/providers/github_copilot.py +21 -24
  25. {devorch-0.2.1 → devorch-0.4.0}/providers/groq.py +2 -1
  26. {devorch-0.2.1 → devorch-0.4.0}/providers/kimi.py +21 -24
  27. {devorch-0.2.1 → devorch-0.4.0}/providers/lmstudio.py +2 -1
  28. {devorch-0.2.1 → devorch-0.4.0}/providers/local.py +2 -1
  29. {devorch-0.2.1 → devorch-0.4.0}/providers/mistral.py +2 -1
  30. {devorch-0.2.1 → devorch-0.4.0}/providers/openai.py +15 -1
  31. {devorch-0.2.1 → devorch-0.4.0}/providers/openrouter.py +2 -1
  32. {devorch-0.2.1 → devorch-0.4.0}/providers/together.py +2 -1
  33. {devorch-0.2.1 → devorch-0.4.0}/pyproject.toml +1 -1
  34. {devorch-0.2.1 → devorch-0.4.0}/schemas/message.py +9 -0
  35. devorch-0.4.0/tests/test_context.py +72 -0
  36. {devorch-0.2.1 → devorch-0.4.0}/tests/test_core.py +17 -0
  37. devorch-0.4.0/tests/test_loop_detector.py +62 -0
  38. devorch-0.4.0/tests/test_project_context.py +65 -0
  39. devorch-0.4.0/tests/test_project_memory.py +134 -0
  40. {devorch-0.2.1 → devorch-0.4.0}/tests/test_tools.py +48 -0
  41. devorch-0.4.0/tools/agent.py +105 -0
  42. {devorch-0.2.1 → devorch-0.4.0}/tools/edit.py +30 -1
  43. {devorch-0.2.1 → devorch-0.4.0}/tools/grep.py +10 -5
  44. devorch-0.4.0/tools/shell.py +111 -0
  45. {devorch-0.2.1 → devorch-0.4.0}/tools/terminal_session.py +1 -1
  46. devorch-0.2.1/PKG-INFO +0 -363
  47. devorch-0.2.1/README.md +0 -322
  48. devorch-0.2.1/cli/commands/ask.py +0 -0
  49. devorch-0.2.1/cli/commands/edit.py +0 -0
  50. devorch-0.2.1/cli/commands/run.py +0 -0
  51. devorch-0.2.1/core/context.py +0 -0
  52. devorch-0.2.1/providers/base.py +0 -51
  53. devorch-0.2.1/tools/shell.py +0 -55
  54. {devorch-0.2.1 → devorch-0.4.0}/.github/workflows/ci.yml +0 -0
  55. {devorch-0.2.1 → devorch-0.4.0}/.github/workflows/publish.yml +0 -0
  56. {devorch-0.2.1 → devorch-0.4.0}/.gitignore +0 -0
  57. {devorch-0.2.1 → devorch-0.4.0}/assets/chat.png +0 -0
  58. {devorch-0.2.1 → devorch-0.4.0}/assets/models.png +0 -0
  59. {devorch-0.2.1 → devorch-0.4.0}/assets/providers.png +0 -0
  60. {devorch-0.2.1 → devorch-0.4.0}/assets/startup.png +0 -0
  61. {devorch-0.2.1 → devorch-0.4.0}/assets/terminal.png +0 -0
  62. {devorch-0.2.1 → devorch-0.4.0}/assets/tools.png +0 -0
  63. {devorch-0.2.1 → devorch-0.4.0}/config/permissions.py +0 -0
  64. {devorch-0.2.1 → devorch-0.4.0}/config/profiles.py +0 -0
  65. {devorch-0.2.1 → devorch-0.4.0}/config/settings.py +0 -0
  66. {devorch-0.2.1 → devorch-0.4.0}/core/memory.py +0 -0
  67. {devorch-0.2.1 → devorch-0.4.0}/core/planner.py +0 -0
  68. {devorch-0.2.1 → devorch-0.4.0}/core/sessions.py +0 -0
  69. {devorch-0.2.1 → devorch-0.4.0}/core/skills.py +0 -0
  70. {devorch-0.2.1 → devorch-0.4.0}/core/tasks.py +0 -0
  71. {devorch-0.2.1 → devorch-0.4.0}/providers/__init__.py +0 -0
  72. {devorch-0.2.1 → devorch-0.4.0}/schemas/task.py +0 -0
  73. {devorch-0.2.1 → devorch-0.4.0}/schemas/tool.py +0 -0
  74. {devorch-0.2.1 → devorch-0.4.0}/tests/__init__.py +0 -0
  75. {devorch-0.2.1 → devorch-0.4.0}/tests/test_integration.py +0 -0
  76. {devorch-0.2.1 → devorch-0.4.0}/tests/test_permissions.py +0 -0
  77. {devorch-0.2.1 → devorch-0.4.0}/tests/test_schemas.py +0 -0
  78. {devorch-0.2.1 → devorch-0.4.0}/tools/__init__.py +0 -0
  79. {devorch-0.2.1 → devorch-0.4.0}/tools/base.py +0 -0
  80. {devorch-0.2.1 → devorch-0.4.0}/tools/filesystem.py +0 -0
  81. {devorch-0.2.1 → devorch-0.4.0}/tools/git.py +0 -0
  82. {devorch-0.2.1 → devorch-0.4.0}/tools/search.py +0 -0
  83. {devorch-0.2.1 → devorch-0.4.0}/tools/task.py +0 -0
  84. {devorch-0.2.1 → devorch-0.4.0}/tools/tests.py +0 -0
  85. {devorch-0.2.1 → devorch-0.4.0}/tools/websearch.py +0 -0
  86. {devorch-0.2.1 → devorch-0.4.0}/utils/logger.py +0 -0
@@ -0,0 +1,48 @@
1
+ # DevOrch - AI Coding Assistant CLI
2
+
3
+ ## Overview
4
+ DevOrch is an enterprise-ready, multi-provider AI coding assistant CLI with support for 13+ LLM providers, interactive REPL, persistent sessions, tool execution, MCP servers, and background terminal processes.
5
+
6
+ ## Tech Stack
7
+ - **Language**: Python 3.10+ (tested on Python 3.10-3.13)
8
+ - **CLI Framework**: Typer, Questionary, Prompt Toolkit, Rich
9
+ - **AI / SDKs**: OpenAI, Anthropic, Google GenAI SDK, HTTPX
10
+ - **Data Validation**: Pydantic v2
11
+ - **Testing & Quality**: Pytest, Pytest-asyncio, Ruff, Mypy
12
+
13
+ ## Architecture & Project Structure
14
+ - `cli/`: CLI entrypoints, Typer commands (`ask`, `edit`, `run`, `init`), slash command handlers, banners, and REPL.
15
+ - `core/`: Agent orchestration engine:
16
+ - `agent.py`: Main agentic loop, tool calling, execution loop, plan mode approval.
17
+ - `context.py`: Token estimation, context compaction, tool output pruning, token usage tracking.
18
+ - `loop_detector.py`: Duplicate call detection, oscillation detection, error thrashing prevention, turn advisories.
19
+ - `project_context.py`: Auto-discovers and loads repository instructions (`DEVORCH.md`, `CLAUDE.md`, `AGENTS.md`).
20
+ - `executor.py`: Tool permission enforcement and invocation.
21
+ - `planner.py`: Message preparation and system prompt injection.
22
+ - `sessions.py`: Session persistence, continuation, and summarization.
23
+ - `modes.py`: Agent execution modes (`ASK`, `AUTO`, `PLAN`).
24
+ - `memory.py` & `skills.py`: Persistent memory and skill definitions.
25
+ - `tools/`: Built-in tools:
26
+ - `filesystem.py`: File reading with pagination, writing, directory listing.
27
+ - `edit.py`: Surgical find/replace, line-based editing, diff generation.
28
+ - `grep.py`: Fast regex pattern search across text files.
29
+ - `search.py`: Glob-based file and directory search.
30
+ - `shell.py` & `terminal_session.py`: Shell execution and persistent terminal sessions.
31
+ - `providers/`: Unified LLM provider adapters (`openai`, `anthropic`, `gemini`, `groq`, `deepseek`, etc.).
32
+ - `schemas/`: Dataclasses for `Message`, `ToolCall`, `LLMResponse`, `TokenUsage`.
33
+
34
+ ## Common Commands
35
+ - **Run Tests**: `pytest` or `python -m pytest`
36
+ - **Run Single Test**: `pytest tests/test_context.py`
37
+ - **Lint**: `ruff check .`
38
+ - **Format**: `ruff format .`
39
+ - **Type Check**: `mypy .`
40
+ - **Run DevOrch Locally**: `devorch` or `python -m cli.main`
41
+
42
+ ## Coding Standards & Minimal Token Guidelines
43
+ 1. **Find Before Reading**: Always use `search` (to find file paths) or `grep` (to find symbols/definitions) before reading file contents.
44
+ 2. **Inspect Surgically**: Use `filesystem` with `action="read_lines"` or specific line ranges rather than dumping huge files.
45
+ 3. **Edit Surgically**: Use `edit` with `action="replace"` or `action="replace_lines"` to generate clean unified diffs. Avoid full file rewrites whenever possible.
46
+ 4. **Prevent Loops**: Never repeat identical tool calls with the same arguments. If a tool fails or finds nothing, alter the query or check file paths.
47
+ 5. **Verify Changes**: After modifying code, always run the relevant pytest test suite to verify correctness before reporting completion.
48
+ 6. **Preserve Compatibility**: Keep type hints compatible with Python 3.10+ (use `|` for unions or `Optional`/`Union`).
devorch-0.4.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Amanpreet Singh
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.
devorch-0.4.0/PKG-INFO ADDED
@@ -0,0 +1,485 @@
1
+ Metadata-Version: 2.5
2
+ Name: devorch
3
+ Version: 0.4.0
4
+ Summary: Multi-provider AI coding assistant CLI with 13+ providers
5
+ Project-URL: Homepage, https://github.com/Amanbig/DevOrch
6
+ Project-URL: Repository, https://github.com/Amanbig/DevOrch
7
+ Project-URL: Issues, https://github.com/Amanbig/DevOrch/issues
8
+ Author-email: Aman <amanpreetsinghjhiwant@outlook.com>
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: ai,anthropic,assistant,claude,cli,coding,copilot,deepseek,gemini,gpt,kimi,llm,llmstudio,mistral,openai,openrouter,together
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development
21
+ Classifier: Topic :: Utilities
22
+ Requires-Python: >=3.10
23
+ Requires-Dist: anthropic>=0.25.8
24
+ Requires-Dist: duckduckgo-search>=6.0.0
25
+ Requires-Dist: google-genai>=1.0.0
26
+ Requires-Dist: httpx>=0.27.0
27
+ Requires-Dist: keyring>=25.0.0
28
+ Requires-Dist: openai>=1.28.0
29
+ Requires-Dist: prompt-toolkit>=3.0.0
30
+ Requires-Dist: pydantic>=2.7.1
31
+ Requires-Dist: pyyaml>=6.0
32
+ Requires-Dist: questionary>=2.0.0
33
+ Requires-Dist: rich>=13.7.1
34
+ Requires-Dist: typer>=0.12.3
35
+ Provides-Extra: dev
36
+ Requires-Dist: mypy>=1.10.0; extra == 'dev'
37
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
38
+ Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
39
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
40
+ Requires-Dist: ruff>=0.4.0; extra == 'dev'
41
+ Description-Content-Type: text/markdown
42
+
43
+ <p align="center">
44
+ <h1 align="center">DevOrch</h1>
45
+ <p align="center">
46
+ A multi-provider AI coding assistant CLI — like Claude Code and Gemini CLI, but open source.
47
+ </p>
48
+ </p>
49
+
50
+ <p align="center">
51
+ <a href="https://pypi.org/project/devorch/"><img src="https://img.shields.io/pypi/v/devorch?color=blue&label=PyPI" alt="PyPI"></a>
52
+ <a href="https://pypi.org/project/devorch/"><img src="https://img.shields.io/pypi/pyversions/devorch" alt="Python"></a>
53
+ <a href="https://github.com/Amanbig/DevOrch/blob/main/LICENSE"><img src="https://img.shields.io/github/license/Amanbig/DevOrch" alt="License"></a>
54
+ <a href="https://github.com/Amanbig/DevOrch/stargazers"><img src="https://img.shields.io/github/stars/Amanbig/DevOrch?style=social" alt="Stars"></a>
55
+ </p>
56
+
57
+ ---
58
+
59
+ DevOrch gives you a coding assistant in your terminal that can execute shell commands, edit files, search your codebase, manage terminal sessions, and remember context across conversations — powered by any of 13+ AI providers or your own local models.
60
+
61
+ ## Screenshots
62
+
63
+ | Startup | Chat |
64
+ |---------|------|
65
+ | ![Startup](https://raw.githubusercontent.com/Amanbig/DevOrch/main/assets/startup.png) | ![Chat](https://raw.githubusercontent.com/Amanbig/DevOrch/main/assets/chat.png) |
66
+
67
+ | Provider Selection | Model Selection |
68
+ |--------------------|-----------------|
69
+ | ![Providers](https://raw.githubusercontent.com/Amanbig/DevOrch/main/assets/providers.png) | ![Models](https://raw.githubusercontent.com/Amanbig/DevOrch/main/assets/models.png) |
70
+
71
+ | Tool Execution | Terminal Session |
72
+ |----------------|-----------------|
73
+ | ![Tools](https://raw.githubusercontent.com/Amanbig/DevOrch/main/assets/tools.png) | ![Terminal](https://raw.githubusercontent.com/Amanbig/DevOrch/main/assets/terminal.png) |
74
+
75
+ ## Why DevOrch?
76
+
77
+ - **Provider freedom** — Switch between OpenAI, Anthropic, Gemini, Mistral, Groq, and 8 more providers (including local models) with a single command. No vendor lock-in.
78
+ - **Actually does things** — Runs shell commands, edits files, manages background processes, searches the web. Not just a chatbot.
79
+ - **Cross-session project memory** — Per-project persistent memory system automatically recalls architecture decisions, coding preferences, and recent session milestones across sessions.
80
+ - **Loop & thrashing safeguards** — Advanced safety layer detects duplicate calls, tool oscillation, and error loops, preventing runaway token drain.
81
+ - **Full token & speed transparency** — Real-time prompt/completion token tracking, context compaction metrics, and generation speed (`tok/s`) across 13 providers.
82
+ - **Extensible** — Add custom skills as YAML files, connect MCP servers for additional tools, configure permissions per-tool.
83
+
84
+ ## Quick Start
85
+
86
+ ### Install
87
+
88
+ ```bash
89
+ # Recommended
90
+ pipx install devorch
91
+
92
+ # Or with pip
93
+ pip install devorch
94
+
95
+ # Or from source
96
+ git clone https://github.com/Amanbig/DevOrch.git
97
+ cd DevOrch && pip install -e .
98
+ ```
99
+
100
+ ### Run
101
+
102
+ ```bash
103
+ devorch # Interactive setup on first run
104
+ devorch -p openai # Use a specific provider
105
+ devorch -p local # Use Ollama (local models)
106
+ devorch --resume abc123 # Resume a previous session
107
+
108
+ # Non-interactive (scripting / CI)
109
+ devorch ask "explain this project"
110
+ devorch ask --skill commit
111
+ devorch run review "focus on security"
112
+ devorch edit src/auth.py "add input validation"
113
+ ```
114
+
115
+ On first run, DevOrch walks you through provider selection and API key setup.
116
+
117
+ ## Features
118
+
119
+ ### 13+ AI Providers
120
+
121
+ | Cloud | Local / Self-Hosted |
122
+ |-------|---------------------|
123
+ | OpenAI (GPT-4o, o1) | Ollama (Llama, Mistral, CodeLlama) |
124
+ | Anthropic (Claude 4, 3.5) | LM Studio (any GGUF model) |
125
+ | Google Gemini (2.0, 1.5 Pro) | Custom (vLLM, TGI, llama.cpp) |
126
+ | Groq (ultra-fast Llama, Mixtral) | |
127
+ | Mistral (Large, Codestral) | |
128
+ | Together AI, OpenRouter, GitHub Copilot, DeepSeek, Kimi | |
129
+
130
+ Switch anytime with `/providers` (interactive) or `/provider <name>` (direct).
131
+
132
+ ### Built-in Tools
133
+
134
+ DevOrch can act on your system, not just talk about it:
135
+
136
+ | Tool | What it does |
137
+ |------|-------------|
138
+ | `shell` | Execute commands (`git status`, `npm install`, etc.) |
139
+ | `terminal_session` | Managed background processes with optional GUI window |
140
+ | `filesystem` | Read, write, list files |
141
+ | `search` / `grep` | Find files and search contents |
142
+ | `edit` | Targeted find-and-replace edits |
143
+ | `task` | Track progress on multi-step work |
144
+ | `memory` | Persistent memory across conversations |
145
+ | `websearch` / `webfetch` | Search the web, fetch URLs |
146
+
147
+ ### Memory & Project Context
148
+
149
+ DevOrch maintains persistent memory so you never have to repeat context:
150
+
151
+ **1. Per-Project Memory (Cross-Session Recall)**
152
+ Stored automatically per repository in `~/.devorch/projects/<project_id>/`:
153
+ ```bash
154
+ /memory # View active architectural decisions & session history
155
+ /memory add Use uv for package management # Record an architectural decision
156
+ /memory pref Prefer clean async/await # Record a coding style preference
157
+ /memory clear # Clear project memory for this repository
158
+ ```
159
+ *Accomplishments are automatically extracted and summarized on session exit with zero raw command leakage.*
160
+
161
+ **2. Global Memory (Across All Projects)**
162
+ Stored in `~/.devorch/memory/`:
163
+ ```bash
164
+ /remember I prefer tabs over spaces
165
+ /remember Use ruff for Python linting
166
+ /forget # Interactively choose a memory to remove
167
+ ```
168
+
169
+ ### Skills
170
+
171
+ Reusable prompt templates for common workflows. Use them in chat or directly from the CLI:
172
+
173
+ ```bash
174
+ # In chat
175
+ /commit # Generate a descriptive git commit
176
+ /review # Review code changes for bugs
177
+ /test # Run tests and analyze results
178
+ /fix # Fix the last error
179
+ /explain # Explain project structure
180
+ /simplify # Simplify recent code changes
181
+
182
+ # From the terminal (non-interactive)
183
+ devorch run commit
184
+ devorch run review "focus on auth module"
185
+ devorch run test
186
+
187
+ devorch skills # List all available skills
188
+ ```
189
+
190
+ Add your own in `~/.devorch/skills/`:
191
+
192
+ ```yaml
193
+ # ~/.devorch/skills/deploy.yaml
194
+ name: deploy
195
+ description: Deploy to production
196
+ prompt: |
197
+ Run the deploy script and verify it succeeds.
198
+ Check the deploy logs for any errors.
199
+ ```
200
+
201
+ ### Terminal Sessions
202
+
203
+ Background processes that persist across DevOrch restarts:
204
+
205
+ ```bash
206
+ # Headless — AI monitors output
207
+ > terminal_session start command="npm run dev"
208
+ Session 'swift-fox-a3f2' started (PID 12345)
209
+
210
+ # With GUI — user gets a visible terminal, AI can still read output
211
+ > terminal_session start command="bash" gui=true
212
+ Session 'calm-owl-b7e1' started in visible terminal
213
+
214
+ # Check output / send input / stop
215
+ > terminal_session read session_id="swift-fox-a3f2"
216
+ > terminal_session send session_id="swift-fox-a3f2" input="rs\n"
217
+ > terminal_session stop session_id="swift-fox-a3f2"
218
+ ```
219
+
220
+ ### MCP (Model Context Protocol)
221
+
222
+ Extend DevOrch with external tool servers:
223
+
224
+ ```yaml
225
+ # ~/.devorch/config.yaml
226
+ mcp_servers:
227
+ github:
228
+ command: npx
229
+ args: ["-y", "@modelcontextprotocol/server-github"]
230
+ env:
231
+ GITHUB_TOKEN: "ghp_xxx"
232
+ filesystem:
233
+ command: npx
234
+ args: ["-y", "@modelcontextprotocol/server-filesystem", "/home/user"]
235
+ ```
236
+
237
+ MCP tools appear alongside built-in tools automatically.
238
+
239
+ **Manage MCP servers live in chat:**
240
+
241
+ ```
242
+ /mcp # Show connected servers and their tools
243
+ /mcp add github npx -y @modelcontextprotocol/server-github
244
+ /mcp start github # Reconnect a server from config
245
+ /mcp stop github # Disconnect and remove its tools
246
+ ```
247
+
248
+ **Filter MCP servers per CLI run:**
249
+
250
+ ```bash
251
+ devorch ask --mcp github "review open PRs" # Use only the github server
252
+ devorch ask --mcp github --mcp filesystem "..." # Use specific servers
253
+ devorch run commit --no-mcp # Skip MCP entirely
254
+ ```
255
+
256
+ ### Modes
257
+
258
+ | Mode | Behavior |
259
+ |------|----------|
260
+ | **ASK** (default) | Asks permission before each tool execution |
261
+ | **AUTO** | Executes tools automatically (dangerous commands still blocked) |
262
+ | **PLAN** | Shows a plan before executing, asks for approval |
263
+
264
+ ### Permission System
265
+
266
+ Fine-grained control over what DevOrch can do:
267
+
268
+ ```bash
269
+ devorch permissions list # View current rules
270
+ devorch permissions set shell allow # Always allow shell
271
+ devorch permissions allow shell "git *" # Allow specific patterns
272
+ devorch permissions deny shell "rm -rf *" # Block dangerous commands
273
+ ```
274
+
275
+ Or use `/auth` in-chat to set API keys without restarting.
276
+
277
+ ## Non-Interactive CLI Commands
278
+
279
+ DevOrch works as a scriptable CLI too — no REPL needed:
280
+
281
+ ```bash
282
+ # Ask a one-shot question
283
+ devorch ask "what does this codebase do?"
284
+ devorch ask --skill review "focus on security"
285
+ devorch ask --mode plan "refactor the auth module"
286
+
287
+ # Run a skill directly (shorthand for ask --skill)
288
+ devorch run commit
289
+ devorch run test "only unit tests"
290
+ devorch run review --no-mcp
291
+
292
+ # Edit a file with an instruction
293
+ devorch edit src/auth.py "add input validation to login"
294
+ devorch edit README.md "update the installation section"
295
+ devorch edit app/models.py "add created_at field" --mcp sqlite
296
+
297
+ # List available skills
298
+ devorch skills
299
+
300
+ # Browse providers and models directly from terminal
301
+ devorch providers # View all 13 providers & configuration status
302
+ devorch models # View models for active provider
303
+ devorch models anthropic # View models for a specific provider
304
+
305
+ # Inspect or manage project memory
306
+ devorch memory # View project decisions and recent accomplishments
307
+ devorch memory add "Use pytest" # Record a decision from the terminal
308
+ devorch memory clear # Clear project memory
309
+
310
+ # Repository initialization
311
+ devorch init # Generate or update DEVORCH.md repository instructions
312
+ ```
313
+
314
+ All non-interactive commands support `--provider`, `--model`, `--mode`, `--mcp`, and `--no-mcp`.
315
+
316
+ ## All Slash Commands
317
+
318
+ | Command | Description |
319
+ |---------|-------------|
320
+ | `/help` | Show categorized commands and shortcuts |
321
+ | `/mode [plan\|auto\|ask]` | Show or switch execution mode |
322
+ | `/plan` `/auto` `/ask` | Quick switch execution mode |
323
+ | `/models` | Search and browse models with 15/page pagination |
324
+ | `/model <name>` | Switch model directly or launch search |
325
+ | `/providers` | Search and browse providers with interactive pagination |
326
+ | `/provider <name>` | Switch provider directly or launch search |
327
+ | `/tokens` | Show session token usage, prompt/completion split, and costs |
328
+ | `/copy` | Copy last assistant response directly to clipboard |
329
+ | `/paste` | Enter multi-line paste mode for large text or code (`Alt+Enter` also inserts newlines) |
330
+ | `/status` | Show current provider, model, execution mode, and loaded context |
331
+ | `/auth [provider]` | Set or update API key for any provider |
332
+ | `/memory` | Show project memory (`/memory add <dec>`, `/memory pref <p>`, `/memory clear`) |
333
+ | `/remember <text>` | Save a note or convention to global memory |
334
+ | `/forget` | Delete a global memory interactively or by query |
335
+ | `/init` | Generate or update a `DEVORCH.md` project context file |
336
+ | `/skills` | List available skills |
337
+ | `/skill <name>` | Run a skill directly |
338
+ | `/commit` `/review` `/test` `/fix` `/explain` `/simplify` | Skill shortcuts |
339
+ | `/session` | Current session ID, model, and message count |
340
+ | `/history` | Full conversation history in this session |
341
+ | `/clear` | Clear history (saves accomplishments to project memory) |
342
+ | `/compact` | Summarize and compact conversation history to save tokens |
343
+ | `/save` | Save conversation history to a file |
344
+ | `/undo` | Undo last message and agent turn |
345
+ | `/mcp` | Show MCP server status |
346
+ | `/mcp add <name> <cmd> [args]` | Connect a new MCP server mid-session |
347
+ | `/mcp start <name>` | Reconnect a server from config |
348
+ | `/mcp stop <name>` | Disconnect a server and remove its tools |
349
+ | `/config` | Show configuration settings |
350
+ | `/permissions` | Show and manage tool permission settings |
351
+ | `/tasks` | Show multi-step task list and execution progress |
352
+
353
+ ## Configuration
354
+
355
+ ### API Keys
356
+
357
+ ```bash
358
+ # Secure keychain storage
359
+ devorch set-key openai
360
+ devorch set-key anthropic
361
+
362
+ # Or in-chat
363
+ /auth openai
364
+
365
+ # Or environment variables
366
+ export OPENAI_API_KEY=sk-...
367
+ export ANTHROPIC_API_KEY=sk-ant-...
368
+ export GOOGLE_API_KEY=...
369
+ export GROQ_API_KEY=gsk_...
370
+ export MISTRAL_API_KEY=...
371
+ export OPENROUTER_API_KEY=sk-or-...
372
+ export TOGETHER_API_KEY=...
373
+ export GITHUB_TOKEN=ghp_...
374
+ export DEEPSEEK_API_KEY=sk-...
375
+ export MOONSHOT_API_KEY=sk-...
376
+ ```
377
+
378
+ ### Config File
379
+
380
+ ```yaml
381
+ # ~/.devorch/config.yaml
382
+ default_provider: openai
383
+
384
+ providers:
385
+ openai:
386
+ default_model: gpt-4o
387
+ anthropic:
388
+ default_model: claude-sonnet-4-20250514
389
+ custom_vllm:
390
+ default_model: meta-llama/Meta-Llama-3-70B-Instruct
391
+ base_url: http://localhost:8000/v1
392
+
393
+ mcp_servers:
394
+ github:
395
+ command: npx
396
+ args: ["-y", "@modelcontextprotocol/server-github"]
397
+ env:
398
+ GITHUB_TOKEN: "ghp_xxx"
399
+ ```
400
+
401
+ ### Directory Layout
402
+
403
+ ```
404
+ ~/.devorch/
405
+ ├── config.yaml # Provider settings, MCP servers
406
+ ├── permissions.yaml # Tool permission rules
407
+ ├── sessions.db # Chat history (SQLite)
408
+ ├── memory/ # Persistent memories
409
+ │ ├── MEMORY.md
410
+ │ └── *.md
411
+ ├── skills/ # Custom skill definitions
412
+ │ └── *.yaml
413
+ └── sessions/ # Terminal session logs
414
+ ├── registry.json
415
+ └── *.log
416
+ ```
417
+
418
+ ## Contributing
419
+
420
+ Contributions are welcome! Here's how to get started:
421
+
422
+ ```bash
423
+ # Clone and install in development mode
424
+ git clone https://github.com/Amanbig/DevOrch.git
425
+ cd DevOrch
426
+ pip install -e ".[dev]"
427
+
428
+ # Run linting
429
+ ruff check .
430
+ ruff format .
431
+
432
+ # Run tests
433
+ pytest
434
+ ```
435
+
436
+ ### Guidelines
437
+
438
+ - Run `ruff check .` and `ruff format .` before submitting
439
+ - Add tests for new features
440
+ - Keep PRs focused — one feature or fix per PR
441
+ - Update the README if adding user-facing features
442
+
443
+ ### Project Structure
444
+
445
+ ```
446
+ DevOrch/
447
+ ├── cli/
448
+ │ ├── main.py # App wiring, REPL, sessions/config commands
449
+ │ ├── constants.py # VERSION, banners, slash-command registry, styles
450
+ │ └── commands/
451
+ │ ├── _shared.py # Shared helpers (agent builder, tool setup, etc.)
452
+ │ ├── ask.py # devorch ask
453
+ │ ├── run.py # devorch run
454
+ │ └── edit.py # devorch edit
455
+ ├── core/ # Agent, executor, memory, MCP, skills, modes
456
+ ├── config/ # Settings, permissions
457
+ ├── providers/ # AI provider implementations
458
+ ├── tools/ # Built-in tools (shell, edit, search, etc.)
459
+ ├── schemas/ # Pydantic models
460
+ ├── utils/ # Logging, display helpers
461
+ └── tests/ # Test suite
462
+ ```
463
+
464
+ ## Roadmap
465
+
466
+ - [ ] Streaming responses
467
+ - [ ] Multi-file context awareness
468
+ - [ ] Plugin marketplace
469
+ - [ ] VS Code extension
470
+ - [ ] Agent-to-agent delegation
471
+
472
+ ## Requirements
473
+
474
+ - Python 3.10+
475
+ - Works on Linux, macOS, and Windows
476
+
477
+ ## License
478
+
479
+ [MIT](LICENSE)
480
+
481
+ ---
482
+
483
+ <p align="center">
484
+ Built by <a href="https://github.com/Amanbig">Aman</a> — star the repo if you find it useful!
485
+ </p>