implemented shell_exec

This commit is contained in:
Luxferre
2026-03-21 17:11:17 +02:00
parent a2af89e61f
commit 6e2294cb48
6 changed files with 101 additions and 2 deletions
+29 -2
View File
@@ -1,6 +1,6 @@
# Sidekick
Sidekick is a 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).
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).
## Features
@@ -9,8 +9,35 @@ Sidekick is a versatile agentic framework written in Go 1.25. It provides a robu
* **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.
* **Internal Tools:** Built-in tools for file I/O (`read_file`, `write_file`, `grep_file`, `edit_file`) and an optional, secure `shell_exec` tool for running POSIX shell commands.
* **Configuration Driven:** Easily configure models, agents, tools, and MCP servers via a declarative `config.toml` file.
## Internal Tools
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:
```toml
[agents.coordinator]
role = "COORDINATOR"
model_id = "default"
enable_shell_exec = true # Security: explicitly enabled
toolsets = ["filesystem"]
```
## Installation
### Prerequisites
@@ -181,4 +208,4 @@ func main() {
## Credits
Created by Luxferre in 2026, released into public domain with no warranties.
Created by Luxferre in 2026, released into the public domain with no warranties.