Commands
● Intermediate3 minSpec 10.5
Every kavach command the spec describes, with what it does.
Spec 10.5 · learn it in The kavach Command.
| Command | Does | ||
|---|---|---|---|
kavach new my-app | Create a project | ||
kavach run | Compile quickly and run (a project, or one file: 10.9) | ||
kavach run --dry-run | Run without executing capability calls | ||
kavach run --watch | Run, and run again each time a .kav file or kavach.toml of the project changes: the running program is stopped first | ||
kavach build | Compile to an executable file (a project, or one file: 10.9) | ||
kavach build --release | Optimized build | ||
--env-file <path>, --env NAME=value, --no-env-file | On run, test and build: which .env file and which single variables the program gets (10.13) | ||
kavach build --lib | Compile a library into a shared library with a C header, for other languages (10.10) | ||
kavach build --compress / --compress=max | Write a smaller executable, packed without losing anything; it unpacks itself when it starts (below) | ||
kavach test | Run generated and hand-written tests (chapter 11) | ||
kavach fmt | Format all code | ||
kavach add <name> --path <folder> / kavach add <name> --git <url> [--tag T \ | --branch B \ | --rev C] [--unsafe] | Add a dependency, fetch it, write the capabilities it uses into its can and write kavach.lock (10.12) |
kavach update | Fetch every git dependency again at the tag, branch or commit kavach.toml asks for, and rewrite kavach.lock (10.12) | ||
kavach audit | List unsafe code, revealed secrets and capability use across all dependencies | ||
kavach approvals | List the requests a project's agents wait on: number, call, role, when asked, until when (8.3) | ||
kavach approve <id> --as <name> / kavach deny <id> --as <name> [--reason <text>] | Answer one; the program waiting sees it within a second, or the next start finds it (8.3) | ||
kavach proto | Write the .proto file for a program's types, so other languages' gRPC tools can talk to it (14.14) | ||
kavach fix | Apply safe fixes: compiler suggestions, deprecations (12.6), edition upgrades (10.8) | ||
kavach api check | Find breaking changes in pub signatures before a release (12.5) | ||
kavach repl / kavach eval | Try code interactively or evaluate one expression (10.9) | ||
kavach --version | Print the compiler's version and the commit it was built from: kavach 0.1.0 (commit 8f8ae051) | ||
kavach version <program> | Print what built an executable: its package's name and version, and the compiler's version and commit (below) | ||
kavach lsp | Language server for editors, on stdin and stdout: errors as you type, with the same messages as kavach check; the type of what is under the cursor (hover); where a name is declared (go to definition); and the names in scope, or after a . the fields and methods of the value (completion) |
Not built yet: api check, repl and eval (Phase 3 tools, roadmap), and build --release: kavach build already optimizes. Until then they print the command list. kavach fix works on the files and folders it is given (kavach fix src); with none, it doesn't yet fix the whole project, and edition upgrades wait for a second edition (10.8).
Settings in kavach.toml and the environment variables Kavach reads are listed in Settings.