Skip to content

lorenzejay/lorenzejay-cli-agents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLI Coding Agent

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.

Features

  • 🧠 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:
    1. Planning Crew: Analyzes your request, checks memories, and researches the web (using Exa) to create a detailed implementation plan.
    2. Execution Crew: Autonomously executes the plan using a suite of file and exploration tools.
  • 🔍 Web Research: Integrated ExaSearchTool and ScrapeWebsiteTool allow 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 a TODO.md file.
  • ⚡ Skills System: Extensible architecture inspired by Claude Skills. Add new capabilities by simply creating a SKILL.md file in a .skills/ directory.

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd cli_agent
  2. Install dependencies: Requires Python 3.10+.

    pip install -e .

Configuration

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"

Usage

Starting a Task

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:

  1. Load relevant memories.
  2. Research the web if needed.
  3. Create a plan.
  4. Execute the plan, creating files and writing code.

Managing Memory

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 list

Using Skills

The agent can dynamically load "Skills" to perform specialized tasks.

  1. Create a Skill: Create a directory .skills/my-skill/ in your project root (or ~/.crewai_agent/skills/). Add a SKILL.md file 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.
  2. Use the Skill: Ask the agent to use it:

    cli-agent start "Use the my-skill to perform X"

Included Skills

  • code-reviewer: A skill to review code for best practices and bugs.
  • excalidraw-architect: Generates architectural diagrams in Excalidraw JSON format.

Architecture

  • src/cli_agent/flow.py: The main entry point using CodingAgentFlow.
  • src/cli_agent/crews/planning_crew.py: The PlanningCrew definition.
  • src/cli_agent/crews/execution_crew.py: The ExecutionCrew definition.
  • src/cli_agent/utils/memory_manager.py: Handles reading/writing memory files.
  • src/cli_agent/tools/: Custom tools for file operations, search, and skills.

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages