Sidekick is a simple but versatile agentic framework written in Go 1.25. It provides a robust architecture for building AI assistants with hierarchical orchestration, native Model Context Protocol (MCP) integration, and a rich terminal user interface (TUI).
***Hierarchical Orchestration:** Support for complex agent topologies, including coordinators and specialized subagents.
***Model Context Protocol (MCP):** Native integration for calling external tools via MCP, supporting `stdio`, `sse`, and `http` transports (via `mark3labs/mcp-go`).
***Intelligent Buffering:** Automatically buffers large tool outputs to prevent context window exhaustion, returning file pointers for significant payloads.
***Rich Terminal UI:** A beautiful, responsive TUI built with Charmbracelet's BubbleTea and Lipgloss, featuring status bars, role-based formatting, and dynamic viewports.
***Advanced Prompt Templating:** Define complex, multi-line system prompts using TOML. Support for Go's `text/template` engine allows you to compose modular prompts from reusable snippets.
Sidekick includes a set of internal tools that are always available to agents. These tools provide common file operations and system access.
### File Tools
-`read_file`: Read a file with optional line windowing.
-`write_file`: Overwrite a file with new content.
-`grep_file`: Regex search with surrounding context.
-`edit_file`: Replace a string or block of lines in a file.
### shell_exec Tool
The `shell_exec` tool allows an agent to run arbitrary POSIX shell commands and receive combined stdout/stderr output.
**Security Warning:** This tool is extremely powerful and potentially dangerous. It is **disabled by default** and must be explicitly enabled for each agent in `config.toml`.
To enable `shell_exec` for an agent, add `enable_shell_exec = true` to its configuration:
Sidekick relies on two primary configuration files: `config.toml` for system settings and `prompts.toml` for advanced system prompt management.
**Important:** When running the TUI, the binary expects `config.toml` and `prompts.toml` to be present in the directory from which the command is executed.
### `config.toml`
This file defines your models, MCP servers, and agent profiles.
```toml
tool_response_threshold=10000# Bytes after which tool results are buffered to files
system_prompt="You are the primary coordinator agent."# This can be overridden by prompts.toml
subagents=["researcher"]
toolsets=["filesystem"]
```
### `prompts.toml`
Use this file to define complex, multi-line system prompts. If an entry here matches an agent's ID in `config.toml`, it will override the inline `system_prompt`. It uses Go's `text/template` engine, allowing you to compose prompts dynamically.
```toml
base_identity="""
You are a highly capable agentic assistant built on the Sidekick framework.
Always be professional, concise, and helpful.
"""
coordinator="""
{{template "base_identity"}}
You are the COORDINATOR agent. Your primary responsibility is to understand the
user's request and delegate tasks accordingly.
"""
```
## Usage
### Running the TUI
1. Ensure you have `config.toml` (and optionally `prompts.toml`) in your current directory.
2. Set any necessary environment variables defined in your config (e.g., `DEFAULT_MODEL_API_KEY`).