Kernels documentation
CLI reference for kernel-builder
CLI reference for kernel-builder
This document contains the help content for the kernel-builder command-line program.
Command Overview:
kernel-builderβ΄kernel-builder completionsβ΄kernel-builder initβ΄kernel-builder buildβ΄kernel-builder build-and-copyβ΄kernel-builder build-and-uploadβ΄kernel-builder uploadβ΄kernel-builder check-configβ΄kernel-builder check-abiβ΄kernel-builder check-buildsβ΄kernel-builder create-pyprojectβ΄kernel-builder devshellβ΄kernel-builder list-variantsβ΄kernel-builder hashβ΄kernel-builder testshellβ΄kernel-builder update-buildβ΄kernel-builder skillsβ΄kernel-builder skills addβ΄kernel-builder clean-pyprojectβ΄
kernel-builder
Build Hugging Face Hub kernels
Usage: kernel-builder <COMMAND>
Subcommands:
completionsβ Generate shell completionsinitβ Initialize a new kernel project from templatebuildβ Build the kernel locally (alias for build-and-copy)build-and-copyβ Build the kernel and copy artifacts locallybuild-and-uploadβ Build the kernel and upload to Hugging Face Hubuploadβ Upload kernel build artifacts to the Hugging Face Hubcheck-configβ Validate the build.toml filecheck-abiβ Check the ABI compatibility of a kernel extensioncheck-buildsβ Validate kernel buildscreate-pyprojectβ Generate CMake files for a kernel extension builddevshellβ Spawn a kernel development shelllist-variantsβ List build variantshashβ Hash the builds of a kerneltestshellβ Spawn a kernel test shellupdate-buildβ Update abuild.tomlto the current formatskillsβ Install skills for AI coding assistants (Claude, Codex, OpenCode)clean-pyprojectβ Clean generated artifacts
kernel-builder completions
Generate shell completions
Usage: kernel-builder completions <SHELL>
Arguments:
<SHELL>Possible values:
bash,elvish,fish,powershell,zsh
kernel-builder init
Initialize a new kernel project from template
Usage: kernel-builder init [OPTIONS] [PATH]
Arguments:
<PATH>β Directory to initialize (defaults to current directory)
Options:
--license <LICENSE>β The kernelβs licenseDefault value:
Apache-2.0--name <OWNER/REPO>β Name of the kernel repo (e.g.drbh/my-kernel)--backends <BACKENDS>β Backends to enable (all,cpu,cuda,metal,neuron,rocm,xpu)--overwriteβ Overwrite existing scaffold files (preserves other files)
kernel-builder build
Build the kernel locally (alias for build-and-copy)
Usage: kernel-builder build [OPTIONS] [KERNEL_DIR]
Arguments:
<KERNEL_DIR>β Directory of the kernel project (defaults to current directory)
Options:
--variant <VARIANT>β Build a specific variant--max-jobs <MAX_JOBS>β Maximum number of parallel Nix build jobs--cores <CORES>β Number of CPU cores to use for each build job-L,--print-build-logsβ Print full build logs on standard error
kernel-builder build-and-copy
Build the kernel and copy artifacts locally
Usage: kernel-builder build-and-copy [OPTIONS] [KERNEL_DIR]
Arguments:
<KERNEL_DIR>β Directory of the kernel project (defaults to current directory)
Options:
--max-jobs <MAX_JOBS>β Maximum number of parallel Nix build jobs--cores <CORES>β Number of CPU cores to use for each build job-L,--print-build-logsβ Print full build logs on standard error
kernel-builder build-and-upload
Build the kernel and upload to Hugging Face Hub
Usage: kernel-builder build-and-upload [OPTIONS] [KERNEL_DIR]
Arguments:
<KERNEL_DIR>β Directory of the kernel project (defaults to current directory)
Options:
--variant <VARIANT>β Build a specific variant--max-jobs <MAX_JOBS>β Maximum number of parallel Nix build jobs--cores <CORES>β Number of CPU cores to use for each build job-L,--print-build-logsβ Print full build logs on standard error--repo-id <REPO_ID>β Repository ID on the Hugging Face Hub (e.g.user/my-kernel)--branch <BRANCH>β Upload to a specific branch (defaults tov{version}from metadata)--privateβ Create the repository as private--repo-type <REPO_TYPE>β Repository type on Hugging Face Hub (kernelby default, ormodelfor legacy repos)Default value:
kernelPossible values:
model,kernel-q,--quietβ Suppress progress output
kernel-builder upload
Upload kernel build artifacts to the Hugging Face Hub
Usage: kernel-builder upload [OPTIONS] [KERNEL_DIR]
Arguments:
<KERNEL_DIR>β Directory of the kernel build (defaults to current directory)
Options:
--repo-id <REPO_ID>β Repository ID on the Hugging Face Hub (e.g.user/my-kernel). Defaults togeneral.hub.repo-idfrombuild.toml--branch <BRANCH>β Upload to a specific branch (defaults tov{version}from metadata)--privateβ Create the repository as private--repo-type <REPO_TYPE>β Repository type on Hugging Face Hub (kernelby default, ormodelfor legacy repos)Default value:
kernelPossible values:
model,kernel-q,--quietβ Suppress progress output
kernel-builder check-config
Validate the build.toml file
Usage: kernel-builder check-config [KERNEL_DIR]
Arguments:
<KERNEL_DIR>
kernel-builder check-abi
Check the ABI compatibility of a kernel extension
Usage: kernel-builder check-abi [OPTIONS] [KERNEL_DIR]
Arguments:
<KERNEL_DIR>β Directory with kernels
Options:
-m,--manylinux <VERSION>β Manylinux versionDefault value:
manylinux_2_28--macos <VERSION>β macOS versionDefault value:
15.0-p,--python-abi <VERSION>β Python ABI versionDefault value:
3.9--torch-stable-abi <VERSION>β Torch stable ABI version
kernel-builder check-builds
Validate kernel builds
Usage: kernel-builder check-builds [KERNEL_DIR]
Arguments:
<KERNEL_DIR>
kernel-builder create-pyproject
Generate CMake files for a kernel extension build
Usage: kernel-builder create-pyproject [OPTIONS] [KERNEL_DIR] [TARGET_DIR]
Arguments:
<KERNEL_DIR><TARGET_DIR>β The directory to write the generated files to (directory ofBUILD_TOMLwhen absent)
Options:
-f,--forceβ Force-overwrite existing files--unique-id <UNIQUE_ID>β This is an optional unique identifier that is suffixed to the kernel name to avoid name collisions. (e.g. Git SHA)--kernel-sha <KERNEL_SHA>β Full commit SHA of the kernel source, recorded in the build metadata. When absent, it is detected from the kernelβs git repository (used by Nix builds where the source has no.git)--kernel-dirtyβ Mark the kernel source as having uncommitted changes in the build metadata. Only meaningful together with--kernel-sha
kernel-builder devshell
Spawn a kernel development shell
Usage: kernel-builder devshell [OPTIONS] [KERNEL_DIR]
Arguments:
<KERNEL_DIR>
Options:
--variant <VARIANT>β Use a specific variant--max-jobs <MAX_JOBS>β Maximum number of parallel Nix build jobs--cores <CORES>β Number of CPU cores to use for each build job-L,--print-build-logsβ Print full build logs on standard error
kernel-builder list-variants
List build variants
Usage: kernel-builder list-variants [OPTIONS] [KERNEL_DIR]
Arguments:
<KERNEL_DIR>
Options:
--archβ Only list variants for the current architecture
kernel-builder hash
Hash the builds of a kernel
Usage: kernel-builder hash [KERNEL_DIR]
Arguments:
<KERNEL_DIR>
kernel-builder testshell
Spawn a kernel test shell
Usage: kernel-builder testshell [OPTIONS] [KERNEL_DIR]
Arguments:
<KERNEL_DIR>
Options:
--variant <VARIANT>β Use a specific variant--max-jobs <MAX_JOBS>β Maximum number of parallel Nix build jobs--cores <CORES>β Number of CPU cores to use for each build job-L,--print-build-logsβ Print full build logs on standard error
kernel-builder update-build
Update a build.toml to the current format
Usage: kernel-builder update-build [KERNEL_DIR]
Arguments:
<KERNEL_DIR>
kernel-builder skills
Install skills for AI coding assistants (Claude, Codex, OpenCode)
Usage: kernel-builder skills <COMMAND>
Subcommands:
addβ Install a kernels skill for an AI assistant
kernel-builder skills add
Install a kernels skill for an AI assistant
Usage: kernel-builder skills add [OPTIONS]
Options:
--skill <SKILL>β Skill to installDefault value:
cuda-kernelsPossible values:
cuda-kernels,cpu-kernels,rocm-kernels,triton-kernels,xpu-kernels--claudeβ Install for Claude--codexβ Install for Codex--opencodeβ Install for OpenCode-g,--globalβ Install globally (user-level) instead of in the current project directory--dest <DEST>β Install into a custom destination (path to skills directory)--forceβ Overwrite existing skills in the destination
kernel-builder clean-pyproject
Clean generated artifacts
Usage: kernel-builder clean-pyproject [OPTIONS] [KERNEL_DIR] [TARGET_DIR]
Arguments:
<KERNEL_DIR><TARGET_DIR>β The directory to clean from (directory ofBUILD_TOMLwhen absent)
Options:
-d,--dry-runβ Show what would be deleted without actually deleting-f,--forceβ Force deletion without confirmation--ops-id <OPS_ID>β This is an optional unique identifier that is suffixed to the kernel name to avoid name collisions. (e.g. Git SHA)
This document was generated automatically by
clap-markdown. Update on GitHub