Skip to main content
All trace commands live under the trace group (alias: t).
valiqor trace <init|apply|uninstrument|refresh>
# or
valiqor t <init|apply|uninstrument|refresh>

trace init

Scan your codebase for LLM usage and generate a valiqor_init.py initialization file with workflow suggestions.
valiqor trace init [flags]
FlagTypeDefaultDescription
--defaults / -dflagfalseUse default settings without prompting
--force / -fflagfalseOverwrite existing valiqor_init.py
--no-scanflagfalseSkip codebase scanning (faster, no suggestions)
--verbose / -vflagfalseShow detailed scan output

What It Does

  1. Runs a context scanner for feature detection
  2. Scans your codebase for LLM usage (detects providers and entry points)
  3. Generates valiqor_init.py with recommended workflow decorators
  4. Creates the trace output directory
  5. Updates .gitignore to exclude trace files

Example

# Interactive initialization
valiqor trace init

# Quick setup with defaults, overwriting existing config
valiqor trace init --defaults --force
If no .valiqorrc exists, the CLI auto-configures the project before scanning.

trace apply

Apply @trace_workflow decorators to your Python files based on scan suggestions.
valiqor trace apply [flags]
FlagTypeDefaultDescription
--dry-runflagfalsePreview changes without modifying files
--allflagfalseApply to all entry points, including alternatives
--firstflagfalseApply to the first suggestion per file only
--verbose / -vflagfalseShow detailed output

Behavior

  • By default, applies decorators only to recommended entry points.
  • --all includes alternative entry points as well.
  • Creates backups of modified files before applying changes.
  • If valiqor_init.py is stale (scan ID mismatch), the CLI re-scans automatically before applying.

Example

# Preview what decorators would be applied
valiqor trace apply --dry-run

# Apply to recommended entry points
valiqor trace apply

# Apply to every detected entry point
valiqor trace apply --all

trace uninstrument

Remove auto-applied Valiqor instrumentation (decorators and imports) from Python files.
valiqor trace uninstrument [files...] [flags]
FlagTypeDefaultDescription
filespositionalall *.py filesSpecific files to uninstrument
--dry-runflagfalseShow what would be removed without making changes
--no-recursiveflagfalseOnly process the current directory (default: recursive)

Example

# Remove instrumentation from all Python files (recursive)
valiqor trace uninstrument

# Preview removal for specific files
valiqor trace uninstrument app.py utils.py --dry-run

# Process current directory only (no recursion)
valiqor trace uninstrument --no-recursive
Excludes dotfiles and valiqor_init.py by default.

trace refresh

Re-scan the codebase and regenerate valiqor_init.py with updated suggestions.
valiqor trace refresh [flags]
FlagTypeDefaultDescription
--verbose / -vflagfalseShow detailed scan output

Example

valiqor trace refresh
Runs the context scanner and LLM detection again, then prompts before overwriting the existing valiqor_init.py.