agyrs
Health Uyari
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Low visibility — Only 5 GitHub stars
Code Uyari
- fs module — File system access in .github/workflows/ci.yml
Permissions Gecti
- Permissions — No dangerous permissions requested
Bu listing icin henuz AI raporu yok.
High-performance Rust dual-engine (MCP + CLI) AI coding workbench: cross-platform code accelerator + native Windows shell & diagnostics
agyrs
Native Rust Dual-Engine (MCP Server + CLI) Workbench for AI Coding Agents
English · 简体中文 · Quick Start · Benchmarks · Architecture · Tool Reference · FAQ · Changelog
agyrs is a single-binary, native Rust dual-engine (MCP + CLI) workbench for AI coding agents (Google Antigravity and any standard MCP client), with zero external rg, LSP, Node.js, or script runtime dependencies. Originating as a ground-up Rust rewrite of INK-Q/agy-fast (Node.js, MIT License), it unifies persistent in-memory code intelligence with a native Windows multi-shell & diagnostics engine in one Cargo workspace.
| Warm Full-Text Search (p50) | 36-File Diff Impact Shrink | Fault-Injection Safety Net | MCP Cold Start & Footprint |
|---|---|---|---|
1.6 ms172× faster than native pwsh+rg · 31.6× faster than agy-fast |
-96.6%160 KB → 5.4 KB (30× smaller) with cross-file callers |
100%Pre-commit Tree-sitter syntax gate + auto rollback on verify fail |
9.7 ms13.2 KB eager prompt footprint · ≤9.8 KB hard inline cap |
Quick Start
Option 1: Prebuilt Binary (Recommended on Windows — No Rust Required)
Download the latest Windows x86_64 plugin ZIP from GitHub Releases (bundles agyrs.exe, plugin/, skills/, and sync scripts), extract it, and run:
pwsh -File scripts/sync-plugin.ps1
The installer verifies versions, performs a lock-safe hot-swap of agyrs.exe, renders mcp_config.json / hooks.json, and syncs rules & skills into ~/.gemini/config/plugins/agyrs/.
Option 2: Build from Source (Windows / macOS / Linux)
Requires Rust 1.96+ (Edition 2024) and a C compiler (for bundled Tree-sitter grammars):
git clone https://github.com/sbtxdy/agyrs.git
cd agyrs
# Windows (unified dual-engine agyrs.exe; pass -SkipShell for code-only profile)
pwsh -File scripts/sync-plugin.ps1
# macOS / Linux (portable code engine agyrs-code)
bash scripts/install-plugin.sh
More setup & verification options (generic MCP clients, SessionStart hook, install integrity check)[!TIP]
Activating in Antigravity: Open Customizations → Installed, confirmagyrsis enabled, and start a new session to activate theSessionStartsnapshot hook and MCP tools.
Minimal Generic MCP Configuration (Windows Unified Binary)
Full templates and default budget env vars live in plugin/mcp_config.template.json (Unix: plugin/mcp_config.unix.template.json):
{
"mcpServers": {
"agyrs": {
"command": "C:/path/to/agyrs.exe",
"args": ["mcp", "--ipc"],
"tools": {
"batch_search": { "eager": true },
"apply_edits": { "eager": true },
"exec": { "eager": true }
}
}
}
}
- Optional
SessionStarthook template:plugin/hooks.template.json - All installer flags (
-SkipShell,-SkipChecks,-ShellBashPath,-Verify):plugin/README.md - Standalone installed-bundle & source-drift verification:
node scripts/verify-install.mjs --check-source
Benchmarks
Measured serially on this real repository (11 Rust crates / 386 source files) plus an isolated 3-file Rust fault sandbox (3–5 serial runs, p50 median), comparing Antigravity Native Tools, agy-fast v0.3.4 (persistent Node.js MCP), and agyrs v2.0.0 (persistent Rust MCP):
| Benchmark Scenario | Native Tools | agy-fast v0.3.4 (Node) |
agyrs v2.0.0 (Rust) |
|---|---|---|---|
| MCP Cold Start + Handshake | No daemon (pwsh ~276 ms/call) |
42.0 ms |
9.7 ms (4.3× faster) |
| Eager Prompt Footprint | 0 KB |
11.8 KB (5 eager 5.2 KB + rules 6.6 KB) |
13.2 KB (3 eager + 9 lazy; only +1.4 KB) |
Single Text Search (crates/) |
pwsh+rg 275.8 ms / 34.5 KB |
Cold 82.9 ms / Warm 50.5 ms / 3.2 KB |
Cold 29.1 ms / Warm 1.6 ms (AST filter 2.7 ms) |
| 4-Way Batch Search (text+regex+glob+git) | 4×pwsh 1,291.8 ms / 35.8 KB |
71.7 ms / 4.4 KB (no AST) |
42.8 ms / ~4.6–6.6 KB (with AST filter) |
1,643-Line File Outline (protocol.rs) |
read_file 3 turns / 57.3 KB |
Warm 4.9 ms (regex names, no sigs) |
Warm 0.7–0.8 ms (full Tree-sitter sigs) |
36-File Commit Impact (4cdd2ce) |
git diff 301 ms / 160 KB |
Not available | 115.7 ms / ~5.4 KB (30× smaller + callers) |
| Dependency Graph & Cycles (386 files) | Not available | Not available | Cold 152.9 ms / Warm 2.7 ms (12 cycles) |
| Fault Injection: Syntax & Compile Fail | No gate / no rollback (dirty disk) | Written to disk / no rollback (isError: false) |
syntaxCheck: strict pre-commit block + auto rollback |
51-Test Output Compaction (cargo test) |
Raw 5.0 KB (66 lines) |
258 B (grabbed doc-tests 0 passed) |
425 B (accurate 51 passed + log_read paging) |
| Short Command & 4-Way Parallel Gate | pwsh 276 ms / 4× 1,581 ms |
run_checks 48.5 ms / 474.5 ms |
exec(bash) 49.1 ms / exec_batch(bash) 504.7 ms |
| Background Jobs, Multi-Shell & Diagnostics | pwsh only, no lock tool |
Short sync run_checks only |
Bash/Pwsh/Py/WSL + job_* + 4 CLI diags + redaction |
Fair Trade-Offs:
agy-fastshines for zero-compile pure-Node deployment, an ultra-slim5.2 KBschema, built-infuzzy/read_slices, and ~30 ms less overhead on bare synchronousrun_checks. For just+1.4 KBof eager footprint,agyrsdelivers in-memory search/outline speeds (6×–31× faster), real Tree-sitter accuracy, atomic fault rollback, architecture-level analysis, and full Windows shell & diagnostics governance.
Dual-Engine Hybrid Architecture
agyrs follows a hybrid routing model: it keeps fast built-in single-file reads (read_file) and one-hunk tweaks (edit_file) untouched, while routing batched search, large-file/directory understanding, multi-file atomic transactions, and terminal governance through one persistent Rust binary:
- Persistent RAM Workspace Engine: OS file watcher (
notify) + sharded trigram index + LRU content & AST caches with synchronous write-through invalidation on edits and rollbacks. - Zero-LSP Code Intelligence: Bundled Tree-sitter grammars + lightweight scanners for 32-language symbol outlines, API signature skeletons, comment/string AST filtering,
diff_impactcaller blast radius, anddep_graphTarjan cycle detection. - Atomic Multi-File Transactions: Two-phase CAS edits, cross-process write locks, pre-commit net-new Tree-sitter syntax gating, reverse rollback, lossless UTF-16 BOM / CRLF preservation, workspace
cwdwrite confinement (AGYRS_ALLOW_OUTSIDE_CWD=1opt-out), and inlineverifywith optional rollback. - Native Windows Process & Handle Isolation: Clean cold-spawn execution across 4 runtimes (zero idle warm-pool processes),
PROC_THREAD_ATTRIBUTE_HANDLE_LISThandle allowlisting, per-command + server-level Windows Job Objects, automatic audit redaction, and sub-millisecond Win32 port/file-lock diagnostics.
Tool Reference
Exact parameters, limits, and schemas are introspectable via agyrs schema [TOOL] --pretty and specified under specs/.
Code Engine (mcpServers.agyrs on Windows / mcpServers.code on Unix)
| Tool (MCP / CLI) | Capability | Key Features |
|---|---|---|
batch_search / agyrs search |
Parallel text, regex, glob & read-only Git search | In-process ripgrep, RAM trigram pruning (MCP) / fused scans (CLI), AST enclosing (def/ref + comment/string exclusion), directory globs, auto UTF-8/GB18030 fallback |
quick_outline / agyrs outline |
Symbol outlines, API skeletons & body extraction | Tree-sitter + lightweight formats, directory names maps, filter & exact symbols[], --signatures, --body, line-range paging |
apply_edits / agyrs apply |
Atomic multi-file edits, renames, creates & deletes | Flat single-hunk shorthand or hunks[], whole-line endTarget & insert, regex $1/\1, syntaxCheck, verify + rollbackOnVerifyFail, post-edit [api-impact] hint |
diff_impact / agyrs diff-impact |
AST Git diff summary & caller blast radius | Pure-Rust gix-odb reads (git cat-file --batch fallback), ref/a..b/a...b/main...WORKTREE, untracked code files & constructor callers |
dep_graph / agyrs dep-graph |
Static module dependency graph & cycle detection | Incremental graph cache, JS/TS workspaces + tsconfig.json references/extends, Rust/Py/Go/C/C++/Vue/Svelte, focus-scoped Tarjan SCC |
agyrs verify |
Noise-compacted build/test runner | Controlled CI=1 NO_COLOR=1 capture, verbatim short passes, Cargo multi-target aggregation, root-cause & first-error source context extraction |
session-start / agyrs snapshot |
Fast workspace briefing (SessionStart hook) |
gix-odb recent commits + concurrent git status (Modified/Untracked) + manifests & top-level tree + rule-cap warning |
Windows Shell & Diagnostics Engine (mcpServers.agyrs)
| Tool (MCP / CLI) | Capability | Key Features |
|---|---|---|
exec / agyrs exec |
Foreground command execution | bash, pwsh, python, wsl; UTF-8/GB18030/UTF-16LE streaming decode; options.verify_compact compaction; lossless foreground-to-background handoff |
exec_batch |
Parallel or sequential command gates | Concurrent runs or sequential gates (concurrency: 1, fail_fast, omit_passing_output, options.verify_compact) |
log_read |
Snapshot, byte paging & RE2 regex filtering | Spill-backed logs, dynamic compact screen fit, read_hint line-start jumps, bounded cross-page ANSI/GB18030 recovery |
job_start / job_wait / job_list / job_kill |
Managed background jobs | ready.text / ready.port (kernel TCP ownership check), abort_on_text / abort_on_error, graceful CTRL_BREAK_EVENT & process-tree cleanup |
doctor / wsl_doctor / port_listeners / file_locks |
Read-only Windows & WSL 2 diagnostics | Native CLI subcommands by default (doctor, wsl-doctor, port-listeners, file-locks, audit, schema), opt-in on MCP via --tools |
Dual-Shell CLI Quickstart
# Code Engine CLI
agyrs snapshot .
agyrs outline crates/agyrs-mcp/src/cli/mod.rs --exported --signatures
agyrs search -w --role def --code-only "resolve_tool_cwd" -p crates
agyrs apply --json-file patch.json --dry-run --show-diff --syntax-check strict
agyrs diff-impact --base main...WORKTREE
agyrs dep-graph crates/agyrs-core/src/lib.rs --direction both
agyrs verify --timeout 120 cargo test --workspace
agyrs schema batch_search --pretty
# Windows Shell & Diagnostics CLI
agyrs doctor --json
agyrs port-listeners 8080 --check-excluded --json
agyrs file-locks "D:\path\to\file.lock" --json
printf '%s' '{"command":"echo ok"}' | agyrs exec --stdin-json
FAQ
Why prefershell: "bash" over pwsh for short commands and exec_batch on Windows?
Every cold pwsh.exe process incurs ~`260–350 msof .NET CLR startup overhead. In benchmarks,exec(bash)runsgit status in **49.1 ms** (5.6× faster than pwsh), and 4-way exec_batch(bash) finishes in **504.7 ms** vs 934 ms+for parallelpwsh. Use bash` by default unless the command requires PowerShell syntax.
No. Only the 3 highest-frequency tools (batch_search, apply_edits, exec) load eagerly (9.6 KB), while the other 9 stay lazy-loaded. Combined with the concise routing rules (3.6 KB), the fixed prompt footprint is 13.2 KB, and every tool enforces a strict ≤9.8 KB inline output cap.
agyrs replace built-in read_file or edit_file?
No. The bundled routing rules keep single-file reads (≤800 lines), known line ranges, single-block tweaks, and trivial one-off git reads on built-in tools, while routing multi-query search, large-file outlines, multi-file atomic refactors, architecture analysis, noisy builds, and background jobs to agyrs.
agyrs.exe while an MCP session is running?
Re-run pwsh -File scripts/sync-plugin.ps1 (add -Verify for full manifest/binary reconciliation). The script performs a lock-safe rename hot-swap without killing live host processes and preserves customized rules and configs.
Full architecture rules, crate navigation, and module specifications live in AGENTS.md, docs/maintenance.md, and specs/:
- Portable code engine (
unsafe_code = "forbid"):crates/agyrs-{core,verify,search,outline,edits,snapshot,analyze,mcp}(portable binaryagyrs-codeon Unix/macOS). - Windows host & Win32 isolation:
crates/agyrs-appbuildsagyrs.execombining the code engine withcrates/agyrs-shell; all Win32 FFI is quarantined incrates/agyrs-win32/src/win32/. - Plugin & black-box suites:
plugin/,skills/,scripts/,specs/, andtests/.
# Quick full-gate check (Windows: pwsh -File scripts/check.ps1 l3 -WithE2e / Unix: bash scripts/check.sh l3 --e2e)
node scripts/check-hygiene.mjs
cargo clippy --workspace --all-targets -- -D warnings
cargo test -p agyrs-shell --test architecture --test contract_snapshot
cargo test --workspace
cargo build --release
node tests/run-blackbox-stress.mjs
# Windows:
node --test tests/unified-blackbox.mjs
AGYRS_SHELL_BIN="./target/release/agyrs.exe" node --test tests/shell-blackbox/run.mjs
See SECURITY.md for trust boundaries & audit redaction, and CONTRIBUTING.md for contribution gates.
Attribution & License
Originated from a Rust rewrite and evolution of INK-Q/agy-fast (MIT License). Thanks to INK-Q for pioneering the Antigravity MCP acceleration workflow, batched tool design, strict context budgets, and visual identity.
Licensed under the MIT License.
Yorumlar (0)
Yorum birakmak icin giris yap.
Yorum birakSonuc bulunamadi