Codeflash CLI Reference
Complete command-line reference for all Codeflash commands, flags, and options with practical examples you can run directly in your terminal.Prerequisites - Ensure Codeflash is installed in your Python environment
and you have a configured
pyproject.toml in your project.Quick Start
- Linux/macOS
- Windows
Common Workflows
1. First-Time Setup
1
Install Codeflash
2
Initialize Project
3
Verify Setup
4
Run First Optimization
2. Optimize a Workflow
1
Trace Your Script
2
Review Optimizations
Check the generated PR or local changes for optimization suggestions.
3. CI/CD Integration
1
Set Up GitHub Actions
2
Merge the Workflow PR
Review and merge the generated GitHub Actions workflow.
3
Automatic Optimization
Codeflash will now optimize code in every PR automatically!
Help & Version
Documentation Structure
This CLI reference is organized into the following sections:Setup Commands
Initialize projects, set up GitHub Actions, and verify installation
Optimization Commands
Optimize single functions or entire codebases
Tracing & Workflows
Trace script execution and optimize based on real usage
Flags Reference
Complete reference for all command-line flags
Troubleshooting
Solutions for common CLI issues