Synapse AI
Synapse AI is a terminal-based AI coding assistant designed for pair programming, codebase exploration, and automated code editing inside your workspace.
Built with Python 3.11+, Textual, Rich, and HTTPX.
Features
- Terminal TUI: Beautiful, responsive terminal user interface powered by Textual.
- Multi-Provider Support:
- Native Anthropic Messages API (
claude-3-7-sonnet,claude-3-5-sonnet, etc.) - OpenAI-compatible endpoints: OpenAI, Google Gemini, DeepSeek, Groq, Mistral AI, Together AI, Fireworks, Cerebras, SambaNova, Cohere, Perplexity, OpenRouter, Experiential Labs.
- Native Anthropic Messages API (
- Protected File Editing:
- Unified diffs previewed before any changes are written.
- Granular permission control: Allow once, Allow for Session, or Deny.
- Safe path resolution preventing directory traversal outside the workspace.
- Granular Security Modes:
default: Ask confirmation for file edits and shell commands.acceptEdits: Automatically apply file edits; confirm commands.plan: Read-only mode; prevents any file or command execution.bypass: Autonomous mode without interactive confirmation prompts.
- Transparent Execution: Live tool call logs (
↳ read_file(...),✓ completed) in the activity feed. - Token Streaming: Real-time token streaming from LLM providers (OpenAI-compatible and Anthropic Messages API) directly in the terminal interface.
- Session Persistence: Automatic saving of conversations, with
/sessions,/resume, and/exportcommands. - Token & Cost Tracking: Built-in
/usageand/contextreporting.
Installation
From Source (Development)
git clone https://github.com/yourusername/synapse-ai.git
cd synapse-ai
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies in editable mode
pip install -e ".[dev]"
Quick Start
Launch Synapse in your current workspace:
synapse
Or open a specific workspace:
synapse -w /path/to/project
Check version or help:
synapse --version
synapse --help
Configuring API Keys
You can configure API keys in two ways:
1. Via Environment Variables (Recommended)
Synapse automatically detects standard environment variables:
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."
export GEMINI_API_KEY="AIza..."
export DEEPSEEK_API_KEY="sk-..."
export GROQ_API_KEY="gsk_..."
2. In the TUI Interface
Type /keys inside the Synapse prompt, pick your provider from the list, enter your API key, and press Enter. Keys are securely stored in your OS keyring (with local fallback).
Commands
| Command | Description |
|---|---|
/init |
Initialize workspace metadata (.synapse/workspace.json) and trust |
/keys |
Configure provider API keys |
/model |
Select active model for the configured provider |
/mode [name] |
View or change permission mode (default, acceptEdits, plan, bypass) |
/clear |
Clear chat history and reset agent context |
/sessions |
List all saved conversation sessions in this workspace |
/resume <id> |
Restore a previous conversation session by ID |
/export [file] |
Export current conversation to a Markdown file |
/status |
Display workspace, provider, model, and permission status |
/usage |
Display token counts and estimated costs |
/context |
Display context window utilization |
/list [path] |
List files inside workspace |
/read <path> |
Read contents of a file |
/search <text> |
Search text across workspace files |
/write <path> :: <content> |
Create or overwrite a file |
/edit <path> :: <old> => <new> |
Replace exact text in a file |
/help |
Show command reference |
Permission Modes
Switch modes at any time with /mode <name>:
/mode plan # Read-only exploration and architecture planning
/mode acceptEdits # Fast coding without edit confirmations
/mode default # Safe mode: confirm edits and commands
/mode bypass # Full autonomous operation
Running Tests
Run the test suite with pytest:
pytest tests -v
Architecture
synapse/
├── agent/ # Agent loop, system prompt, context compaction
├── app/ # CLI entry point (argparse)
├── core/ # Data models (Message, Role, ToolCall, ChatResponse)
├── providers/ # LLM adapters (OpenAICompatible, Anthropic, Registry)
├── security/ # Permissions, Keyring/Env secrets, Config
├── session/ # Session manager & serialization
├── tools/ # Filesystem, Git, and Shell tools
├── ui/ # Textual TUI interface & Modal screens
└── usage.py # Token counting, pricing, and context limits
License
MIT
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 synapse_code-0.2.0.tar.gz.
File metadata
- Download URL: synapse_code-0.2.0.tar.gz
- Upload date:
- Size: 130.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab9bc610fe131d52ca7c60d1598797e4dc82bcb05c53d729eae6b93ae04227a6
|
|
| MD5 |
67b6e39b5b2837524a5bce402812a8e3
|
|
| BLAKE2b-256 |
94ee621588d8d280a38c074c7fbe3dacd8a2737041f4054750bab302ce154d0d
|
File details
Details for the file synapse_code-0.2.0-py3-none-any.whl.
File metadata
- Download URL: synapse_code-0.2.0-py3-none-any.whl
- Upload date:
- Size: 131.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4193be69b6831f2b636053efdd2e653d96c688b25ad24f9426d655cce8c2530
|
|
| MD5 |
1666d4f0dc06dbeb5602b4b87982db88
|
|
| BLAKE2b-256 |
080b6b60a741618fc96239f9176cd673ae038935ada0b73823bd25948b6d9637
|