Skip to content
Kavachकवच

The kavach Command

● Intermediate4 minBefore this: Install

One program, kavach, makes, runs, builds, tests and checks your code.

CommandDoes
kavach new my-appmake a project: kavach.toml, src/main.kav and a .gitignore
kavach run [file.kav] [-- args]check and run a file, or the project's src/main.kav
kavach run --dry-runrun without making any capability call
kavach run --nativecompile to machine code first
kavach run --watchrun, and run again each time a .kav file or kavach.toml of the project changes
kavach build [file.kav] [-o out]write an executable
kavach build --compress [=max]write a smaller executable, packed without losing anything; it unpacks itself when it starts
kavach build --lib lib.kavwrite a shared library and a C header, for other languages
kavach add <name> --path <folder>add a dependency from a folder; --git <url> with --tag, --branch or --rev for a repository, --unsafe to allow one that uses unsafe code
kavach updatefetch every git dependency again and rewrite kavach.lock
kavach test [file.kav]run examples, test blocks and generated tests
kavach test --deepmany more generated cases, for a run at night or before a release
kavach test --keepturn each found case that now passes into an example on its function
kavach check [file.kav]only check for errors; --format json for tools
kavach fmt [--check]format every file, or report the ones that aren't
kavach fix <files or folders>apply the fixes that have one right answer and add no error
kavach auditlist unsafe code, revealed secrets, audited calls and capability use
kavach approvalslist the agents' requests that wait for a person
kavach approve <id> --as <name>approve a waiting request; kavach deny <id> --as <name> [--reason …] refuses it
kavach proto file.kavprint the .proto file for the program's types
kavach outline, query, contextanswer questions about the code, for AI assistants
kavach query tokens --format jsonsay where each name comes from, as the editor colors it, for tools such as a docs site
kavach mcp, kavach lspserve the tools to AI assistants, and errors as you type to editors
kavach --versionprint the compiler's version and the commit it was built from
kavach version <program>print what built an executable: its package's name and version, and the compiler's version and commit

Inside a project, run, build, test and check need no file name: they use src/main.kav.

kavach run --watch looks at the project's src/ folder (or the folder of the one file given) and its kavach.toml. When one changes, it stops the running program, prints -- changed: src/orders.kav, running again, and starts it again. Ctrl+C stops it. It is for working on a program, not for running one in production.

Coming later, as spec 10.5 describes: kavach repl and kavach eval, kavach api check, kavach build --release.

One page for each form