Skip to content
Kavachकवच

Commands

● Intermediate3 minSpec 10.5

Every kavach command the spec describes, with what it does.

Spec 10.5 · learn it in The kavach Command.

CommandDoes
kavach new my-appCreate a project
kavach runCompile quickly and run (a project, or one file: 10.9)
kavach run --dry-runRun without executing capability calls
kavach run --watchRun, and run again each time a .kav file or kavach.toml of the project changes: the running program is stopped first
kavach buildCompile to an executable file (a project, or one file: 10.9)
kavach build --releaseOptimized build
--env-file <path>, --env NAME=value, --no-env-fileOn run, test and build: which .env file and which single variables the program gets (10.13)
kavach build --libCompile a library into a shared library with a C header, for other languages (10.10)
kavach build --compress / --compress=maxWrite a smaller executable, packed without losing anything; it unpacks itself when it starts (below)
kavach testRun generated and hand-written tests (chapter 11)
kavach fmtFormat 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 updateFetch every git dependency again at the tag, branch or commit kavach.toml asks for, and rewrite kavach.lock (10.12)
kavach auditList unsafe code, revealed secrets and capability use across all dependencies
kavach approvalsList 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 protoWrite the .proto file for a program's types, so other languages' gRPC tools can talk to it (14.14)
kavach fixApply safe fixes: compiler suggestions, deprecations (12.6), edition upgrades (10.8)
kavach api checkFind breaking changes in pub signatures before a release (12.5)
kavach repl / kavach evalTry code interactively or evaluate one expression (10.9)
kavach --versionPrint 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 lspLanguage 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.

spec 10.5 · command line