Skip to content

CLI options

Plain text
contextcraft [options] [DIRECTORY | FILE...]

No paths means the current directory. Supply one directory or several repository-relative regular files, using -- before filenames that start with a dash. Long options accept --option=value, and short value options accept forms such as -b8000 and -fjson.

Context and output

OptionMeaning
--budget, -bPositive integer token budget, default 16000
--focusTask description used in ranking
--focus-fileFavor a path or glob, repeatable
--tierMaximum tree, sigs, skel, or full
--format, -fmarkdown, json, or xml
--encodingcl100k_base or o200k_base
--output, -oAtomic file output, or - for stdout
--stats, -sStatistics on stderr
--quiet, -qSuppress notices while keeping errors visible

Discovery

OptionMeaning
--jobs, -j0 for automatic workers, or 1 through 8
--excludeAdditional .gitignore pattern, repeatable
--max-file-sizeSource byte limit, accepting integer units such as 1MiB
--include-dirC/C++ include root, repeatable
--gitignore, --no-gitignoreEnable or disable .gitignore and .ignore
--default-excludes, --no-default-excludesEnable or disable common and language defaults
--hidden, --no-hiddenInclude or exclude hidden paths

Discovery defaults enable ignore rules, language exclusions, and hidden paths. Symlinks are not followed, and explicit file inputs bypass discovery exclusions. See files and exclusions for source loading boundaries.

Protection and configuration

OptionMeaning
--secretsredact, block, or off, default redact
--secret-allowExempt a path from suppression and scanning, repeatable
--configLoad a selected JSON configuration file
--no-configDisable automatic .contextcraft.json loading

Playground and help

OptionMeaning
--playgroundStart a local session and open a browser
--portPlayground port, with 0 selecting an available port
--no-openPrint the session URL without opening a browser
--help, -hShow grouped help and examples
--version, -VPrint the build version

--port and --no-open require --playground. --quiet cannot be combined with --stats, and --config cannot be combined with --no-config.

Exit codes and streams

CodeMeaning
0Successful generation, help, or version
1Operational failure, including missing or unreadable inputs
2Invalid arguments or configuration
130Cancellation
141Closed output pipe

Artifact bytes go to stdout unless a file is selected, while diagnostics and statistics go to stderr. Configuration syntax and type errors include a file, line, and column. Failed generation preserves an existing output artifact.