Local-first command wrapper for AI coding agents with compressed terminal output and privacy-safe proof metrics.
Project description
SAGE CLI
Local-first terminal wrapper for AI coding agents.
SAGE CLI wraps commands, compresses noisy output, keeps raw logs local, and tracks privacy-safe context savings.
Package name: psycgod-sage
CLI command: sage
Install
pip install psycgod-sage
sage --version
Quick Start
sage run -- python -m pytest
sage context report
By default, SAGE CLI runs locally. Raw logs stay on your machine. GitHub login is optional and only needed for public proof/dashboard sync.
15-Second Demo
$ sage run -- python -m pytest
[sage] saved run #42 exit=0 time=1180ms
[sage] context: saved 8,214 tokens (91.2% compression)
[sage] summary:
144 passed
$ sage context report
SAGE context compression report
Original tokens: 120,450
Compressed tokens: 12,831
Saved tokens: 107,619 (89.3%)
Local-Only Mode
Local-only mode does not require GitHub OAuth and does not send data.
| Mode | Requires GitHub OAuth? | Sends data? | What leaves the machine? |
|---|---|---|---|
| Local-only | No | No | Nothing |
| Connected proof | Yes | Yes | Aggregate counters only |
| Debug/advanced telemetry | Optional | Opt-in only | Redacted diagnostic summaries only |
Use connected mode for optional public proof/dashboard sync. One command does everything — authenticates via GitHub, verifies server-side, installs agent configs, and confirms the connection:
sage connect
After connecting, useful commands:
sage api whoami # Verify connection (pings server)
sage api status # Show endpoint and telemetry config
sage run -- <cmd> # Wrap any command (auto-sends telemetry)
sage status # Quick local status check
Live Public Proof Dashboard
Live dashboard: sage.api.marketingstudios.in/dashboard
Current public proof includes:
- Total commands processed through SAGE CLI
- Tokens processed, compressed, and saved
- Estimated savings by model/provider
- Compression rate and command success rate
- ML prediction scoring from local command history
Latest verified snapshot:
| Metric | Value |
|---|---|
| Commands processed | 6,288 |
| Tokens processed | 16,742,284 |
| Tokens compressed | 1,429,155 |
| Tokens saved | 15,314,377 |
| Estimated savings | $45.94 |
| Compression rate | 91.47% |
| Success rate | 99.5% |
These stats reflect live dashboard metrics as of July 7, 2026. Raw commands, outputs, file paths, and logs stay local by default. Public proof uses aggregate counters only.
Run Commands Through SAGE
sage run -- python -m pytest
sage run -- npm test
sage run -- git status
SAGE CLI stores full raw command output locally, summarizes noisy output for AI context, tracks compression, and sends only allowed aggregate proof metrics when connected mode is enabled.
System-Wide Installation for AI Agents
sage install
This installs SAGE instructions for Claude Code, Codex, Cursor, and Aider where those agent config files are available. For per-project setup:
sage init
Useful CLI Commands
sage context stats
sage context report
sage history --limit 10
sage explain
sage suggest
sage fix
sage fix --apply --confidence 0.9
sage savings --agent claude-sonnet
sage firewall status
sage firewall rules list
sage mcp install
sage dashboard start --port 8765
Screenshots
| Command | Preview |
|---|---|
sage run -- |
|
sage context report |
|
sage mcp install |
|
| Dashboard proof |
Starter demo GIFs:
Agents and ML
SAGE CLI includes local agent analysis and ML features in the base install. They run during command execution to classify output, choose compression strategies, and improve local predictions from command history.
Active Agent Types
- Security Agent: detects secrets, credentials, and security risks.
- Code Agent: checks syntax, scope, and file changes.
- Debug Agent: analyzes errors and suggests fixes.
- Test Agent: identifies test patterns and coverage.
- Dependency Agent: tracks package installations and versions.
- Research Agent: analyzes code patterns.
- Frontend Agent: reviews UI/browser-related output.
- Performance Agent: tracks performance signals.
- Workflow Agent: supports multi-step task orchestration.
- Red Team Agent: performs adversarial security checks.
ML V2 - Neural Command Center
SAGE V2 adds semantic embedding-based prediction using all-MiniLM-L6-v2 (384-dimensional vectors, 90 MB, Apache 2.0). The Neural Command Center coordinates specialized predictors for syntax, dependency, auth, timeout, permission, context, compression, and agent-ranking signals.
Benchmarks on 7,654 real commands with an 80/20 temporal split:
| Metric | V1 (sklearn) | V2 (embeddings) | Improvement |
|---|---|---|---|
| Accuracy | 58% | 76% | +31% |
| Precision | n/a | 87% | New |
| Recall | n/a | 85% | New |
| F1 Score | n/a | 86% | New |
These ML signals are experimental guidance, not a guarantee that a command will succeed or fail. See docs/ML_V2.md for architecture and benchmarks.
LSP Server + Agentic Loop (v2.1.0)
SAGE now includes a Language Server Protocol (LSP) server and an agentic retry loop that any editor or AI agent can connect to natively.
sage lsp # Start LSP server (stdio for editors)
sage lsp --tcp --port 19473 # Start LSP server (TCP for AI agents)
Agentic Loop — when a command fails, SAGE automatically:
- Analyzes the error against known patterns
- Suggests or applies a fix (configurable autonomy)
- Verifies the fix by re-running the original command
- Circuit breaker stops infinite retry loops
MCP tools for AI agents: sage_agentic_run, sage_agentic_fix, sage_agentic_session
Configure in sage.toml:
[agentic]
autonomy = "suggest" # suggest | ask | auto
max_retries = 3
[lsp]
transport = "stdio"
tcp_port = 19473
Team View Preview
Team Dashboard is not published yet. It will open by invite after SAGE CLI reaches 100 users.
The planned Team View will show aggregate workspace proof only: tokens saved, success rate, safety events, and protected secrets. It will not publish raw commands, source code, file paths, .env data, or raw logs.
GUI Status
The desktop GUI is not available in this public repo right now.
sage gui
This command prints the roadmap status instead of launching a desktop app. The GUI will be released later after it is stable enough for public use.
Known Limitations
- The GUI is not public yet and is intentionally absent from the CLI package.
- GitHub OAuth / a SAGE API key is required for API-backed commands and public proof sync.
- Telemetry level
0is local-only; higher levels are opt-in and constrained by account/key policy. - The public dashboard is aggregate-only and does not expose raw commands, raw outputs, file paths, or local logs.
- ML training and agent quality improve with usage volume; fresh installations have minimal training data initially.
- ML V2 embeddings download a roughly 90 MB model on first use. First prediction can take a few minutes to build the index; later predictions use the local cache.
Privacy and Security
- Raw commands and full outputs stay local by default.
- Public dashboard data is aggregate proof only.
- API connection is handled through GitHub OAuth.
- Higher telemetry is opt-in.
- API keys are stored in the OS keyring when available.
See Privacy, Security, Contributing, and Code of Conduct for the detailed project model.
Development
git clone https://github.com/PsYcGoD/sage.git
cd sage
pip install -e .[all]
python -m compileall -q src/sage
python -m pytest -q
The public package is CLI-first. GUI source, GUI tests, and GUI-only dependencies are intentionally not shipped in this repo at this time.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file psycgod_sage-2.2.1.tar.gz.
File metadata
- Download URL: psycgod_sage-2.2.1.tar.gz
- Upload date:
- Size: 202.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d347294b7ca17760a1ceb5994db76a7464c9c8366dbb9319ad293e7416e45b3d
|
|
| MD5 |
839f5b7f2a7415dcd29d3cf1a3ce51c6
|
|
| BLAKE2b-256 |
3b362908481654c164778b12e631596d86e2f015bd5d14a5d4c45d62d8db49e4
|
Provenance
The following attestation bundles were made for psycgod_sage-2.2.1.tar.gz:
Publisher:
pypi-publish.yml on PsYcGoD/sage
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
psycgod_sage-2.2.1.tar.gz -
Subject digest:
d347294b7ca17760a1ceb5994db76a7464c9c8366dbb9319ad293e7416e45b3d - Sigstore transparency entry: 2111241656
- Sigstore integration time:
-
Permalink:
PsYcGoD/sage@a1864e5a510a8803999099bb1f384f82dda64ebe -
Branch / Tag:
refs/tags/v2.2.1 - Owner: https://github.com/PsYcGoD
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@a1864e5a510a8803999099bb1f384f82dda64ebe -
Trigger Event:
release
-
Statement type:
File details
Details for the file psycgod_sage-2.2.1-py3-none-any.whl.
File metadata
- Download URL: psycgod_sage-2.2.1-py3-none-any.whl
- Upload date:
- Size: 218.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffa747d324a24bda010d1845bd5f75d412854c7476a27f776220c3518f619d67
|
|
| MD5 |
dc352a2d137f3f5d3828eb815312021c
|
|
| BLAKE2b-256 |
d7b28ec548c5cc52ac49b95eeecd28663636d76214032f648a4a00ec939ae72d
|
Provenance
The following attestation bundles were made for psycgod_sage-2.2.1-py3-none-any.whl:
Publisher:
pypi-publish.yml on PsYcGoD/sage
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
psycgod_sage-2.2.1-py3-none-any.whl -
Subject digest:
ffa747d324a24bda010d1845bd5f75d412854c7476a27f776220c3518f619d67 - Sigstore transparency entry: 2111241814
- Sigstore integration time:
-
Permalink:
PsYcGoD/sage@a1864e5a510a8803999099bb1f384f82dda64ebe -
Branch / Tag:
refs/tags/v2.2.1 - Owner: https://github.com/PsYcGoD
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@a1864e5a510a8803999099bb1f384f82dda64ebe -
Trigger Event:
release
-
Statement type: