npm package: @limo-labs/limo-cli
Description: Limo CLI - AI-powered codebase analysis tool
Author: Limo Labs
Latest version: 0.1.0

# Limo CLI

AI-powered codebase analysis tool that generates comprehensive technical reports.

[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![npm version](https://img.shields.io/npm/v/@limo-labs/limo-cli)](https://www.npmjs.com/package/@limo-labs/limo-cli)

## About

Limo CLI analyzes your codebase using AI agents and produces structured reports covering architecture, dependencies, code quality, security, and more. It uses a multi-agent pipeline — Planner, Analyst, Writer, and Editor — to scan your project, extract findings, and compile them into a readable Markdown report with diagrams.

Built on the [Deity](https://github.com/limo-labs/limo-deity) framework with GitHub Copilot SDK as the LLM backend.

## Features

- **Multi-module analysis** — architecture, dependencies, code quality, security, database, testing, migration
- **Multi-agent pipeline** — Planner creates tasks, Analyst investigates code, Writer drafts sections, Editor synthesizes an executive summary
- **Multi-language reports** — English, 简体中文, 日本語, Español, Français, Deutsch
- **Interactive TUI** — real-time progress display built with Ink
- **Customizable scope** — configure focus areas, exclusions, and constraints via `LIMO.md`

## Installation

```bash
npm install -g @limo-labs/limo-cli
```

### Requirements

- Node.js 20 or >= 22
- GitHub Copilot access (for the underlying LLM)

## Usage

Analyze the current directory:

```bash
limo analyze
```

Analyze a specific project:

```bash
limo analyze /path/to/project
```

### Options

| Flag | Description | Default |
|------|-------------|---------|
| `-o, --output <path>` | Output directory | `.limo` |
| `--model <model>` | AI model to use | `claude-opus-4.6` |
| `--lang <language>` | Report language | `简体中文` |
| `--modules <modules>` | Comma-separated modules to analyze | all modules |
| `--verbose` | Show AI thinking process | `false` |
| `-d, --debug` | Enable debug logging | `false` |
| `--debug-api` | Enable API request/response logging | `false` |

### Examples

Analyze only architecture and security, output in English:

```bash
limo analyze ./my-project --modules architecture,security --lang English
```

Run with debug output:

```bash
limo analyze . --debug
```

### Output

Reports are saved to the output directory (default `.limo/`):

```
.limo/
├── manifest.json   # Analysis metadata and status
├── plan.json       # Generated analysis plan
├── report.md       # Final Markdown report
└── memory.json     # Analysis findings (structured data)
```

### Project Configuration

Create a `LIMO.md` file in your project root to customize analysis:

```markdown
# Limo Configuration

## Scope
Focus on the backend API layer only.

## Focus Areas
- API security
- Database performance

## Exclude Modules
- testing
- migration

## Constraints
- Ignore test fixtures and mock data
```

## How It Works

Limo runs a four-phase JSX workflow:

1. **Planning** — scans project structure, identifies tech stack, creates analysis tasks
2. **Analysis** — executes each task: reads source files, runs code analysis tools, stores findings in memory
3. **Writing** — recalls analysis findings and writes detailed report sections with code examples and diagrams
4. **Editing** — synthesizes all sections into a cohesive report with an executive summary

Each phase is powered by a specialized AI agent with its own tools and validation logic.

## Development

```bash
git clone https://github.com/limo-labs/limo-cli.git
cd limo-cli
npm install
npm run build
```

### Scripts

| Script | Description |
|--------|-------------|
| `npm run build` | Compile TypeScript |
| `npm run watch` | Compile in watch mode |
| `npm run dev` | Build and run CLI |
| `npm run analyze` | Build and run `analyze` command |

### Project Structure

```
src/
├── index.ts                  # CLI entry point (Commander)
├── commands/
│   ├── analyze.tsx           # Orchestrator: init → workflow → save
│   ├── analyze-init.ts       # Path resolution, config, adapter setup
│   ├── analyze-workflow.tsx   # JSX workflow tree definition
│   └── analyze-save.ts       # Report/manifest persistence
├── agents/
│   ├── planner.tsx           # Planning agent
│   ├── analyst.tsx           # Code analysis agent
│   ├── writer.tsx            # Report writing agent
│   └── editor.tsx            # Executive summary agent
├── tools/                    # Custom tool definitions
├── tui/                      # Ink-based terminal UI
├── report/                   # Diagram and Markdown generation
├── types/                    # Shared type definitions
└── utils/                    # Debug and config utilities
```

## License

Limo CLI is licensed under the MIT license. See the [`LICENSE`](LICENSE) file for details.