A lightweight code assistant with tool-using capabilities built on HuggingFace's smolagents. Inspired by the tool use in Claude Code, this project provides a simple, easy-to-use interface with access to a range of tools for file manipulation, text search, and command execution. Features rich terminal UI output for an improved user experience.
- Rich terminal UI with syntax highlighting and formatted output
- Command-line interface for code assistance
- Integration with various tools:
BashTool- Execute bash commandsEditTool- Make changes to filesGlobTool- Find files using glob patternsGrepTool- Search within filesLSTool- List directory contentsReplaceTool- Create or overwrite filesViewTool- Read filesUserInputTool- Ask for user input during execution
- Python 3.11 or higher
- An Anthropic API key
-
Clone this repository:
git clone https://github.com/yourusername/smolcc.git cd smolcc -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the package:
pip install -e . -
Create a
.envfile with your Anthropic API key:ANTHROPIC_API_KEY=your_api_key_here
Run SmolCC from the command line:
python smolcc.py "What files are in the current directory?"Start an interactive session:
python smolcc.py -iThen enter your queries at the prompt.
SmolCC supports several command-line options:
python smolcc.py --helpOptions include:
-i, --interactive: Run in interactive mode--cwd PATH: Set the working directory--no-log: Disable logging to file--log-file PATH: Specify a custom log file path
This project uses a standard Python package structure:
smolcc/- The main packageagent.py- The main agent implementationtool_output.py- Output formatting classestools/- Tool implementationstests/- Unit tests for tools
