# kam CLI Help Reference

This file is generated from the current Kam CLI help output.

- Source: `cargo build --quiet, then target/debug/kam <command> --help`
- Version: `kam 0.6.2`

## Top Level

```text
kam — Kam is a CLI toolkit for scaffolding, building, packaging, and distributing Android modules and templates (KernelSU/APU/Magisk/AnyKernel3/AnyTemplate). It supports project initialization, packaging, template management, repository search/download, and exporting metadata files.

Usage: kam [OPTIONS] [-- [TARGETS]...] [COMMAND]

Commands:
  init         Initialize a new project from templates
  build        Build and package a module
  version      Manage module versions and bump policies
  cache        Manage local caches
  tmpl         Manage templates: import, export, package, and list [aliases: template, templates]
  validate     Validate kam.toml configuration and templates
  completions  Generate shell completion scripts [aliases: completion]
  secret       Manage signing keys and certificates
  sign         Sign an artifact
  verify       Verify an artifact signature
  check        Check project files
  export       Export module metadata files
  toml         Inspect and edit kam.toml
  config       Manage project or global configuration (like git config)
  install      Install a built module through a configured root manager
  publish      Publish build artifacts to a GitHub Release
  workflow     Install GitHub Actions workflows for build and release automation
  repo         Search and download modules from the module repository
  about        Display about information for Kam and credits
  env          Print KAM_ environment variables
  help         Print help information
```

## `init`

```text
Create a new Kam project skeleton from local or remote templates.

Usage: init [OPTIONS] [PATH]

Arguments:
  [PATH]
          AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public field 'name' in 'InitArgs'. Replace with real documentation. (2025-12-30T22:23:21Z)
Options:
      --id <ID>
          AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public field 'id' in 'InitArgs'. Replace with real documentation. (2025-12-30T22:23:21Z)

      --project-name <PROJECT_NAME>
          AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public field 'project_name' in 'InitArgs'. Replace with real documentation. (2025-12-30T22:23:21Z)

      --version <VERSION>
          AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public field 'version' in 'InitArgs'. Replace with real documentation. (2025-12-30T22:23:21Z)

      --author <AUTHOR>
          AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public field 'author' in 'InitArgs'. Replace with real documentation. (2025-12-30T22:23:21Z)

      --update-json <UPDATE_JSON>
          AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public field 'update_json' in 'InitArgs'. Replace with real documentation. (2025-12-30T22:23:21Z)

      --description <DESCRIPTION>
          AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public field 'description' in 'InitArgs'. Replace with real documentation. (2025-12-30T22:23:21Z)

      --repo-mode <REPO_MODE>
          KernelSU Modules Repository layout to initialize: full project or reference-only metadata repository.
          Possible values:
          - full:      Create a complete Kam project in this repository, including module source
          - reference: Create a metadata-only repository that points to an external source repository
          
          [default: full]

      --source-url <SOURCE_URL>
          Source code repository URL written to KernelSU module.json sourceUrl.

      --metamodule
          Mark the module as a KernelSU metamodule in generated metadata.

  -f, --force
          AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public field 'force' in 'InitArgs'. Replace with real documentation. (2025-12-30T22:23:21Z)

  -i, --interactive
          AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public field 'interactive' in 'InitArgs'. Replace with real documentation. (2025-12-30T22:23:21Z)

      --var <VAR>
          AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public field 'var' in 'InitArgs'. Replace with real documentation. (2025-12-30T22:23:21Z)

  -t, --template <TEMPLATE>
          AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public field 'template' in 'InitArgs'. Replace with real documentation. (2025-12-30T22:23:21Z)

      --tmpl
          AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public field 'tmpl' in 'InitArgs'. Replace with real documentation. (2025-12-30T22:23:21Z)

  -h, --help
          Print help (see a summary with '-h')
```

## `build`

```text
Build a module and package it into a deployable ZIP artifact.

Usage: build [OPTIONS] [PATH]

Arguments:
  [PATH]
          Path to the project (default: current directory)

          [default: .]
Options:
  -a, --all
          Build all workspace members

  -o, --output <OUTPUT>
          Output directory (default: dist)

  -b, --bump
          Enable `KAM_BUMP_ENABLED` environment variable (set to 1)

  -r, --release
          Enable `KAM_RELEASE_ENABLED` environment variable (set to 1)

  -s, --sign
          Enable `KAM_SIGN_ENABLE` environment variable (set to 1)

  -i, --interactive
          Run build interactively; ask for confirmation when performing potentially destructive actions

  -P, --pre-release
          Enable `KAM_PRE_RELEASE` environment variable (set to 1)

  -q, --quiet
          Suppress most output; show only warnings and errors

  -j, --jobs <JOBS>
          Number of parallel jobs (default: number of CPU cores)

  -h, --help
          Print help (see a summary with '-h')
```

## `version`

```text
Inspect and update module versions and bump policies.

Usage: version [VERSION]

Arguments:
  [VERSION]
          AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public field 'version' in 'VersionArgs'. Replace with real documentation. (2025-12-30T22:23:21Z)
Options:
  -h, --help
          Print help (see a summary with '-h')
```

## `cache`

```text
Manage template caches and module repository metadata caches.

Usage: cache <COMMAND>

Commands:
  list       List cached templates
  clean      Clean all cached templates
  add        Add a template to cache from a local directory or archive
  remove     Remove a template from cache
  path       Show cache directory path
  templates  Manage template cache entries
  modules    Manage module index cache (index_*.json and modules/<id>.json)
  help       Print this message or the help of the given subcommand(s)

Options:
  -h, --help
          Print help (see a summary with '-h')
```

## `tmpl`

```text
Manage template resources by importing, exporting, packaging, and listing templates.

Usage: tmpl <COMMAND>

Commands:
  list    List all available templates
  import  Import template(s) from file
  export  Export template(s) to file
  remove  Remove a template from cache
  path    Show template cache directory path
  pull    Download templates from a URL and import them
  update  Re-download based on recorded URL in config and import
  help    Print this message or the help of the given subcommand(s)

Options:
  -h, --help
          Print help (see a summary with '-h')
```

## `validate`

```text
Validate kam.toml configuration and template files.

Usage: validate [PATH]

Arguments:
  [PATH]
          Path to the project directory (default: current directory)

          [default: .]
Options:
  -h, --help
          Print help (see a summary with '-h')
```

## `completions`

```text
Generate command completion scripts for common shells.

Usage: completions [OPTIONS] <SHELL>

Arguments:
  <SHELL>
          Shell type for completion (bash,zsh,fish,powershell,elvish)
          Possible values:
          - bash:        AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public enum variant 'Bash' in 'ShellArg'. Replace with real documentation. (2025-12-30T22:23:21Z)
          - zsh:         AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public enum variant 'Zsh' in 'ShellArg'. Replace with real documentation. (2025-12-30T22:23:21Z)
          - fish:        AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public enum variant 'Fish' in 'ShellArg'. Replace with real documentation. (2025-12-30T22:23:21Z)
          - power-shell: AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public enum variant 'PowerShell' in 'ShellArg'. Replace with real documentation. (2025-12-30T22:23:21Z)
          - elvish:      AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public enum variant 'Elvish' in 'ShellArg'. Replace with real documentation. (2025-12-30T22:23:21Z)

Options:
  -o, --out <OUT>
          Output file. If omitted, prints to STDOUT

      --install
          Install the generated completion into the standard shell completion directory. When set, kam will attempt to write the generated completion into the system- or user-level completion directory appropriate for the chosen shell

  -h, --help
          Print help (see a summary with '-h')
```

## `secret`

```text
Manage keys and certificates used by signing and verification commands.

Usage: secret [OPTIONS] [COMMAND]

Commands:
  list          List saved secrets
  add           Add a secret from a value or file
  get           Get a secret and print it to stdout (or --out file)
  remove        Remove a secret
  export        Export secret to a file (by default decrypted). Use --encrypted to export encrypted blob
  import        Import secret from a file. If file is an encrypted KAM blob, it will be stored as-is
  export-pub    Export public key from a stored private key secret
  import-cert   Import developer certificate chain from GitHub issue or file
  trust         Manage trusted Root CAs
  ksu-generate  Generate a KernelSU developer P-256 key pair for developers.kernelsu.org
  ksu-submit    Create the KernelSU developer public-key submission issue URL
  ksu-revoke    Create the KernelSU developer certificate revocation issue URL
  help          Print this message or the help of the given subcommand(s)

Options:
  -i, --interactive
          Interactive mode: guide the user through secret management (add/list/get/remove, etc.)

  -h, --help
          Print help (see a summary with '-h')
```

## `sign`

```text
Sign an artifact using a key from the keyring or a PEM file.

Usage: sign [OPTIONS] [SRC]

Arguments:
  [SRC]
          The artifact to sign (zip). If omitted, use --dist or --all to sign multiple files
Options:
      --secret <SECRET>
          Name of the secret in kam keyring that holds the private key

          [default: main]

      --out <OUT>
          Output directory (default: dist)

          [default: dist]

      --dist <DIR>
          Sign all artifacts in given directory (instead of specifying single src file)

      --all
          Sign all artifacts inside dist (alias of --dist <dir> with default dist)

      --cert <CERT>
          Certificate PEM chain path to include in signature metadata

      --key-path <KEY_PATH>
          Optional path to a private key PEM file to use instead of the keyring secret

  -h, --help
          Print help (see a summary with '-h')
```

## `verify`

```text
Verify a .sig signature or a sigstore DSSE bundle.

Usage: verify [OPTIONS] [SRC]

Arguments:
  [SRC]
          Path to the artifact to verify (required for .sig verification)
Options:
      --sig <SIG>
          Path to signature file (base64 .sig). If omitted, defaults to <src>.sig

      --bundle <BUNDLE>
          Path to .sigstore.json bundle containing DSSE envelope and certs

      --cert <CERT>
          Optional certificate PEM to use for verification (overrides bundle cert)

      --root <ROOT>
          Optional root CA PEM to verify a certificate chain (trusted anchor)

      --secret <SECRET>
          Name of secret in kam keyring that holds the private key; used to derive public key for verification

          [default: main]

      --key <KEY>
          Path to public key PEM for verification (overrides derived key from secret)

      --cert-name <CERT_NAME>
          Name of cached developer certificate to use for verification

      --cert-chain <CERT_CHAIN>
          Path to certificate chain PEM file for verification

      --skip-crl
          Skip CRL (Certificate Revocation List) check

  -v, --verbose
          Verbose output showing verification steps

  -h, --help
          Print help (see a summary with '-h')
```

## `check`

```text
Lint, format-check, and parse project JSON, YAML, Markdown, and shell files.

Usage: check [OPTIONS] [PATHS]...

Arguments:
  [PATHS]...
          Paths or globs to check (file(s), directories, or glob patterns). If omitted, `path` (project directory) will be checked
Options:
      --project-path <PATH>
          Path to use as project directory fallback when no PATHS are supplied (default: current directory). Use positional PATHS for files/globs

          [default: .]

      --json
          Output results as JSON (compact by default; use -v/--verbose for detailed JSON)

  -v, --verbose
          Verbose JSON output (include full results). When using --json, this enables detailed output

      --fix
          Try to automatically fix/format files

      --fail-on-error
          Return a non-zero exit status when any errors are found (useful for CI)

      --fail-on-warning
          Return a non-zero exit status when any warnings are present (in addition to errors)

  -h, --help
          Print help (see a summary with '-h')
```

## `export`

```text
Export module.prop, module.json, repo.json, track.json, config.json, update.json, and related metadata from kam.toml.

Usage: export [FORMAT] [OUTPUT]

Arguments:
  [FORMAT]
          Export format: prop, json, update, repo, track, config
          Possible values:
          - prop:   AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public enum variant 'Prop' in 'ExportFormat'. Replace with real documentation. (2025-12-30T22:23:21Z)
          - json:   AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public enum variant 'Json' in 'ExportFormat'. Replace with real documentation. (2025-12-30T22:23:21Z)
          - repo:   AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public enum variant 'Repo' in 'ExportFormat'. Replace with real documentation. (2025-12-30T22:23:21Z)
          - track:  AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public enum variant 'Track' in 'ExportFormat'. Replace with real documentation. (2025-12-30T22:23:21Z)
          - config: AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public enum variant 'Config' in 'ExportFormat'. Replace with real documentation. (2025-12-30T22:23:21Z)
          - update: AUTO-GENERATED BY Kam/scripts/add_missing_docs.py: placeholder documentation for public enum variant 'Update' in 'ExportFormat'. Replace with real documentation. (2025-12-30T22:23:21Z)

  [OUTPUT]
          Output file path (default: write to a format-specific filename in the current directory)

Options:
  -h, --help
          Print help (see a summary with '-h')
```

## `toml`

```text
Get, set, unset, and list kam.toml fields using dot-path keys.

Usage: toml [OPTIONS] <COMMAND>

Commands:
  get    Get a value by dot-separated key path
  set    Set a value by key (usage: kam toml set prop.name=value | kam toml set prop.name value)
  unset  Unset/remove a key
  list   Dump the full toml
  help   Print this message or the help of the given subcommand(s)

Options:
      --file <FILE>
          Operate on the project's kam.toml (default), or specify file using --file

  -h, --help
          Print help (see a summary with '-h')
```

## `config`

```text
Manage project or global configuration (like git config)

Usage: config [OPTIONS] [COMMAND]

Commands:
  get    Get a configuration value by key (dot-separated path)
  set    Set a configuration value by key
  unset  Unset (remove) a configuration value by key
  list   List all config values in the target file
  show   Show built-in configuration keys and their descriptions
  help   Print this message or the help of the given subcommand(s)

Options:
      --global
          Use the global configuration file (~/.kam/config.toml)

      --local
          Force use of the local configuration file (project `.kam/config.toml`)

  -i, --interactive
          Interactive mode: guide the user through common configuration (language, root manager, etc.)

  -h, --help
          Print help (see a summary with '-h')
```

## `install`

```text
Install a module through Magisk, KernelSU, or APatch by delegating to the configured root manager.

Usage: install [OPTIONS] [PATH]

Arguments:
  [PATH]
          Path to module package (.zip) to install. If omitted, attempts to find the artifact in the project (dist) output directory
Options:
      --manager <MANAGER>
          Preferred root manager (overrides config). Valid values: Magisk, KernelSU, APatchSU

      --dry-run
          Print the derived install command without executing it

  -v, --verbose
          Verbose output showing install command output (stdout/stderr)

  -q, --quiet
          Suppress non-essential output

  -y, --yes
          Assume "yes" to all confirmation prompts (equivalent to -y). Use `-y` or `--yes` to skip confirmation

  -h, --help
          Print help (see a summary with '-h')
```

## `publish`

```text
Publish module ZIP files and sidecar artifacts from the build output directory to a GitHub Release.

Usage: publish [OPTIONS]

Options:
  -R, --repo <REPO>
          Target GitHub repository in owner/repo format. Defaults to GITHUB_REPOSITORY, KAM_RELEASE_REPO, or git origin

      --tag <TAG>
          Release tag. Defaults to KAM_RELEASE_TAG or the module version in kam.toml

      --dist <DIST>
          Build output directory containing release assets

          [default: dist]

  -t, --title <TITLE>
          Release title. Defaults to <module-id>-<versionCode>-<version>

  -n, --notes <NOTES>
          Release notes text

  -F, --notes-file <NOTES_FILE>
          Read release notes from a file

  -p, --prerelease
          Mark the release as a prerelease

  -d, --draft
          Keep the release as a draft instead of publishing it

      --all-assets
          Upload every file in --dist. By default only module ZIPs and their sidecar files are uploaded

      --dry-run
          Print the gh commands without executing them

  -h, --help
          Print help (see a summary with '-h')
```

## `workflow`

```text
Generate standard Kam module CI workflows, or install an upstream release mirror workflow when the source repository differs from the current repository.

Usage: workflow <COMMAND>

Commands:
  install  Install standard Kam CI workflows or an upstream release mirror workflow
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help
          Print help (see a summary with '-h')
```

## `repo`

```text
Search the remote module index and download modules or release artifacts.

Usage: repo [OPTIONS] [TARGETS]... [COMMAND]

Commands:
  sync      Sync (refresh) the index cache from remote (similar to pacman -Sy)
  search    Search the module repository
  download  Download one or more modules from the repository
  help      Print this message or the help of the given subcommand(s)

Arguments:
  [TARGETS]...
          Positional targets: module IDs or search terms (used with -S / -s)
Options:
  -S, --sync
          Pacman-style sync (download) flag (equivalent to pacman -S)

  -s, --search
          Pacman-style search modifier (use with -S as '-Ss' to search or '-s' alone to search)

  -q, --quiet
          Suppress progress output (quiet mode)

  -h, --help
          Print help (see a summary with '-h')
```

## `about`

```text
Display detailed about information for Kam including project metadata, authors, credits, and useful links.

Usage: about

Options:
  -h, --help
          Print help (see a summary with '-h')
```

## `env`

```text
Print environment variables starting with KAM_ for debugging.

Usage: env [OPTIONS]

Options:
  -d, --describe
          Show documentation for known environment variables (i18n)

  -h, --help
          Print help (see a summary with '-h')
```

## `help`

```text
Print top-level help or help for a specific subcommand.

Usage: help [SUBCOMMAND]...

Arguments:
  [SUBCOMMAND]...
          Subcommand path to show help for (e.g. `tmpl import`). Provide zero or more names; when omitted the top-level help is shown
Options:
  -h, --help
          Print help (see a summary with '-h')
```
