agent-c  by bravenewxyz

C-based AI agent for shell command execution

Created 6 months ago
431 stars

Top 69.0% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

Agent-C is an ultra-lightweight AI agent written in C, designed for executing shell commands via the OpenRouter API. It offers a minimal footprint and zero external dependencies, making it ideal for environments where resource constraints or build complexity are concerns.

How It Works

The agent establishes a connection to the OpenRouter API, sending user messages along with a sh tool definition. It streams token responses via Server-Sent Events (SSE) and, upon receiving a tool_calls response from the model, executes the specified shell command. The command's output is then sent back to the API for iterative response generation, supporting up to five tool calls per turn.

Quick Start & Requirements

  • Installation: Run make for auto-detection, or make macos / make linux for specific platform builds.
  • Prerequisites: bash, make. An OpenRouter API key must be set via the OR_KEY environment variable.
  • Dependencies: Features "Zero Dependencies," utilizing native TLS on macOS and avoiding common libraries like curl or libssl.
  • Documentation: Refer to SPEC.md for detailed architecture.

Highlighted Details

  • Ultra-lightweight: Compiles to a single file, approximately 4KB, distributed as an LZMA self-extracting archive.
  • Zero Dependencies: Native TLS implementation eliminates the need for external libraries like curl or libssl.
  • Tool Calling: Implements an OpenAI-compatible tools API for seamless shell command execution.
  • Streaming Output: Tokens are printed as they arrive via SSE for real-time feedback.
  • Conversation Memory: Maintains a sliding window of 20 messages, including tool call history.
  • Cross-Platform: Supports macOS and Linux.

Maintenance & Community

No specific details on contributors, sponsorships, or community channels were found in the provided README.

Licensing & Compatibility

The project is licensed under CC0 (No Rights Reserved), a highly permissive public domain dedication, allowing for unrestricted use, modification, and distribution, including in commercial or closed-source applications.

Limitations & Caveats

The agent's functionality is intrinsically tied to the OpenRouter API. Tool execution is limited to shell commands, and official cross-platform support is currently specified only for macOS and Linux.

Health Check
Last Commit

1 week ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
5 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.