# Debug CLI

Use when users need to debug, modify, or extend the code-forge application's CLI...

- Repository: https://github.com/tailcallhq/forgecode (7636 stars)
- Category: Testing
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add tailcallhq/forgecode --skill debug-cli -g -a claude-code -y`
Codex: `npx skills add tailcallhq/forgecode --skill debug-cli -g -a codex -y`
Cursor: `npx skills add tailcallhq/forgecode --skill debug-cli -g -a cursor -y`
Gemini CLI: `npx skills add tailcallhq/forgecode --skill debug-cli -g -a gemini-cli -y`

## Description

Use when users need to debug, modify, or extend the code-forge application's CLI commands, argument parsing, or CLI behavior. This includes adding new commands, fixing CLI bugs, updating command options, or troubleshooting CLI-related issues.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# CLI Debug Skill

This skill provides a systematic workflow for debugging and verifying changes to the forge CLI application.

## Core Principles

1. **Always get latest docs first**: Run `--help` to see current commands and options
2. **Use `-p` for testing**: Test forge by giving it tasks with the `-p` flag
3. **Never commit**: This is for debugging only - don't commit changes
4. **Clone conversations**: When debugging conversation bugs, clone the source conversation before reproducing

## Workflow

### 1. Build the Application

Always build in debug mode after making changes:

```bash
cargo build
```

**Never** use `cargo build --release` for debugging - it's significantly slower and unnecessary for verification.

### 2. Get Latest Documentation

**Always** start by checking the latest help to understand current commands and options:

```bash
# Main help - do this first
./target/debug/forge --help

# Command-specific help
./target/debug/forge [COMMAND] --help

# Subcommand help
./target/debug/forge [COMMAND] [SUBCOMMAND] --help
```

### 3. Test with `-p` Flag

Use the `-p` flag to give forge a task to complete without interactive mode:

```bash
# Test with a simple prompt
./target/debug/forge -p "create a hello world rust program"

# Test with specific functionality
./target/debug/forge -p "read the README.md file and summarize it"

# Test with complex tasks
./target/debug/forge -p "analyze the code structure and suggest improvements"
```

### 4. Debug with Conversation Dumps

When debugging prompts or conversation issues, use `conversation dump` to export conversations. The command automatically creates a timestamped file:

```bash
# Dump conversation as JSON (creates: YYYY-MM-DD_HH-MM-SS-dump.json)
./target/debug/forge conversation dump <conversation-id>

# Export as HTML for human-readable format (creates: YYYY-MM-DD_HH-MM-SS-dump.html)
./target/debug/forge conversation dump --html <conversation-id>

The rest: https://github.com/tailcallhq/forgecode/blob/HEAD/.forge/skills/debug-cli/SKILL.md
