An open-source experimental CLI-based coding agent built with CrewAI Flows. This agent is designed to autonomously plan and execute coding tasks, leverage web research, and adapt to your project's conventions within your cli.
- 🧠 Persistent Memory: Stores project conventions and learned information in markdown files (
~/.crewai_agent/memories), allowing the agent to "remember" your coding style and preferences across sessions. - 🌊 CrewAI Flows: Orchestrates a two-stage process:
- Planning Crew: Analyzes your request, checks memories, and researches the web (using Exa) to create a detailed implementation plan.
- Execution Crew: Autonomously executes the plan using a suite of file and exploration tools.
- 🔍 Web Research: Integrated
ExaSearchToolandScrapeWebsiteToolallow the agent to find the latest documentation and examples for unknown libraries. - 🛠️ Subagent Capabilities: The Execution agent is equipped with:
GrepTool&ListDirectoryTool: To explore and understand the existing codebase.TodoPlanningTool: To self-manage complex tasks by creating and tracking aTODO.mdfile.
- ⚡ Skills System: Extensible architecture inspired by Claude Skills. Add new capabilities by simply creating a
SKILL.mdfile in a.skills/directory.
-
Clone the repository:
git clone <repository-url> cd cli_agent
-
Install dependencies: Requires Python 3.10+.
pip install -e .
You must set the following environment variables for the agent to function:
export GEMINI_API_KEY="your_google_gemini_api_key" # or GOOGLE_API_KEY
export EXA_API_KEY="your_exa_api_key"Run the agent with a natural language description of your task:
cli-agent start "Create a python script that fetches the latest news about AI using requests and beautifulsoup"The agent will:
- Load relevant memories.
- Research the web if needed.
- Create a plan.
- Execute the plan, creating files and writing code.
Teach the agent about your project conventions or preferences:
# Add a new memory
cli-agent memory add conventions "Always use type hints and docstrings in Python code."
# List all memories
cli-agent memory listThe agent can dynamically load "Skills" to perform specialized tasks.
-
Create a Skill: Create a directory
.skills/my-skill/in your project root (or~/.crewai_agent/skills/). Add aSKILL.mdfile with instructions:--- name: my-skill description: A brief description of what this skill does. --- # My Skill Instructions 1. Do step one. 2. Do step two.
-
Use the Skill: Ask the agent to use it:
cli-agent start "Use the my-skill to perform X"
code-reviewer: A skill to review code for best practices and bugs.excalidraw-architect: Generates architectural diagrams in Excalidraw JSON format.
src/cli_agent/flow.py: The main entry point usingCodingAgentFlow.src/cli_agent/crews/planning_crew.py: ThePlanningCrewdefinition.src/cli_agent/crews/execution_crew.py: TheExecutionCrewdefinition.src/cli_agent/utils/memory_manager.py: Handles reading/writing memory files.src/cli_agent/tools/: Custom tools for file operations, search, and skills.