The kavach Command
● Intermediate4 minBefore this: Install
One program, kavach, makes, runs, builds, tests and checks your code.
| Command | Does |
|---|---|
kavach new my-app | make 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-run | run without making any capability call |
kavach run --native | compile to machine code first |
kavach run --watch | run, 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.kav | write 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 update | fetch every git dependency again and rewrite kavach.lock |
kavach test [file.kav] | run examples, test blocks and generated tests |
kavach test --deep | many more generated cases, for a run at night or before a release |
kavach test --keep | turn 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 audit | list unsafe code, revealed secrets, audited calls and capability use |
kavach approvals | list 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.kav | print the .proto file for the program's types |
kavach outline, query, context | answer questions about the code, for AI assistants |
kavach query tokens --format json | say where each name comes from, as the editor colors it, for tools such as a docs site |
kavach mcp, kavach lsp | serve the tools to AI assistants, and errors as you type to editors |
kavach --version | print 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.