Skip to main content

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.
  • 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 /export commands.
  • Token & Cost Tracking: Built-in /usage and /context reporting.

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

synapse_code-0.2.0.tar.gz (130.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

synapse_code-0.2.0-py3-none-any.whl (131.2 kB view details)

Uploaded Python 3

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

Hashes for synapse_code-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ab9bc610fe131d52ca7c60d1598797e4dc82bcb05c53d729eae6b93ae04227a6
MD5 67b6e39b5b2837524a5bce402812a8e3
BLAKE2b-256 94ee621588d8d280a38c074c7fbe3dacd8a2737041f4054750bab302ce154d0d

See more details on using hashes here.

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

Hashes for synapse_code-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f4193be69b6831f2b636053efdd2e653d96c688b25ad24f9426d655cce8c2530
MD5 1666d4f0dc06dbeb5602b4b87982db88
BLAKE2b-256 080b6b60a741618fc96239f9176cd673ae038935ada0b73823bd25948b6d9637

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page