Skip to content

Commit 2dcaa0f

Browse files
committed
refactor: optimize sorting performance with sort_unstable_by_key and update CLI init to support interactive multi-agent configuration
1 parent 1c5ec29 commit 2dcaa0f

17 files changed

Lines changed: 271 additions & 63 deletions

File tree

README.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ Omni is incredibly easy to set up. It natively integrates into your terminal.
111111
# 1. Install via Homebrew
112112
brew install fajarhide/tap/omni
113113

114-
# 2. Setup Omni (Hooks + MCP Server)
115-
omni init --all
114+
# 2. Setup Omni (Interactive Menu for Claude, VS Code, OpenCode, Codex, Antigravity)
115+
omni init
116116

117117
# 3. Verify it's working
118118
omni doctor
@@ -138,7 +138,7 @@ irm omni.weekndlabs.com/install.ps1 | iex
138138

139139
## How to Use It
140140

141-
Once installed via `omni init --all`, OMNI works invisibly in the background. Whether your AI Agent runs a terminal command via MCP or you manually pipe output (`ls | omni`), OMNI automatically jumps in as a transparent layer. It intelligently filters terminal output, removes the noisy logs, and hands the clean signal back to the AI.
141+
Once installed via `omni init`, OMNI works invisibly in the background. Whether your AI Agent runs a terminal command via MCP or you manually pipe output (`ls | omni`), OMNI automatically jumps in as a transparent layer. It intelligently filters terminal output, removes the noisy logs, and hands the clean signal back to the AI.
142142

143143
To review how many tokens (and how much money) you've saved today, just type:
144144
```bash
@@ -148,6 +148,29 @@ omni stats
148148
Need to see the filters in action or add your own custom rules?
149149
You can easily create your own rules using simple TOML files.
150150

151+
### Multi-Agent Support & Integrations
152+
153+
By default, `omni init --claude` automatically hooks into **Claude Code**. However, OMNI works perfectly with any agentic AI through its built-in integrations! Run `omni init` to see the interactive menu.
154+
155+
1. **VS Code & Continue.dev**: Use our MCP context provider (`integrations/continue-dev/`).
156+
2. **OpenCode & Codex CLI**: Built-in wrappers automatically pipe command output to OMNI.
157+
3. **Generic Webhook (Antigravity IDE etc)**: Run `omni serve --port=7891` to launch an ultra-lightweight local HTTP server for agents to drop payloads into OMNI.
158+
159+
**Multi-Agent Tuning (`~/.omni/config.toml`)**
160+
Different agents have different pain points. Keep VS Code chat clean, whilst letting OpenCode read more data. Tune them individually:
161+
```toml
162+
[global]
163+
aggressiveness = "balanced"
164+
165+
[agents.vscode_continue]
166+
aggressiveness = "aggressive"
167+
enable_readfile_distillation = true
168+
169+
[agents.opencode]
170+
aggressiveness = "conservative"
171+
enable_readfile_distillation = false
172+
```
173+
151174
### Documentation Index
152175

153176
**For Users:**

docs/HOW_TO_USE.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Nothing to type. Nothing to configure per-session. Just use Claude Code normally
5555

5656
```mermaid
5757
flowchart TD
58-
Install([Install OMNI]) --> Init["omni init --all"]
58+
Install([Install OMNI]) --> Init["omni init (Interactive)"]
5959
Init --> Doctor["omni doctor"]
6060
Doctor --> OK{All checks pass?}
6161
OK -- No --> Fix["omni doctor --fix"]
@@ -116,10 +116,10 @@ cp target/release/omni ~/.local/bin/
116116
This is the most important step. Without this, OMNI cannot intercept Claude Code's terminal output.
117117

118118
```bash
119-
omni init --all
119+
omni init
120120
```
121121

122-
**What `--all` does:**
122+
**What `omni init` does:**
123123
- Installs the `PostToolUse` hook — intercepts every command output after it runs
124124
- Installs the `SessionStart` hook — injects your working context at session start
125125
- Installs the `PreCompact` hook — preserves context during Claude's memory compaction
@@ -897,11 +897,17 @@ cargo test 2>&1 | omni # standard distillation
897897
Setup OMNI hooks in Claude Code.
898898

899899
```bash
900-
omni init --all # Recommended: Full Setup (Hooks + MCP)
901-
omni init --hook # Setup Hooks only
902-
omni init --mcp # Setup MCP Server only
903-
omni init --status # Check installation status
904-
omni init --uninstall # Remove all OMNI components
900+
omni init # Interactive Menu for any AI Agent
901+
902+
# Or bypass the menu for a specific agent
903+
omni init --claude # Full Setup for Claude Code (Hooks + MCP)
904+
omni init --vscode # Setup for VS Code Continue.dev
905+
omni init --opencode # Setup for OpenCode plugin
906+
omni init --codex # Setup for Codex CLI
907+
omni init --hook # Setup Claude Hooks only
908+
omni init --mcp # Setup Claude MCP Server only
909+
omni init --status # Check Claude installation status
910+
omni init --uninstall # Remove all OMNI components from Claude
905911
```
906912

907913
**What it does:**
@@ -1085,7 +1091,7 @@ Hooks **always** exit 0 — they never crash the host agent.
10851091

10861092
| Issue | Likely Cause | Fix |
10871093
|---|---|---|
1088-
| OMNI not filtering anything | Hooks not installed | Run `omni init --all` |
1094+
| OMNI not filtering anything | Not installed | Run `omni init` and select your agent |
10891095
| `omni stats` shows no data | First session not complete | Use Claude Code for a bit, then check |
10901096
| Filter not matching a command | `match_command` regex wrong | Test regex at regex101.com, then `omni learn --verify` |
10911097
| Session not persisting | DB not writable | Run `omni doctor`, check `~/.omni/` permissions |
@@ -1108,7 +1114,7 @@ omni doctor --fix # Self-repair
11081114

11091115
### First-Time Setup
11101116
- [ ] Install OMNI (`brew install fajarhide/tap/omni` or script)
1111-
- [ ] Run `omni init --all`
1117+
- [ ] Run `omni init` for your chosen agent
11121118
- [ ] Run `omni doctor` — all checks should be green
11131119
- [ ] If any checks fail, run `omni doctor --fix`
11141120
- [ ] Use Claude Code normally for one session

docs/MIGRATION.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,7 @@ OMNI 0.5.0 is a **full rewrite in Rust** — replacing the previous Node.js + Zi
2525

2626
### ⚠️ Hooks Must Be Reinstalled
2727

28-
The hook format has changed. Run:
29-
30-
```bash
31-
omni init --hook
32-
```
33-
34-
This will update `~/.claude/settings.json` with the new hook entries.
28+
The hook format has changed. Make sure to run `omni init` after upgrading to update the `PostToolUse` and `SessionStart` hooks in your Claude settings.
3529
If you had custom hooks, they will be backed up to `settings.json.bak`.
3630

3731
### ⚠️ `omni monitor``omni stats`
@@ -63,7 +57,7 @@ The MCP server is now built-in. Update your Claude config:
6357
}
6458
```
6559

66-
Or run `omni init --hook` which handles this automatically.
60+
Or run `omni init --claude` which handles this automatically.
6761

6862
## What's Compatible (No Action Needed)
6963

@@ -83,7 +77,7 @@ Or run `omni init --hook` which handles this automatically.
8377
```bash
8478
brew update
8579
brew upgrade omni
86-
omni init --hook # Reinstall hooks
80+
omni init # Select Claude Code, or run: omni init --claude
8781
omni doctor # Verify everything
8882
```
8983

@@ -102,7 +96,7 @@ omni doctor
10296
curl -LO https://github.com/fajarhide/omni/releases/download/v0.5.0/omni-v0.5.0-aarch64-apple-darwin.tar.gz
10397
tar xzf omni-v0.5.0-aarch64-apple-darwin.tar.gz
10498
mv omni ~/.local/bin/
105-
omni init --hook
99+
omni init # Reinitialize hooks via interactive menu
106100
omni doctor
107101
```
108102

@@ -124,7 +118,7 @@ The `~/.omni/` directory and `omni.db` are safe to keep — they're compatible w
124118
| `omni doctor` | Diagnose installation (hooks, DB, filters) |
125119
| `omni stats` | Token savings analytics dashboard |
126120
| `omni learn` | Auto-generate TOML filters from passthrough output |
127-
| `omni init --hook` | Setup/update Claude Code hooks |
121+
| `omni init` | Interactive agent setup menu |
128122
| `omni --mcp` | Built-in MCP server mode |
129123

130124
## Troubleshooting

integrations/opencode/package-lock.json

Lines changed: 44 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

omni.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def install
3333
def caveats
3434
<<~EOS
3535
Quick start:
36-
omni init --all # Initialize OMNI setup
36+
omni init # Initialize OMNI setup (interactive)
3737
omni doctor # Verify installation
3838
omni stats # View token savings
3939

0 commit comments

Comments
 (0)