forge restore
Resolves all dependencies declared in your project manifest and writes a forge.lock file that pins exact versions for reproducible builds.
- Reads your project manifest (
kairo.toml) for declared dependencies. - Resolves the full transitive dependency graph.
- Writes
forge.lockwith pinned version information. - Downloads any packages not already present in the local cache.
forge.lock— generated or updated in the project root.
Commit
forge.lock to source control for applications. Libraries can optionally omit it, but pinning is recommended for reproducibility.forge check
Validates your source code and reports diagnostics without producing any build artifacts. Use this for fast feedback during development.
- Parses and type-checks all
.aksource files. - Emits diagnostics (errors and warnings) to the terminal.
- Exits with a non-zero code when errors are found.
- Diagnostic messages only — no files are written to
build/or.forge/.
forge build
Runs the full compilation pipeline: parsing, type-checking, and artifact generation. Use this when you need deployable output.
- Performs everything
forge checkdoes. - Generates compiled artifacts into
build/. - Writes the build plan, output manifest, and IR handoff files to
.forge/.
build/— compiled application artifacts..forge/— Forge-internal metadata consumed by the Pulse runtime.
forge build implicitly runs dependency resolution if forge.lock is missing or out of date. Run forge restore explicitly before forge build in clean CI environments to keep the two steps distinct.forge test
Discovers and runs the project’s test suite.
- Builds the project (if needed) or uses cached artifacts.
- Discovers test declarations in the source tree.
- Runs all tests and reports pass/fail results.
- Exits with a non-zero code when any test fails.
- Test result summary to the terminal.
- Exit code
0for all-pass; non-zero for any failure.
forge package
Packages the compiled project for distribution, producing a distributable archive ready for publishing.
- Verifies the build is up to date (triggers
forge buildif necessary). - Bundles compiled artifacts, manifest, and metadata into a distribution package.
- Writes the package to the
build/directory.
- A distributable package archive under
build/.
forge publish
Publishes the packaged project to the Kairo package registry.
- Runs
forge packageif the package is not already prepared. - Authenticates with the configured registry.
- Uploads the package and registers the new version.
forge clean
Removes all generated build output and Forge-internal metadata. Source files are never touched.
- Deletes the
build/directory. - Deletes the
.forge/directory. - Does not remove source files,
kairo.toml, orforge.lock.
- A clean project directory with only source and configuration files remaining.
forge clean is safe to run at any time. It will never modify or delete your .ak source files, your manifest, or your lock file.Diagnostic Code Prefixes
Forge and the Pulse runtime emit structured diagnostic codes. Each code has a three-letter prefix that identifies its origin, followed by a numeric identifier.
Example diagnostics:
Build Output Layout
After a successfulforge build, your project directory contains the following generated structure:
