Flags Reference
Complete reference for all Codeflash CLI flags and command-line options.Main Command Flags
| Flag | Type | Description |
|---|---|---|
--file | PATH | Optimize only this file |
--function | NAME | Optimize only this function (requires --file) |
--all | [PATH] | Optimize all functions. Optional path to start from |
--replay-test | PATH | Path to replay test file(s) |
--benchmark | flag | Enable benchmark mode |
--no-pr | flag | Donโt create PR, update locally |
--no-gen-tests | flag | Donโt generate tests |
--no-draft | flag | Skip draft PRs |
--worktree | flag | Use git worktree |
--staging-review | flag | Upload to staging |
--verbose / -v | flag | Verbose debug output |
--verify-setup | flag | Run setup verification |
--version | flag | Show version |
Configuration Override Flags
Override settings frompyproject.toml via command line.
| Flag | Type | Description |
|---|---|---|
--config-file | PATH | Path to pyproject.toml |
--module-root | PATH | Python module root directory |
--tests-root | PATH | Tests directory |
--benchmarks-root | PATH | Benchmarks directory |
Complete Examples
Complete Examples
- Linux/macOS
- Windows
Optimize Subcommand Flags
Flags specific to thecodeflash optimize command.
| Flag | Type | Description |
|---|---|---|
--output | PATH | Trace file output path (default: codeflash.trace) |
--timeout | INT | Maximum trace time in seconds |
--max-function-count | INT | Max times to trace a function (default: 100) |
--config-file-path | PATH | Path to pyproject.toml |
--trace-only | flag | Only trace, donโt optimize |
The
--output flag specifies where to save the trace file. If not specified, it defaults to codeflash.trace in the current directory.Behavior Flags
Control how Codeflash behaves during optimization.| Flag | Description |
|---|---|
--no-pr | Run locally without creating a pull request |
--no-gen-tests | Use only existing tests, skip test generation |
--no-draft | Skip optimization for draft PRs (CI mode) |
--worktree | Use git worktree for isolated optimization |
--staging-review | Upload optimizations to staging for review |
--verbose / -v | Enable verbose debug logging |
Complete Examples
Complete Examples