Tutorial

Getting Started with Netsuke

This guide will walk you through installing Netsuke, creating your first build manifest, and running your first successful build.

01. Prerequisites

Before we begin, ensure you have the following installed on your system:

  • macOS, Linux, or Windows (PowerShell natively, or WSL2)
  • Rust toolchain (optional, for building from source)
  • Basic familiarity with terminal commands
Note: Netsuke relies on ninja for the execution phase. Make sure it is installed and available on your PATH.

02. Install Netsuke

Install Netsuke in the way that fits the machine. The reviewed docs only require the CLI binary and a working Ninja installation.

$ cargo install netsuke-build
The crate is published as netsuke-build; the installed binary is named netsuke

03. Create a Manifest

Netsuke uses a file named Netsukefile to define build targets. Let's create a minimal project structure.

1. Create Project Directory

macOS, Linux, or WSL2

$ mkdir my-first-build && cd my-first-build
$ touch Netsukefile

Windows PowerShell

mkdir my-first-build; cd my-first-build
New-Item Netsukefile -ItemType File

This creates a clean workspace. The Netsukefile is where the build graph is declared. Windows PowerShell 5.1 has no && operator, so the two commands are separated by a semicolon.

2. Define a Simple Rule

Netsukefile
netsuke_version: "1.0.0"

targets:
  - name: "hello.txt"
    command: "printf 'Hello, Netsuke!\n' > {{ outs }}"

  - name: "shout.txt"
    command: "tr 'a-z' 'A-Z' < {{ ins }} > {{ outs }}"
    sources: "hello.txt"

defaults: ["shout.txt"]

04. Run the Build

Now invoke the CLI to build your target. Netsuke parses YAML first, resolves any templating, generates a Ninja plan, and then executes the required commands.

Terminal
$ netsuke build shout.txt
[1/2] printf 'Hello, Netsuke!\n' > hello.txt
[2/2] tr 'a-z' 'A-Z' < hello.txt > shout.txt
$ cat shout.txt
HELLO, NETSUKE!

What just happened?

You asked to build shout.txt. Netsuke saw that shout.txt depends on hello.txt. It built hello.txt first, verified the output, and then fed that output into the shout.txt rule.

Next Steps