Skip to Content
ReferenceTools

The cpl command

The normative description of each tool.

Normative text from spec/tools/cli.md.

Status: draft for 0.3.0. Sources: plan/40-tooling.md §8, decisions 34, 36. Every command takes a file (d, d.cp, a path) and defaults to the most recently edited .cp file in the folder.

CommandDoes
cpl new dcreates d.cp from the template and d.tests/
cpl fetch <url>downloads samples into d.tests/
cpl run d [files]checked build in the interpreter, on files or stdin; compares with .out files if present; --release runs the judge's C++
cpl test devery case in d.tests/, inline @samples and @test fns
cpl stress dalternatives, generators, checkers, law sampling; shrinks and saves failures (tools/stress.md)
cpl locate dthe smallest failing input and the first part whose alt disagrees
cpl interact druns against an @interactor or an external interactor binary
cpl explain d [name]layouts, widths, niches, peak memory, specializations, checks, copies (tools/explain.md)
cpl trace d inputHTML trace of a run (tools/trace-debug.md)
cpl debug d inputthe debugger over the interpreter
cpl profile d inputper-line time and allocation on the release C++
cpl cover dwhich lines and branches the tests reach
cpl bench drelease runtime against the profile's limits and against a matched C++ file if given
cpl fmt [files]canonical formatting (tools/fmt-lint.md)
cpl lint [files]lints with autofixes
cpl build dthe C++ for the file's judge; --checked, --size, --judge, --copy
cpl submit dbuild, then the cases on that build with the judge's flags; --copy puts the file on the clipboard
cpl migrateruns codemods to a new stdlib version and updates pins
cpl judgeslists judge profiles
cpl docrenders library docs from doc comments
cpl lspthe language server
cpl watch drebuild and test on save
cpl selftestinterpreter and C++ agreement on the corpus

Output is plain text for people and --json for tools; exit codes are 0 success, 1 failure of the program or a test, 2 compile error, 3 usage error. Everything is deterministic given the seed.