cli_engineer 0.2.2

An autonomous CLI coding agent
# Product Requirements Document (PRD)

## Product Name
Agentic CLI Coding Utility

## Overview
A non-interactive command-line interface (CLI) tool designed to assist developers with coding tasks using AI. It integrates multiple AI providers, supports agentic search, shell command execution, context management, MCP client functionality, semantic linting, collaborative features, parallel actions, artifact management, and a visually enhanced terminal display.

## Target Audience
Developers working on codebases, particularly those familiar with CLI tools and AI-assisted workflows.

## Key Features

### 1. AI Provider Integration
- Support for Anthropic, OpenAI, Gemini, xAI, OpenRouter, and Ollama.
- Configurable reasoning and non-reasoning models or a single model with adjustable effort modes.
- Dynamic switching between models based on task requirements.

### 2. Agentic Search
- Intelligent search across relevant codebase sections.
- Superior to Retrieval-Augmented Generation (RAG) for codebase navigation.

### 3. Shell Command Access
- Execute commands like `ls`, `cat`, `grep`, `find`, etc.
- Use command outputs for analysis and decision-making.

### 4. Context Management
- Track context window usage.
- Compress context via summarization when usage reaches 50%.

### 5. MCP Client Functionality
- Act as an MCP client for tool access.
- Integrate with Playwright MCP server for UI screenshots.
- Use a visual analysis model (VLM/multimodal LLM) for image-based feedback.

### 6. Semantic Linting
- AI-driven code quality assessment.
- Customizable linting criteria.

### 7. Collaborative Features
- Integrate with GitHub for managing issues and pull requests (PRs).
- Automate issue resolution, PR creation, and code reviews.

### 8. Parallel Actions and Synthesis
- Perform concurrent tasks when beneficial.
- Synthesize results for optimal solutions.

### 9. Artifact Management
- Create and track work products (e.g., code files, execution outputs) as artifacts.
- Manage execution environments, including automatic installation of required packages and system dependencies.
- Maintain a manifest of created artifacts (e.g., in a JSON file) for user review during and after execution.

### 10. Enhanced Terminal Display
- Provide colorful and informative console output using ANSI escape codes.
- Display progress bars for ongoing tasks (e.g., code execution, dependency installation).
- Show real-time metrics including context size and usage, LLM API costs (if available), and run time.

## User Interface
- Command-line interface with real-time updates, featuring progress indicators, execution status, and detailed metrics.

## Configuration
- Configurable via configuration files (e.g., TOML) or CLI flags for AI models, modes, and other settings.

## Performance Requirements
- Efficient resource usage.
- Quick response times.
- Scalability for large codebases.

## Security
- Secure execution of shell commands and code in isolated environments (e.g., virtual environments or containers).
- Secure handling of automatic dependency installation.
- Protection of API keys and sensitive data.
- Ensure data privacy.