@chiro14/orion-agent-cli 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +694 -0
- package/bin/orion.js +30 -0
- package/bin/update_titles.js +30 -0
- package/package.json +20 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 JL Fuertes
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,694 @@
|
|
|
1
|
+
# Orion
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@chiro14/orion-agent-cli)
|
|
4
|
+
[](https://www.rust-lang.org/)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
Orion is a fast, terminal-native agentic coding assistant written in Rust. It can chat with multiple LLM providers, inspect and edit files, search code, run shell commands, read web pages, manage Git workflows, store sessions, load reusable skills, and run custom tools from your local filesystem.
|
|
8
|
+
|
|
9
|
+
This README is both a quick start and a practical user guide. Start with the first-run tutorial if you are new to Orion, then use the command reference sections as your day-to-day docs.
|
|
10
|
+
|
|
11
|
+
## Table Of Contents
|
|
12
|
+
|
|
13
|
+
- [What Orion Does](#what-orion-does)
|
|
14
|
+
- [Installation](#installation)
|
|
15
|
+
- [First Run Tutorial](#first-run-tutorial)
|
|
16
|
+
- [Configuration](#configuration)
|
|
17
|
+
- [Using The Interactive REPL](#using-the-interactive-repl)
|
|
18
|
+
- [Headless And Scripted Usage](#headless-and-scripted-usage)
|
|
19
|
+
- [Sessions](#sessions)
|
|
20
|
+
- [Skills](#skills)
|
|
21
|
+
- [Custom Tools](#custom-tools)
|
|
22
|
+
- [Web, Search, Vision, And Screenshots](#web-search-vision-and-screenshots)
|
|
23
|
+
- [Safety And Sandboxing](#safety-and-sandboxing)
|
|
24
|
+
- [Shell Completions](#shell-completions)
|
|
25
|
+
- [Release And Publishing](#release-and-publishing)
|
|
26
|
+
- [Troubleshooting](#troubleshooting)
|
|
27
|
+
- [Developer Notes](#developer-notes)
|
|
28
|
+
|
|
29
|
+
## What Orion Does
|
|
30
|
+
|
|
31
|
+
Orion is built around an agent loop:
|
|
32
|
+
|
|
33
|
+
1. You give Orion an instruction.
|
|
34
|
+
2. Orion talks to the configured model provider.
|
|
35
|
+
3. The model may request tools such as file reads, file writes, grep, Git commands, browser reads, web search, or terminal commands.
|
|
36
|
+
4. Orion executes approved tools, feeds results back to the model, and continues until the task is done or a safety limit is reached.
|
|
37
|
+
|
|
38
|
+
Core capabilities:
|
|
39
|
+
|
|
40
|
+
- Interactive REPL with slash commands, command picker, model picker, sessions, and Markdown-style terminal output.
|
|
41
|
+
- One-shot execution for automation and CI.
|
|
42
|
+
- Multi-provider LLM support for OpenRouter, OpenAI, Anthropic, Gemini, Mistral, Ollama, and Cloudflare Workers AI style endpoints.
|
|
43
|
+
- Built-in file, terminal, grep, Git, browser, web-search, YouTube, and multi-agent delegation tools.
|
|
44
|
+
- Optional custom tools loaded from `~/.orion/tools`.
|
|
45
|
+
- Skills loaded from `~/.orion/skills` and compatible `~/.agents/skills` directories.
|
|
46
|
+
- SQLite-backed session history under `~/.orion`.
|
|
47
|
+
- Context limits, tool-round limits, read approvals, budget settings, and optional Docker command sandboxing.
|
|
48
|
+
|
|
49
|
+
## Installation
|
|
50
|
+
|
|
51
|
+
### Install From NPM
|
|
52
|
+
|
|
53
|
+
The recommended end-user install is the NPM package. It installs a small JavaScript launcher plus the matching native binary package for your platform.
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm install -g @chiro14/orion-agent-cli
|
|
57
|
+
orion --help
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Supported NPM binary targets:
|
|
61
|
+
|
|
62
|
+
- macOS x64
|
|
63
|
+
- macOS arm64
|
|
64
|
+
- Linux x64 glibc
|
|
65
|
+
- Linux arm64 glibc
|
|
66
|
+
- Windows x64
|
|
67
|
+
|
|
68
|
+
### Build From Source
|
|
69
|
+
|
|
70
|
+
Use this path if you are developing Orion locally.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
git clone https://github.com/jlfuertes14/OrionBot.git
|
|
74
|
+
cd OrionBot
|
|
75
|
+
cargo build --release
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Run the local binary:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
./target/release/orion --help
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
On Windows:
|
|
85
|
+
|
|
86
|
+
```powershell
|
|
87
|
+
.\target\release\orion.exe --help
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Install With Cargo
|
|
91
|
+
|
|
92
|
+
If the crate is available in your configured Cargo registry:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
cargo install orion
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## First Run Tutorial
|
|
99
|
+
|
|
100
|
+
This walkthrough gets you from a fresh install to a useful coding session.
|
|
101
|
+
|
|
102
|
+
### 1. Choose A Provider
|
|
103
|
+
|
|
104
|
+
Orion defaults to OpenRouter with the model `anthropic/claude-3.5-sonnet`. You can use environment variables, a `.env` file in your current project, or `~/.orion/config.toml`.
|
|
105
|
+
|
|
106
|
+
OpenRouter example:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
export OPENROUTER_API_KEY="your-key"
|
|
110
|
+
export ORION_PROVIDER="openrouter"
|
|
111
|
+
export ORION_MODEL="anthropic/claude-3.5-sonnet"
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
PowerShell:
|
|
115
|
+
|
|
116
|
+
```powershell
|
|
117
|
+
$env:OPENROUTER_API_KEY = "your-key"
|
|
118
|
+
$env:ORION_PROVIDER = "openrouter"
|
|
119
|
+
$env:ORION_MODEL = "anthropic/claude-3.5-sonnet"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
OpenAI example:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
export OPENAI_API_KEY="your-key"
|
|
126
|
+
export ORION_PROVIDER="openai"
|
|
127
|
+
export ORION_MODEL="gpt-4o"
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Anthropic example:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
export ANTHROPIC_API_KEY="your-key"
|
|
134
|
+
export ORION_PROVIDER="anthropic"
|
|
135
|
+
export ORION_MODEL="claude-3-5-sonnet-latest"
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Local Ollama example:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
ollama serve
|
|
142
|
+
ollama pull llama3.1
|
|
143
|
+
export ORION_PROVIDER="ollama"
|
|
144
|
+
export ORION_MODEL="llama3.1"
|
|
145
|
+
export OLLAMA_HOST="http://localhost:11434"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### 2. Start Orion In Your Project
|
|
149
|
+
|
|
150
|
+
Run Orion from the repository or folder you want it to work in:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
cd path/to/your/project
|
|
154
|
+
orion
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
The current directory becomes the workspace. Orion automatically adds that workspace to `allowed_dirs` for file access.
|
|
158
|
+
|
|
159
|
+
### 3. Ask For A Small Read-Only Task
|
|
160
|
+
|
|
161
|
+
Try a safe first prompt:
|
|
162
|
+
|
|
163
|
+
```text
|
|
164
|
+
Summarize this repository. Mention the entry points, main modules, and likely test commands.
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Orion can inspect files, search the tree, and explain what it finds.
|
|
168
|
+
|
|
169
|
+
### 4. Ask For A Focused Edit
|
|
170
|
+
|
|
171
|
+
Example:
|
|
172
|
+
|
|
173
|
+
```text
|
|
174
|
+
Add input validation to the config loader and run the relevant tests.
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
For best results, be specific about:
|
|
178
|
+
|
|
179
|
+
- The file or behavior to change.
|
|
180
|
+
- The expected result.
|
|
181
|
+
- Whether Orion should run tests, formatters, or build commands.
|
|
182
|
+
- Whether it may commit changes.
|
|
183
|
+
|
|
184
|
+
### 5. Review Changes
|
|
185
|
+
|
|
186
|
+
You can ask Orion:
|
|
187
|
+
|
|
188
|
+
```text
|
|
189
|
+
Show me the files you changed and summarize the verification you ran.
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Or use Git yourself:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
git status --short
|
|
196
|
+
git diff
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Configuration
|
|
200
|
+
|
|
201
|
+
Orion reads configuration in this order:
|
|
202
|
+
|
|
203
|
+
1. `.env` in the current project, if present.
|
|
204
|
+
2. `~/.orion/config.toml`, if present.
|
|
205
|
+
3. Direct environment variables, which override TOML values.
|
|
206
|
+
|
|
207
|
+
Show active settings:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
orion config --show
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Important Environment Variables
|
|
214
|
+
|
|
215
|
+
Provider and model:
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
ORION_PROVIDER=openrouter
|
|
219
|
+
ORION_MODEL=anthropic/claude-3.5-sonnet
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Provider keys and endpoints:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
OPENROUTER_API_KEY=...
|
|
226
|
+
OPENAI_API_KEY=...
|
|
227
|
+
ANTHROPIC_API_KEY=...
|
|
228
|
+
GEMINI_API_KEY=...
|
|
229
|
+
MISTRAL_API_KEY=...
|
|
230
|
+
OLLAMA_HOST=http://localhost:11434
|
|
231
|
+
CLOUDFLARE_API_KEY=...
|
|
232
|
+
CLOUDFLARE_ACCOUNT_ID=...
|
|
233
|
+
WORKERS_AI_API_KEY=...
|
|
234
|
+
WORKERS_AI_ACCOUNT_ID=...
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Workspace access:
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
ALLOWED_DIRS=/path/to/project,/path/to/another/project
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Web search:
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
TAVILY_API_KEY=...
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
If `TAVILY_API_KEY` is not configured, Orion can fall back to DuckDuckGo Lite for basic search.
|
|
250
|
+
|
|
251
|
+
### Example `~/.orion/config.toml`
|
|
252
|
+
|
|
253
|
+
```toml
|
|
254
|
+
active_provider = "openrouter"
|
|
255
|
+
active_model = "anthropic/claude-3.5-sonnet"
|
|
256
|
+
allowed_dirs = ["/Users/me/code/my-project"]
|
|
257
|
+
fallbacks = ["anthropic:claude-3-5-sonnet-latest", "openai:gpt-4o"]
|
|
258
|
+
command_sandbox = "host"
|
|
259
|
+
docker_image = "ubuntu:latest"
|
|
260
|
+
search_provider = "duckduckgo"
|
|
261
|
+
|
|
262
|
+
[session]
|
|
263
|
+
max_tool_rounds = 25
|
|
264
|
+
auto_approve_reads = true
|
|
265
|
+
max_budget_usd = 5.00
|
|
266
|
+
|
|
267
|
+
[providers.openrouter]
|
|
268
|
+
api_key = "your-openrouter-key"
|
|
269
|
+
api_base = "https://openrouter.ai/api/v1"
|
|
270
|
+
|
|
271
|
+
[providers.openai]
|
|
272
|
+
api_key = "your-openai-key"
|
|
273
|
+
|
|
274
|
+
[providers.ollama]
|
|
275
|
+
api_base = "http://localhost:11434"
|
|
276
|
+
|
|
277
|
+
[context_limits]
|
|
278
|
+
max_file_bytes = 102400
|
|
279
|
+
max_total_bytes = 512000
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Only include keys you actually want stored on disk. For shared machines, prefer environment variables.
|
|
283
|
+
|
|
284
|
+
### Switching Models
|
|
285
|
+
|
|
286
|
+
Use a one-off model override:
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
orion --model openai:gpt-4o "Review this repository for risky code paths"
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
Inside the REPL:
|
|
293
|
+
|
|
294
|
+
```text
|
|
295
|
+
/model
|
|
296
|
+
/model anthropic:claude-3-5-sonnet-latest
|
|
297
|
+
/model openrouter:anthropic/claude-3.5-sonnet
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
The slash command can open the interactive provider/model picker, or accept `provider:model` directly.
|
|
301
|
+
|
|
302
|
+
## Using The Interactive REPL
|
|
303
|
+
|
|
304
|
+
Start it with:
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
orion
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
Useful REPL commands:
|
|
311
|
+
|
|
312
|
+
| Command | Purpose |
|
|
313
|
+
| --- | --- |
|
|
314
|
+
| `/help` | Show available slash commands. |
|
|
315
|
+
| `/model` | Pick or change the active provider/model. |
|
|
316
|
+
| `/skill list` | List installed skills. |
|
|
317
|
+
| `/skill load <name>` | Inject a skill into the current session. |
|
|
318
|
+
| `/skill add <owner/repo>` | Download a skill from a GitHub repository. |
|
|
319
|
+
| `/vision <file_path>` | Attach a local image to the next message. |
|
|
320
|
+
| `/screenshot` | Capture the primary screen on Windows and attach it to the next message. |
|
|
321
|
+
| `/session list` | List recent sessions. |
|
|
322
|
+
| `/session resume <id>` | Resume an existing session. |
|
|
323
|
+
| `/session delete <id>` | Delete a saved session. |
|
|
324
|
+
| `/web <url>` | Read a web page and add it to context. |
|
|
325
|
+
| `/search <query>` | Search the web and answer with loaded search context. |
|
|
326
|
+
| `/commit` | Generate a commit message from staged or unstaged diff. |
|
|
327
|
+
| `/pr` | Generate pull request text from the current branch diff. |
|
|
328
|
+
| `/stats` | Show current session stats. |
|
|
329
|
+
| `/clear` | Clear the terminal and redraw the Orion header. |
|
|
330
|
+
| `/exit` or `/quit` | Exit Orion. |
|
|
331
|
+
|
|
332
|
+
Tip: type `/` at an empty prompt to open the interactive command picker.
|
|
333
|
+
|
|
334
|
+
## Headless And Scripted Usage
|
|
335
|
+
|
|
336
|
+
Run a single prompt and exit:
|
|
337
|
+
|
|
338
|
+
```bash
|
|
339
|
+
orion execute "Audit src/main.rs and suggest the smallest safe improvement."
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
Read the prompt from standard input:
|
|
343
|
+
|
|
344
|
+
```bash
|
|
345
|
+
cat prompt.txt | orion execute --stdin
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
Use the positional prompt form:
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
orion "Explain the build and release process for this repository."
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
Resume a previous session from the command line:
|
|
355
|
+
|
|
356
|
+
```bash
|
|
357
|
+
orion --resume <session-id>
|
|
358
|
+
orion --resume <session-id> execute "Continue the refactor and run cargo check."
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
Enable diagnostic tracing:
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
orion --trace execute "Reproduce the failing test and explain the payload flow."
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
Tracing logs provider payloads under `.orion/traces/` in the workspace. Do not enable it when prompts may contain secrets unless you are comfortable storing those payloads locally.
|
|
368
|
+
|
|
369
|
+
## Sessions
|
|
370
|
+
|
|
371
|
+
Orion stores session metadata and messages in a SQLite database under `~/.orion`.
|
|
372
|
+
|
|
373
|
+
List sessions:
|
|
374
|
+
|
|
375
|
+
```bash
|
|
376
|
+
orion sessions list
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
Show a transcript:
|
|
380
|
+
|
|
381
|
+
```bash
|
|
382
|
+
orion sessions show <session-id>
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
Inside the REPL:
|
|
386
|
+
|
|
387
|
+
```text
|
|
388
|
+
/session list
|
|
389
|
+
/session resume <session-id>
|
|
390
|
+
/session delete <session-id>
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
Sessions preserve conversation history and provider/model metadata. They are useful for long-running work, but starting a fresh session is often better for unrelated tasks.
|
|
394
|
+
|
|
395
|
+
## Skills
|
|
396
|
+
|
|
397
|
+
Skills are reusable instruction packs. They do not add native code by themselves; they inject specialized guidance into the current agent session.
|
|
398
|
+
|
|
399
|
+
Orion loads skills from:
|
|
400
|
+
|
|
401
|
+
- `~/.orion/skills/*.toml`
|
|
402
|
+
- `~/.agents/skills/*/SKILL.md` when compatible frontmatter is present
|
|
403
|
+
|
|
404
|
+
List installed skills:
|
|
405
|
+
|
|
406
|
+
```bash
|
|
407
|
+
orion skill list
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
Add skills from GitHub:
|
|
411
|
+
|
|
412
|
+
```bash
|
|
413
|
+
orion skill add owner/repo
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
The downloader looks for:
|
|
417
|
+
|
|
418
|
+
- `SKILL.md` at the repository root
|
|
419
|
+
- `skills/<skill-name>/SKILL.md`
|
|
420
|
+
|
|
421
|
+
### Local TOML Skill Example
|
|
422
|
+
|
|
423
|
+
Create `~/.orion/skills/rust-reviewer.toml`:
|
|
424
|
+
|
|
425
|
+
```toml
|
|
426
|
+
[skill]
|
|
427
|
+
name = "rust-reviewer"
|
|
428
|
+
description = "Review Rust changes for correctness, safety, and maintainability"
|
|
429
|
+
version = "1.0"
|
|
430
|
+
|
|
431
|
+
[prompt]
|
|
432
|
+
inject = """
|
|
433
|
+
You are a senior Rust reviewer.
|
|
434
|
+
Prioritize correctness, ownership, error handling, async behavior, and tests.
|
|
435
|
+
When reviewing, list concrete findings first with file and line references.
|
|
436
|
+
"""
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
Load it inside Orion:
|
|
440
|
+
|
|
441
|
+
```text
|
|
442
|
+
/skill load rust-reviewer
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
## Custom Tools
|
|
446
|
+
|
|
447
|
+
Custom tools let you expose local scripts to the model. Put JSON tool definitions in:
|
|
448
|
+
|
|
449
|
+
```text
|
|
450
|
+
~/.orion/tools/
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
Each `.json` file describes one tool. Orion sends the tool arguments to the command over `stdin` as JSON and captures `stdout` as the tool result.
|
|
454
|
+
|
|
455
|
+
Example `~/.orion/tools/count_lines.json`:
|
|
456
|
+
|
|
457
|
+
```json
|
|
458
|
+
{
|
|
459
|
+
"name": "count_lines",
|
|
460
|
+
"description": "Count lines in a file relative to the current workspace.",
|
|
461
|
+
"requires_approval": true,
|
|
462
|
+
"command": "python scripts/count_lines.py",
|
|
463
|
+
"schema": {
|
|
464
|
+
"type": "object",
|
|
465
|
+
"properties": {
|
|
466
|
+
"path": {
|
|
467
|
+
"type": "string",
|
|
468
|
+
"description": "File path relative to the workspace."
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
"required": ["path"]
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
Example script:
|
|
477
|
+
|
|
478
|
+
```python
|
|
479
|
+
import json
|
|
480
|
+
import pathlib
|
|
481
|
+
import sys
|
|
482
|
+
|
|
483
|
+
args = json.load(sys.stdin)
|
|
484
|
+
path = pathlib.Path(args["path"])
|
|
485
|
+
print(len(path.read_text(encoding="utf-8").splitlines()))
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
Notes:
|
|
489
|
+
|
|
490
|
+
- Commands run from the active workspace directory.
|
|
491
|
+
- `requires_approval` defaults to `true`.
|
|
492
|
+
- Prefer small, deterministic tools with explicit schemas.
|
|
493
|
+
- Treat custom tools as trusted local code.
|
|
494
|
+
|
|
495
|
+
## Web, Search, Vision, And Screenshots
|
|
496
|
+
|
|
497
|
+
Read a page into context:
|
|
498
|
+
|
|
499
|
+
```text
|
|
500
|
+
/web https://docs.rs/tokio/latest/tokio/
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
Search the web:
|
|
504
|
+
|
|
505
|
+
```text
|
|
506
|
+
/search latest Rust 2024 edition migration notes
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
Attach an image to the next message:
|
|
510
|
+
|
|
511
|
+
```text
|
|
512
|
+
/vision ./design/mockup.png
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
Capture a screenshot on Windows:
|
|
516
|
+
|
|
517
|
+
```text
|
|
518
|
+
/screenshot
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
The screenshot command currently uses PowerShell and Windows Forms, so it is Windows-oriented. On other platforms, use `/vision` with a saved screenshot file.
|
|
522
|
+
|
|
523
|
+
## Safety And Sandboxing
|
|
524
|
+
|
|
525
|
+
Orion is powerful because it can execute tools. That also means you should run it with the same care you would use for a human pair programmer who can type commands in your terminal.
|
|
526
|
+
|
|
527
|
+
Safety controls:
|
|
528
|
+
|
|
529
|
+
- `allowed_dirs` limits filesystem access. The launch workspace is automatically allowed.
|
|
530
|
+
- `session.max_tool_rounds` limits how long an autonomous loop can continue.
|
|
531
|
+
- `session.auto_approve_reads` can allow read-only file access without repeated prompts.
|
|
532
|
+
- `session.max_budget_usd` can cap estimated model spend.
|
|
533
|
+
- `command_sandbox = "docker"` can run terminal commands in Docker instead of on the host.
|
|
534
|
+
- Some tools require explicit approval before they run.
|
|
535
|
+
|
|
536
|
+
Docker sandbox example:
|
|
537
|
+
|
|
538
|
+
```toml
|
|
539
|
+
command_sandbox = "docker"
|
|
540
|
+
docker_image = "ubuntu:latest"
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
Docker mode is useful for risky shell commands, but it has limitations. Background commands and host-specific tooling may not work the same way inside the container.
|
|
544
|
+
|
|
545
|
+
## Shell Completions
|
|
546
|
+
|
|
547
|
+
Generate completions:
|
|
548
|
+
|
|
549
|
+
```bash
|
|
550
|
+
orion completions bash
|
|
551
|
+
orion completions zsh
|
|
552
|
+
orion completions powershell
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
Example for PowerShell:
|
|
556
|
+
|
|
557
|
+
```powershell
|
|
558
|
+
orion completions powershell > orion.ps1
|
|
559
|
+
. .\orion.ps1
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
## Release And Publishing
|
|
563
|
+
|
|
564
|
+
The repository includes a GitHub Actions workflow at `.github/workflows/publish.yml`.
|
|
565
|
+
|
|
566
|
+
Current release flow:
|
|
567
|
+
|
|
568
|
+
1. Push a tag matching `v*`, for example `v0.1.0`.
|
|
569
|
+
2. GitHub Actions builds native binaries for Windows, Linux, and macOS targets.
|
|
570
|
+
3. The workflow downloads the artifacts into the expected target layout.
|
|
571
|
+
4. `cargo npm generate` creates NPM package folders.
|
|
572
|
+
5. `cargo npm publish` publishes the main NPM package and platform packages.
|
|
573
|
+
|
|
574
|
+
One-time setup:
|
|
575
|
+
|
|
576
|
+
1. Create an NPM automation token.
|
|
577
|
+
2. Add it to the GitHub repository as `NPM_TOKEN`.
|
|
578
|
+
|
|
579
|
+
Release example:
|
|
580
|
+
|
|
581
|
+
```bash
|
|
582
|
+
git status --short
|
|
583
|
+
git add .
|
|
584
|
+
git commit -m "feat: release v0.1.0"
|
|
585
|
+
git push origin main
|
|
586
|
+
git tag v0.1.0
|
|
587
|
+
git push origin v0.1.0
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
Note: the workflow name mentions crates.io, but the current workflow only publishes NPM packages. Add a `cargo publish` job and `CARGO_REGISTRY_TOKEN` if crates.io publishing is needed.
|
|
591
|
+
|
|
592
|
+
## Troubleshooting
|
|
593
|
+
|
|
594
|
+
### `Unsupported platform`
|
|
595
|
+
|
|
596
|
+
The NPM launcher selects a native package from `process.platform` and `process.arch`. If you see this error, your OS/CPU pair is not one of the published targets. Build from source with Cargo.
|
|
597
|
+
|
|
598
|
+
### No provider key found
|
|
599
|
+
|
|
600
|
+
Set the matching environment variable or add the provider to `~/.orion/config.toml`.
|
|
601
|
+
|
|
602
|
+
```bash
|
|
603
|
+
export OPENROUTER_API_KEY="..."
|
|
604
|
+
export ORION_PROVIDER="openrouter"
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
Then verify:
|
|
608
|
+
|
|
609
|
+
```bash
|
|
610
|
+
orion config --show
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
### Ollama does not respond
|
|
614
|
+
|
|
615
|
+
Check that Ollama is running and the model exists:
|
|
616
|
+
|
|
617
|
+
```bash
|
|
618
|
+
ollama serve
|
|
619
|
+
ollama list
|
|
620
|
+
```
|
|
621
|
+
|
|
622
|
+
Set:
|
|
623
|
+
|
|
624
|
+
```bash
|
|
625
|
+
export ORION_PROVIDER="ollama"
|
|
626
|
+
export ORION_MODEL="llama3.1"
|
|
627
|
+
export OLLAMA_HOST="http://localhost:11434"
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
### Web search is weak or unavailable
|
|
631
|
+
|
|
632
|
+
Set `TAVILY_API_KEY` for richer search results. Without it, Orion can use DuckDuckGo Lite, which is free but less structured and may be rate-limited.
|
|
633
|
+
|
|
634
|
+
### The agent is taking too many actions
|
|
635
|
+
|
|
636
|
+
Lower the tool-round limit:
|
|
637
|
+
|
|
638
|
+
```toml
|
|
639
|
+
[session]
|
|
640
|
+
max_tool_rounds = 10
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
Or ask for a plan first:
|
|
644
|
+
|
|
645
|
+
```text
|
|
646
|
+
Inspect the issue and propose a plan. Do not edit files yet.
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
### The model changed files I did not expect
|
|
650
|
+
|
|
651
|
+
Use Git to inspect and restore selectively:
|
|
652
|
+
|
|
653
|
+
```bash
|
|
654
|
+
git status --short
|
|
655
|
+
git diff
|
|
656
|
+
git restore path/to/file
|
|
657
|
+
```
|
|
658
|
+
|
|
659
|
+
Do not run broad destructive commands unless you are sure you want to discard work.
|
|
660
|
+
|
|
661
|
+
## Developer Notes
|
|
662
|
+
|
|
663
|
+
Common local commands:
|
|
664
|
+
|
|
665
|
+
```bash
|
|
666
|
+
cargo fmt
|
|
667
|
+
cargo check
|
|
668
|
+
cargo test
|
|
669
|
+
cargo build --release
|
|
670
|
+
```
|
|
671
|
+
|
|
672
|
+
Project structure:
|
|
673
|
+
|
|
674
|
+
- `src/main.rs` - CLI entry point and subcommands.
|
|
675
|
+
- `src/cli/` - interactive REPL, command picker, theme, and Markdown rendering.
|
|
676
|
+
- `src/agent/` - orchestration loop and middleware.
|
|
677
|
+
- `src/llm/` - provider implementations.
|
|
678
|
+
- `src/tools/` - filesystem, terminal, grep, Git, browser, and custom tools.
|
|
679
|
+
- `src/session/` - SQLite-backed session storage and context helpers.
|
|
680
|
+
- `src/skills/` - skill loading and GitHub skill downloader.
|
|
681
|
+
- `src/mcp/` - MCP configuration surface.
|
|
682
|
+
- `npm/` - generated NPM package output, ignored by Git.
|
|
683
|
+
|
|
684
|
+
Before committing:
|
|
685
|
+
|
|
686
|
+
```bash
|
|
687
|
+
cargo fmt
|
|
688
|
+
cargo check
|
|
689
|
+
git status --short
|
|
690
|
+
```
|
|
691
|
+
|
|
692
|
+
## License
|
|
693
|
+
|
|
694
|
+
Orion is released under the [MIT License](LICENSE).
|
package/bin/orion.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict'
|
|
3
|
+
|
|
4
|
+
const PLATFORMS = {
|
|
5
|
+
darwin: {
|
|
6
|
+
arm64: '@chiro14/orion-agent-cli-darwin-arm64/orion',
|
|
7
|
+
x64: '@chiro14/orion-agent-cli-darwin-x64/orion',
|
|
8
|
+
},
|
|
9
|
+
linux: {
|
|
10
|
+
arm64: '@chiro14/orion-agent-cli-linux-arm64/orion',
|
|
11
|
+
x64: '@chiro14/orion-agent-cli-linux-x64/orion',
|
|
12
|
+
},
|
|
13
|
+
win32: {
|
|
14
|
+
x64: '@chiro14/orion-agent-cli-win32-x64/orion.exe',
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const binPath = PLATFORMS[process.platform]?.[process.arch]
|
|
19
|
+
|
|
20
|
+
if (!binPath) {
|
|
21
|
+
console.error(`Unsupported platform: ${process.platform} ${process.arch}`)
|
|
22
|
+
process.exit(1)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const bin = require.resolve(binPath)
|
|
26
|
+
const result = require('child_process').spawnSync(bin, process.argv.slice(2), { stdio: 'inherit' })
|
|
27
|
+
if (result.error) {
|
|
28
|
+
throw result.error
|
|
29
|
+
}
|
|
30
|
+
process.exitCode = result.status ?? 1
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict'
|
|
3
|
+
|
|
4
|
+
const PLATFORMS = {
|
|
5
|
+
darwin: {
|
|
6
|
+
arm64: '@chiro14/orion-agent-cli-darwin-arm64/update_titles',
|
|
7
|
+
x64: '@chiro14/orion-agent-cli-darwin-x64/update_titles',
|
|
8
|
+
},
|
|
9
|
+
linux: {
|
|
10
|
+
arm64: '@chiro14/orion-agent-cli-linux-arm64/update_titles',
|
|
11
|
+
x64: '@chiro14/orion-agent-cli-linux-x64/update_titles',
|
|
12
|
+
},
|
|
13
|
+
win32: {
|
|
14
|
+
x64: '@chiro14/orion-agent-cli-win32-x64/update_titles.exe',
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const binPath = PLATFORMS[process.platform]?.[process.arch]
|
|
19
|
+
|
|
20
|
+
if (!binPath) {
|
|
21
|
+
console.error(`Unsupported platform: ${process.platform} ${process.arch}`)
|
|
22
|
+
process.exit(1)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const bin = require.resolve(binPath)
|
|
26
|
+
const result = require('child_process').spawnSync(bin, process.argv.slice(2), { stdio: 'inherit' })
|
|
27
|
+
if (result.error) {
|
|
28
|
+
throw result.error
|
|
29
|
+
}
|
|
30
|
+
process.exitCode = result.status ?? 1
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@chiro14/orion-agent-cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "OrionBot CLI - High-performance agentic coding assistant in Rust",
|
|
5
|
+
"author": "JL <jl@orion.bot>",
|
|
6
|
+
"bin": {
|
|
7
|
+
"orion": "bin/orion.js",
|
|
8
|
+
"update_titles": "bin/update_titles.js"
|
|
9
|
+
},
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=14"
|
|
12
|
+
},
|
|
13
|
+
"optionalDependencies": {
|
|
14
|
+
"@chiro14/orion-agent-cli-darwin-arm64": "0.1.0",
|
|
15
|
+
"@chiro14/orion-agent-cli-darwin-x64": "0.1.0",
|
|
16
|
+
"@chiro14/orion-agent-cli-linux-arm64": "0.1.0",
|
|
17
|
+
"@chiro14/orion-agent-cli-linux-x64": "0.1.0",
|
|
18
|
+
"@chiro14/orion-agent-cli-win32-x64": "0.1.0"
|
|
19
|
+
}
|
|
20
|
+
}
|