Warning: This project is under active development. APIs and output formats may change between versions. Use with caution in production scripts.
A lightweight headless CLI wrapper for Claude Code that renders structured text output. Perfect for scripts, automation, logging, and headless environments.
CCV is designed as a drop-in replacement for claude in headless environments. Simply replace claude with ccv in your existing scripts to get pretty, structured output instead of raw JSON:
# Before (raw stream-json output)
claude --print -p "Explain this code" --output-format stream-json
# After (pretty formatted output)
ccv "Explain this code"CCV automatically handles all the necessary flags (--print, --output-format stream-json, --verbose) so you can focus on your prompts. All Claude CLI arguments are passed through transparently.
- Structured Text Output: Clean, readable output showing assistant responses, tool calls, and thinking blocks
- Real-time Streaming: Claude's responses stream to stdout as they arrive
- Tool Call Formatting: Tool calls and results are clearly formatted with status indicators
- Agent Hierarchy Display: Shows nested agent context when Task tools spawn sub-agents
- Token Usage Tracking: Displays token counts and cost information
- Headless Operation: No interactive UI - perfect for scripts, CI/CD, and automation
- Flexible Output Modes: Supports verbose, quiet, and JSON output formats
- Signal Handling: Graceful shutdown with proper cleanup on SIGINT/SIGTERM
- Go 1.22 or later (for building from source)
- Claude Code CLI must be installed and configured
curl -fsSL https://raw.githubusercontent.com/agusmdev/ccv/main/install.sh | bashThis will automatically:
- Detect your OS (macOS, Linux) and architecture (amd64, arm64)
- Download the appropriate binary from GitHub releases
- Install to
/usr/local/bin(or~/.local/binif no sudo access) - Verify checksums for security
If you have Go installed, you can install directly:
go install github.com/agusmdev/ccv@latest- Visit the releases page
- Download the binary for your OS and architecture
- Make it executable:
chmod +x ccv - Move to your PATH:
sudo mv ccv /usr/local/bin/
git clone https://github.com/agusmdev/ccv.git
cd ccv
make installOr manually:
go build -o ccv
sudo mv ccv /usr/local/bin/Pass your prompt directly to ccv:
ccv "Explain this codebase"Pass Claude Code arguments directly - CCV filters its own flags and passes everything else through:
ccv -p "Fix the bug" --allowedTools Bash,ReadControl output verbosity with flags:
# Default: structured text with moderate detail
ccv "Explain this codebase"
# Verbose: include full tool inputs and parameters
ccv --verbose "Refactor this code"
# Quiet: only show assistant text responses
ccv --quiet "What is this project?"
# JSON: output parsed SDK messages as JSON
ccv --format json "Analyze the code"
# Disable colors (useful for logging or piping)
ccv --no-color "List all files"CCV outputs to stdout, making it perfect for piping:
# Save output to a log file
ccv "Analyze the code" > analysis.log
# Pipe to other tools
ccv "List all functions" | grep "export"
# Use in scripts
OUTPUT=$(ccv --quiet "What is the main entry point?")
echo "Entry point: $OUTPUT"Analyze a codebase:
ccv "Analyze the architecture of this project"Debug with specific tools:
ccv -p "Debug the authentication flow" --allowedTools Read,GrepGet help:
ccv --helpCheck version:
ccv --version| Flag | Description |
|---|---|
--verbose |
Show verbose output including full tool inputs |
--quiet |
Show only assistant text responses |
--format <fmt> |
Output format: text (default) or json |
--no-color |
Disable colored output |
--help |
Show help information |
--version |
Show version information |
| Variable | Description |
|---|---|
CCV_VERBOSE=1 |
Equivalent to --verbose |
CCV_QUIET=1 |
Equivalent to --quiet |
CCV_FORMAT=json |
Equivalent to --format json |
NO_COLOR=1 |
Disable colored output (standard no-color.org) |
TERM=dumb |
Also disables colored output |
CCV respects your existing Claude Code configuration. Make sure Claude Code is properly configured:
claude auth loginFor more Claude Code configuration options, see the official documentation.
CCV wraps the Claude Code CLI and:
- Spawns Claude Code as a subprocess with
--output-format stream-json - Parses the streaming NDJSON output from Claude Code's SDK
- Formats and outputs structured text to stdout in real-time
- Handles signals and cleanup for graceful shutdown
The output includes:
- Assistant Messages: Claude's text responses streamed as they arrive
- Tool Calls: Function calls with name, description, and status
- Tool Results: Results from executed tools (indented under tool calls)
- Thinking Blocks: Claude's reasoning process with
[THINKING]prefix - Agent Context: Shows current agent type and status (e.g.,
[main: running]) - Token Usage: Token counts and cost summary at completion
ccv/
├── main.go # Entry point and flag handling
├── runner.go # Claude Code subprocess management
├── output.go # Text output processor and message formatting
├── types.go # Message and event type definitions
├── colors.go # Terminal color scheme and ANSI codes
├── format.go # Text formatting utilities
└── go.mod # Go module dependencies
go run . "Your prompt here"go build -o ccvContributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see LICENSE for details.
- Wraps Claude Code - Anthropic's official CLI for Claude
- Built with Go's standard library for robust subprocess management and concurrent processing
If you encounter any issues or have questions:
- Open an issue on GitHub
- Check the Claude Code documentation
- Make sure Claude Code CLI is properly installed and configured