Command-Line Interface (CLI)

Updated Nov 24, 2025

Netsuke's CLI provides commands to manage your build.

netsuke [OPTIONS] [COMMAND] [TARGETS...]
  1. Step 01

    Global Options

    • -f, --file <FILE>: Path to the Netsukefile (default: Netsukefile).

    • -C, --directory <DIR>: Change to directory DIR before doing anything.

    • -j, --jobs <N>: Set the number of parallel jobs Ninja should run (default: Ninja's default).

    • -v, --verbose: Enable verbose logging output.

  2. Step 02

    Commands

    • build (default): Compiles the manifest and runs Ninja to build the specified TARGETS (or the defaults if none are given).

    • --emit <FILE>: Write the generated build.ninja file to <FILE> and keep it, instead of using a temporary file.

    • manifest <FILE>: Generates the build.ninja file and writes it to <FILE> without executing Ninja. Useful for debugging or integration with other tools.

    • clean: Removes build artefacts by running ninja -t clean. Requires rules/targets to be properly configured for cleaning in Ninja (often via phony targets).

    • graph: Generates the build dependency graph and outputs it in DOT format (suitable for Graphviz). Future versions may support other formats like --html.

  3. Step 03

    Exit Codes

    • 0: Success.

    • Non-zero: Failure (e.g., manifest parsing error, template error, build command failure).