Getting started
This page is for users who have installed imp and want to create a workspace
and build a first target. You will create imp.workspace.js, declare a small
target, and run it from the workspace root.
Initialize a workspace from the repository root:
Illustrative example
imp init
The interactive checklist detects C/C++, JavaScript/TypeScript, Odin, Python,
and Rust sources. Select the languages and capabilities the workspace needs;
imp then creates imp.workspace.js importing the rules that provide them. A
language's rules bring the workflows they support with them, so the generated
file names only what the selection adds. Those rules provide pinned default
toolchains; initialization never overwrites an existing workspace or creates a
nested workspace.
Every imp workspace has a root marker file, imp.workspace.js. To create
one manually, import the rule modules your BUILD.js files will use (see The
workspace file for what else it's for):
import "//rules/c";
import "//rules/c/cmake";
Targets are declared in BUILD.js files anywhere in the workspace tree — imp discovers them automatically:
import { stampFile } from "//rules/imp/codegen";
export const hello = stampFile({
output: "generated/hello.txt",
text: "hello from imp",
});
Build it with:
imp build //:hello
This produces a cached artifact for other build tasks to consume; it does not
write generated/hello.txt into the workspace.