A powerful CLI for interacting with multiple LLM providers. Support 10+ providers with smart chat management, encryption, MCP servers, and rich tools ecosystem.
Project description
Gede
🚀 A powerful and feature-rich CLI for interacting with multiple LLM providers
Gede is a powerful command-line interface that seamlessly integrates with multiple LLM providers including OpenAI, Anthropic, and DeepSeek. It features local chat history management, built-in tool calling capabilities, and MCP (Model Context Protocol) integration for enhanced AI interactions.
Features
- 🤖 Multi-Provider Support: OpenAI, Anthropic, DeepSeek, Qwen, Baidu, OpenRouter, Moonshot, Ollama, and more
- 💬 Chat Management: Create public, private (encrypted), and cloned conversations
- 🛠️ Rich Tools Ecosystem: Built-in web search, URL reading, and custom tools
- 🔌 MCP Server Integration: Connect to Model Context Protocol servers
- 📦 Profile Support: Manage multiple configurations with profiles
- 🌐 Web Search: Enable AI model's built-in web search capability
- 🖥️ API Server: Built-in HTTP API server for GUI client integration
Quick Start
Prerequisites
- Python 3.10 or higher
uvpackage manager
Install
uv tool install gede
Quick Example
# Start a new chat
gede
# Or start with a specific model
gede --model openai:gpt-4o
# Start in private mode
gede --private
# Use with tools enabled
gede --tools web_search,now
Slash Commands
When using Gede, you can use slash commands to perform various operations. Type /help to see all commands, or /help KEYWORD to search for specific commands.
Chat Management
| Command | Description |
|---|---|
/new |
Start a new public chat (plain text) |
/new-private |
Start a new private chat (password-encrypted) |
/chat-info |
Display current chat details (ID, title, model, message count, tools, MCP servers) |
/clone-chat |
Create a new chat with same settings (instruction, model, parameters) |
/quit |
Exit the application (unsaved private chats won't persist) |
Instruction & Prompt Management
| Command | Description |
|---|---|
/set-instruction <TEXT> |
Set system instruction. Use \\ for multi-line mode (Esc+Enter to submit) |
/get-instruction |
Display current system instruction |
/select-instruction |
Choose from predefined instructions in ~/.gede/instructions/ |
/select-prompt |
Select a predefined prompt as input message from ~/.gede/prompts/ |
Model Settings
| Command | Description |
|---|---|
/select-llm [PROVIDER] [--no-cache] |
Switch AI model. Use --no-cache to refresh model list |
/set-message-num NUMBER |
Control chat history length (0 = all messages) |
/set-model-settings KEY VALUE |
Adjust parameters: temperature (0-2), top_p (0-1), max_tokens, frequency_penalty (-2 to 2), presence_penalty (-2 to 2), reasoning_effort |
/get-model-settings |
Display current model parameters |
/set-model-reasoning <LEVEL> |
Control reasoning depth: minimal, low, medium, high, auto, or off |
/set-model-web-search <on|off|auto> |
Toggle web search capability |
File Operations
| Command | Description |
|---|---|
/save |
Save current chat. Public: auto-saved with generated title. Private: requires password |
/load-chat |
Load a public chat from ~/.gede/chats/public/ (interactive selection) |
/load-private-chat |
Load private chat from ~/.gede/chats/private/ (password required) |
/export <FILEPATH> |
Export chat to text file. Relative paths save to ~/.gede/chats/exports/ or specificed file path. |
/search-chats |
Search through all saved public chats with a real-time interactive interface (fzf-style). Type a keyword to filter by title or message content, use ↑↓ to navigate, Enter to load the selected chat. |
Image Input
Gede supports attaching images to your messages via two methods:
| Method | Description |
|---|---|
Ctrl+Y |
Paste an image from the clipboard (macOS). Can be used multiple times per message. |
/add-image <PATH|URL> |
Attach a local image file or an HTTP/HTTPS image URL to the next message. |
/add-image details:
- Local file: provide an absolute or relative path (supports
~). Supported formats:jpg,jpeg,png,gif,webp. The file is read and stored as base64. - Remote URL: provide an
http://orhttps://URL. The URL is passed directly to the LLM. - Run the command multiple times to attach several images at once.
- A confirmation line is printed after each successful addition:
🖼 Image added #N | ... - All pending images are sent together with your next text message, then the queue is cleared.
You: /add-image ~/screenshots/diagram.png
🖼 Image added #1 | diagram.png | image/png | 128.4 KB
You: /add-image https://example.com/chart.jpg
🖼 Image added #2 | URL: https://example.com/chart.jpg
You: What do these images show?
Keyboard Shortcuts
| Key | When | Action |
|---|---|---|
Ctrl+Y |
Waiting for input | Paste image or text from clipboard |
Esc |
During streaming LLM response | Interrupt the response immediately |
\ |
At the start of input | Enter multi-line mode (submit with Esc + Enter) |
Interrupting a streaming response
Press Esc at any time while the assistant is generating a response to stop it immediately. The partial output will be discarded and will not be added to the conversation history — the next message you send will start from the last complete exchange.
Tools
| Command | Description |
|---|---|
/select-tools |
Enable/disable built-in tools (Space to toggle, Enter to confirm) |
Utility
| Command | Description |
|---|---|
/cleanup |
Clear terminal screen |
/help [KEYWORD] |
Show all commands or search by keyword |
CLI Usage
Command Line Arguments
Gede supports the following command line arguments:
--profile <profile_name>: Use specified configuration profile (default: default)--log-level <level>: Set log level, options: DEBUG, INFO, WARNING, ERROR, CRITICAL--model <provider_id:model_id>: Specify default model, e.g.:openai:gpt-4o--instruction <text>: Set system prompt--private: Start private session--reasoning-effort <effort>: Set reasoning mode, options: minimal, low, medium, high, off, auto--web-search <mode>: Enable or disable model's built-in web search, options: on, off, auto--tools <tool_list>: Set enabled tools list, multiple tools separated by commas, e.g.:web_search,now,read_page--prompt <text|->/--prompts <text|->:Run headlessly: send a prompt directly and exit. Use--prompt=-to read the prompt from stdin (pipe mode). On success, stdout contains only the assistant answer; runtime errors are written to stderr with a non-zero exit code.--trace: Enable trace mode for analyzing detailed execution information of agent calls. Uses Arize Phoenix if thearize-traceextra is installed, otherwise uses OpenAI's default tracing (requiresOPENAI_API_KEY)--mcp <server_list>: Enable MCP servers, multiple servers separated by commas
Usage Examples
# Start with default configuration
gede
# Start with specified model
gede --model openai:gpt-4o
# Enable tools and private mode
gede --tools web_search,now --private
# Set reasoning mode and log level
gede --reasoning-effort high --log-level DEBUG
# Use specific profile
gede --profile my_profile
# Send a prompt directly and exit (headless)
gede --prompt="请用一句话解释量子计算"
# Pipe a prompt via stdin
echo "what is recursion?" | gede --prompt=-
Configuration
Storage
On first launch, Gede will automatically create a configuration directory at ~/.gede/ with:
config.env- Configuration file for API keysmcp.json- MCP server confirugationprofiles.json- Profile confirugation
chats/public/- Public chat storagechats/private/- Encrypted private chat storageinstructions/- Custom system instructionsprompts/- Predefined prompts
Gede uses environment variables to store API keys for various LLM providers. The configuration file is located at ~/.gede/config/.env. Edit this file to add your actual API keys.
Supported Providers
When you first run Gede, a default config file will be automatically created. Supported providers include:
- 302.ai:
AI302_API_KEY - OpenRouter:
OPENROUTER_API_KEY - OpenAI:
OPENAI_API_KEY - Anthropic:
ANTHROPIC_API_KEY - Baidu (ERNIE):
WENXIN_API_KEY - SiliconFlow:
SILICONFLOW_API_KEY - Aliyun (Qwen):
QWEN_API_KEY - VoiceEngine (Doubao):
DOUBAO_API_KEY - DeepSeek:
DEEPSEEK_API_KEY - Moonshot (Kimi):
MOONSHOT_API_KEY
The config file also supports:
- Generate Title Model: Use specific model for chat title generation
- Phoenix Tracing: Configure observability with Arize Phoenix
Profile
Gede supports profile management to save and reuse your preferred configurations. The profile configuration file is located at ~/.gede/config/profiles.json.
Profile Structure
Each profile can contain the following settings:
model: Default model to use (format:provider:model_id)instruction: System instruction/promptprivate: Whether to start in private mode (boolean)tools: List of enabled tools (e.g.,["web_search", "now", "read_page"])log_level: Logging level (DEBUG,INFO,WARNING,ERROR,CRITICAL)
Example Configuration
{
"default": {
"model": "openai:gpt-4o",
"instruction": "You are a helpful assistant.",
"private": false,
"tools": ["web_search", "now", "read_page"],
"log_level": "INFO"
},
"coding": {
"model": "anthropic:claude-sonnet-4-20250514",
"instruction": "You are an expert programming assistant.",
"tools": ["web_search", "read_page"],
"log_level": "DEBUG"
},
"research": {
"model": "openai:gpt-4o",
"instruction": "You are a research assistant specialized in finding and analyzing information.",
"tools": ["web_search", "read_page"]
}
}
Usage
# Use default profile
gede
# Use specific profile
gede --profile coding
# Use profile and override settings
gede --profile research --model deepseek:deepseek-reasoner
Note: Command-line arguments will override profile settings for the current session.
MCP
The MCP configuration file is located at ~/.gede/config/mcp.json. It allows you to define multiple MCP servers that Gede can connect to.
STDIO Server
Connects to a local process via standard input/output.
command(required): The executable command to run.args(optional): List of arguments for the command.env(optional): Dictionary of environment variables.cwd(optional): Working directory for the process.auto_select(optional, default:false): Whether to automatically select this server on startup.enable(optional, default:true): Whether this server is enabled.
Remote Server (SSE / Streamable HTTP)
Connects to a remote MCP server.
type(required): Must be eithersseorstreamable-http.url(required): The URL of the server endpoint.headers(optional): Dictionary of HTTP headers.note(optional): Description or note for the server.auto_select(optional, default:false): Whether to automatically select this server on startup.enable(optional, default:true): Whether this server is enabled.
Example Configuration
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/username/Desktop"
],
"auto_select": true
},
"remote-echo": {
"type": "sse",
"url": "https://example.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN"
},
"note": "My remote MCP server",
"auto_select": false,
"enable": true
}
}
}
Build-in Tools
| Tool | Description |
|---|---|
web_search |
Search the internet using Exa AI |
read_url |
Read and extract text content from a URL |
now |
Get current date, time, and timezone information |
bash |
Execute bash shell commands on the local system (see below) |
image_gpt_tool |
Generate images with the GPT image model from text prompts and reference images |
image_grok_tool |
Generate images with the Grok image model from text prompts and reference images |
speech_tool |
Generate speech audio from text using Fish Audio |
code_execute |
Execute stateful Python code in an isolated E2B sandbox |
subagent_tool |
Run up to four independent Gede headless subtasks concurrently |
image_gpt_tool and image_grok_tool
The image_gpt_tool and image_grok_tool use tena to generate images from a text prompt. They can also pass local file paths or HTTP/HTTPS image URLs as reference images.
Set the image model paths in ~/.gede/config/.env:
GEDE_IMAGE_GPT_MODEL_PATH="openrouter/gpt-image-2"
GEDE_IMAGE_GROK_MODEL_PATH="openrouter/x-ai/grok-2-image"
GEDE_IMAGE_ACCESS_ENDPOINT="http://localhost:9127/public/generated_images"
The selected tena model still requires its corresponding API key, such as OPENROUTER_API_KEY, ZENMUX_API_KEY, AI302_API_KEY, or GEMINI_API_KEY.
Generated images are saved under ~/.gede/data/public/generated_images/, and the tool result returns both saved file paths and HTTP URLs when GEDE_IMAGE_ACCESS_ENDPOINT is configured. If gede-server uses --base-path /api/v1, include that prefix in the endpoint, for example http://localhost:9127/api/v1/public/generated_images.
Enable:
gede --tools image_gpt_tool,image_grok_tool
speech_tool
The speech_tool uses the Fish Audio TTS API to generate an MP3 audio file from text.
Set the Fish Audio model, API key, voice reference ID, and optional public URL endpoint in ~/.gede/config/.env:
FISH_AUDIO_MODEL_ID="s2.1-pro-free"
FISH_AUDIO_API_KEY="YOUR_FISH_AUDIO_API_KEY"
FISH_AUDIO_VOICE_ID="fd8438ddf6cc41caafc5cd10ece9a4f1"
GEDE_SPEECH_ACCESS_ENDPOINT="http://localhost:9127/public/generated_audio"
Generated audio files are saved under ~/.gede/data/public/generated_audio/, and the tool result returns both the saved file path and HTTP URL when GEDE_SPEECH_ACCESS_ENDPOINT is configured. If gede-server uses --base-path /api/v1, include that prefix in the endpoint, for example http://localhost:9127/api/v1/public/generated_audio.
Enable:
gede --tools speech_tool
code_execute
The code_execute tool runs Python with E2B Code Interpreter. Variables, imports, functions, and files remain available across tool calls in the same chat while the Gede process is running. It does not expose arbitrary local files or host environment variables to the sandbox.
See the code_execute execution-flow guide for the sandbox lifecycle, attachment transfer, output-file export, and error handling details.
In API server mode, files uploaded through /chat/upload can be sent as type: "file" attachments in /chat. Gede lazily uploads those attachment references into the chat's sandbox and exposes their metadata and sandbox paths as JSON in os.environ["GEDE_INPUT_FILES"]:
import json
import os
import pandas as pd
inputs = json.loads(os.environ["GEDE_INPUT_FILES"])
df = pd.read_csv(inputs[0]["path"])
Uploaded inputs are stored under /home/user/gede_inputs/<file_ref>/ in the sandbox. The same content hash is uploaded only once per sandbox, and previously registered inputs remain in the manifest for later calls in that chat.
Each execution receives a unique sandbox output directory in os.environ["GEDE_OUTPUT_DIR"]. Code should save files intended for the user there:
import os
from pathlib import Path
output_dir = Path(os.environ["GEDE_OUTPUT_DIR"])
df.to_csv(output_dir / "result.csv", index=False)
(output_dir / "summary.txt").write_text("Done")
Configure E2B in ~/.gede/config/.env:
E2B_API_KEY="e2b_..."
GEDE_E2B_SANDBOX_TIMEOUT_SECONDS="300"
GEDE_E2B_EXECUTION_TIMEOUT_SECONDS="120"
GEDE_CODE_EXECUTE_ACCESS_ENDPOINT="http://localhost:9127/public/code_interpreter"
The sandbox pauses after the configured idle timeout and resumes automatically on the next call. TUI chat switches and normal process shutdown permanently close the sandbox. API server mode keeps one sandbox per chat_id and serializes concurrent executions for the same chat. Sandbox IDs are not persisted, so restarting Gede starts fresh environments.
Python stdout, stderr, text results, errors, and execution counts are returned as JSON. All regular files under the execution's GEDE_OUTPUT_DIR are downloaded after execution, preserving subdirectories. E2B-rendered PNG/JPEG results are downloaded separately under rendered-images/. Artifacts are saved under ~/.gede/data/public/code_interpreter/; the tool returns local paths, /public/... paths, and HTTP URLs. API server mode automatically builds an absolute URL from the current request, including --base-path. GEDE_CODE_EXECUTE_ACCESS_ENDPOINT overrides that URL when an external reverse-proxy address is required and is also needed for HTTP URLs in standalone TUI mode.
Input and output collection are each limited to 50 files, 50 MiB per file, and 200 MiB total. Symbolic links and paths outside GEDE_OUTPUT_DIR are ignored. Files remain available inside the sandbox for later calls until that chat's sandbox is closed.
Enable:
gede --tools code_execute
The tool does not require approval because execution happens in an isolated E2B environment. E2B sandboxes have internet access by default. A force-killed Gede process can leave a paused sandbox behind; remove such sandboxes from the E2B dashboard. Because session state is process-local, multi-worker API deployments cannot guarantee that requests for one chat_id reach the same sandbox.
subagent_tool
The subagent_tool concurrently runs up to four independent Gede headless processes with the fixed model openrouter:x-ai/grok-4.5. It accepts a tasks array; each task has a unique name, a prompt, and a list of built-in tools.
Each valid task starts a fresh conversation and inherits only the current process environment and working directory. It does not inherit the parent conversation history, system instruction, attachments, MCP servers, private-session state, or code_execute sandbox. A task's tool list may be empty, but every supplied name must be registered as a built-in tool. Recursive use of subagent_tool is rejected.
All valid tasks run concurrently and each has its own 600-second timeout. Invalid tasks and subprocess failures are isolated and do not stop other tasks. Results are returned as a JSON array in input order with name, status, result, and error fields. Approval-required tools retain the existing headless behavior, so tools such as bash are rejected inside a subtask rather than bypassing approval.
Enable:
gede --tools subagent_tool
Example tool arguments:
{
"tasks": [
{
"name": "生成密码",
"prompt": "生成 10 个临时密码,并说明生成规则",
"tools": ["code_execute"]
},
{
"name": "检查规则",
"prompt": "总结安全临时密码应满足的规则",
"tools": []
}
]
}
bash Tool
The bash tool allows the LLM to execute shell commands on your local machine.
Features:
- Confirmation prompt: Before every execution, you will be asked to approve the command — the AI cannot run anything without your explicit
yconsent - Unified tool approval: TUI and API server mode both use the shared tool approval flow; headless mode rejects approval-required tools automatically
- Safety restrictions: Dangerous commands are automatically rejected (e.g.,
rm -rf /,mkfs,ddto disk devices, fork bombs,shutdown/reboot) - Working directory tracking:
cdcommands are handled correctly and the current directory persists across calls within the same session - Non-interactive mode: Subprocesses run with stdin closed, preventing commands from hanging while waiting for user input
- Timeout protection: Commands are killed after 30 seconds to prevent hangs
- Output truncation: Output is capped at 100 lines to avoid overwhelming the context
- ANSI cleanup: Terminal color codes are stripped from output
Enable:
gede --tools bash
Example Profile (~/.gede/config/profiles.json):
{
"dev": {
"model": "openai:gpt-4o",
"tools": ["bash", "read_url"]
}
}
⚠️ Security note: Only enable the
bashtool in sessions where you trust the AI model and the prompts being sent. Always review the command shown before approving execution.
Optional Dependencies
Gede supports optional extensions for enhanced functionality:
Arize Phoenix Tracing (arize-trace)
Enable advanced tracing and observability with Arize Phoenix. This extension is used when you enable trace mode with the --trace flag.
Installation:
uv pip install "gede[arize-trace]"
Usage:
When the arize-trace extension is installed and --trace is enabled, Gede will automatically use Arize Phoenix for tracing:
gede --trace
If the extension is not installed, Gede will fall back to OpenAI's built-in tracing (if OPENAI_API_KEY is set).
Configuration:
To use Arize Phoenix, edit ~/.gede/config/.env and configure:
# Phoenix trace endpoint (customize with your project token if needed)
PHOENIX_COLLECTOR_ENDPOINT=https://app.phoenix.arize.com/s/your-project-token/v1/traces
If not configured, it defaults to https://app.phoenix.arize.com.
Develop
# Clone the repository
git clone https://github.com/adow/gede.git
cd gede
# Install dependencies using uv
uv sync
# Run Gede
python3 -m gede.gede
Project Structure
gede/
├── gede/
│ ├── commands/ # Slash command implementations
│ │ ├── base.py # Command base class
│ │ ├── chat_commands.py # Chat management commands
│ │ ├── model_commands.py # Model selection and settings
│ │ ├── file_commands.py # File operations (save, load, export)
│ │ └── ... # Other command modules
│ ├── llm/
│ │ ├── providers.py # LLM provider registry
│ │ ├── *_provider.py # Individual provider implementations
│ │ │ ├── openai_provider.py
│ │ │ ├── anthropic_provider.py
│ │ │ ├── deepseek_provider.py
│ │ │ └── ... # Other providers
│ │ ├── tools/ # Built-in tools
│ │ │ ├── web_search.py
│ │ │ ├── read_url_tool.py
│ │ │ └── time_tool.py
│ │ └── mcp/ # Model Context Protocol integration
│ ├── chatcore.py # Core chat logic
│ ├── gede.py # Main CLI entry point
│ ├── server.py # API server entry point
│ ├── config.py # Configuration management
│ ├── encrypt.py # Encryption utilities
│ ├── profiles.py # Profile management
│ └── top.py # Top-level utilities
├── CONTRIBUTING.md # Contribution guidelines
├── CODE_OF_CONDUCT.md # Community code of conduct
├── CHANGELOG.md # Version history
├── LICENSE # MIT License
├── pyproject.toml # Python project configuration
├── Dockerfile # Docker configuration
└── README.md # This file
API Server
Gede includes a built-in HTTP API server (gede-server) built with FastAPI, designed for GUI client integration.
# Start the server (default port: 9127)
gede-server
# Custom port and base path
gede-server --port 8080 --base-path /api/v1 --log-level=INFO
See docs/server-api.md for the full API reference.
Technology Stack
- Language: Python 3.10+
- CLI Framework: rich, inquirer, prompt-toolkit,
- Encryption: cryptography
- HTTP Client: httpx
- Agent Framework: OpenAI Agent
- Build: uv
Security
- Password-protected private chats with AES encryption
- User data stays local by default - chat history is ephemeral and only persisted when explicitly saved using
/savecommand
Community
License
Acknowledgments
Thanks to all contributors and the open-source community for support and feedback!
Disclaimer
Gede is provided "as-is" for research and personal use. Users are responsible for complying with LLM provider terms of service and applicable laws when using this tool.
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 Distributions
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 gede-0.4.33-py3-none-any.whl.
File metadata
- Download URL: gede-0.4.33-py3-none-any.whl
- Upload date:
- Size: 211.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99eaaf6964215f9d72d82d2a2ca8390d2a75302104ebe84693e6c45530e9e4f8
|
|
| MD5 |
71888634fe428878de758fdd22f71005
|
|
| BLAKE2b-256 |
451687430644deb26f6ec62dac15d0d5a4e0766bf346fd9b866e97fff49a008c
|