CLI reference · source audited
CLI commands.
Nift has a deliberately compact command surface. Start with the complete map below, then use the grouped tables to compare modes and options without hunting through separate descriptions.
Complete command map
# Build
nift build [names...] [-p]
nift build --all [-p]
nift build --auto
nift build --repair [-p]
# Inspect
nift status [-p]
nift info [names...]
nift info --all
nift info --names
nift info --tracking
nift info --watching
# Track and manage pages
nift track name [title] [template]
nift untrack name...
nift rm name...
nift cp source destination
nift mv source destination
nift watch directory [content-ext] [template] [output-ext]
nift unwatch directory
# Create a project
nift init [--target=platform] [--ext=.ext] [--handover]
# Minify files, with or without a Nift project
nift minify [-i|--in-place] file...
# General
nift about
nift version
nift commands Build
These are four mutually exclusive build modes. Positional names, --all, --auto and --repair cannot be combined in one invocation.
| Command | Use it when | What it does |
|---|---|---|
nift build | Normal development | Checks every tracked page and rebuilds only pages affected by the current dependency state. |
nift build name... | You explicitly want particular pages | Builds the named tracked pages, whether or not the ordinary incremental check considers them current. |
nift build --all | You need a full rebuild | Builds every tracked page regardless of incremental state. |
nift build --auto | You want continuous rebuilding | Runs the incremental check every 200 ms. Press q to stop in an interactive terminal. |
nift build --repair | A build was interrupted or derived state is suspect | Reconstructs derived build state and clears a stale .unfinished condition. It refuses to take over a build owned by a live process. |
nift build
nift build about docs/getting-started
nift build --all
nift build --repair
nift build --auto -p can be added to ordinary, named, --all and --repair builds for full per-page detail instead of compact summaries. It is also accepted by status.
build --auto keeps the terminal quiet.The latest meaningful build output is stored in .nift/build-auto.log without terminal colour codes. The file is rewritten only when that output changes. In non-interactive use, stop the process from the surrounding shell or service.
Inspect project state
| Command | Result |
|---|---|
nift status [-p] | Dry-runs the incremental analysis and reports which pages need rebuilding and why, without changing output or page metadata. |
nift info | Shows resolved metadata for all tracked entries. |
nift info name... | Shows resolved metadata for the requested tracked names. |
nift info --all | Explicit spelling of the default all-entry metadata view. |
nift info --names | Lists tracked names. |
nift info --tracking | Shows tracking state, including the tracking file and resolved paths. |
nift info --watching | Shows watched directories and their content-extension, template and output-extension rules. |
info commands are script-friendly.Interactive terminals receive headings and syntax colouring. Redirected or piped output is plain valid JSON suitable for tools such as jq.
Track and manage pages
| Command | What it changes |
|---|---|
nift track name [title] [template] | Adds a tracked item. The title defaults to the final name component and the template defaults to default-template. |
nift untrack name... | Stops tracking items without deleting their content files. |
nift rm name... | Removes tracking plus the corresponding content and generated output. |
nift cp source destination | Copies a tracked item. |
nift mv source destination | Moves a tracked item. |
Tracked and destination names cannot escape through a .. path component. del, copy and move are accepted aliases for rm, cp and mv.
Watch directories
| Command | What it does |
|---|---|
nift watch directory [content-ext] [template] [output-ext] | Adds a watched directory, using supplied rules or project defaults. |
nift unwatch directory | Removes one watched directory. |
Initialise a project
nift init [--target=platform] [--ext=.ext] [--handover] creates a project. With no options, it creates the standard HTML starter. Compatible named options are order-independent.
| Option | Effect |
|---|---|
--ext=.ext | Changes the default content/output extension, for example --ext=.php or --ext=.txt. |
--target=platform | Creates the small provider-specific files needed by a supported static-hosting target. |
--handover | Writes the canonical HANDOVER.md in the project root for human- and AI-directed development. |
nift init
nift init --ext=.php
nift init --target=vercel
nift init --target=cloudflare --ext=.htm
nift init --handover Supported targets are vercel, netlify, amplify, azure, firebase, render, cloudflare, github-pages and supabase. Target presets accept .html and .htm; runtime extensions such as .php are rejected. Supabase keeps the ordinary public/ output because it provides backend services rather than a special frontend artifact.
The target list is not a hosting allow-list. For another platform, initialise a normal project and configure the provider manually. The removed positional form nift init .html is not accepted; use --ext=.html. See Platform targets for generated files and output layouts.
Minify arbitrary files
nift minify [-i|--in-place] file... works inside or outside a Nift project. By default it leaves each source untouched and writes a sibling name.min.ext file.
nift minify public/index.html
# public/index.html -> public/index.min.html
nift minify assets/app.js assets/site.css
# assets/app.min.js + assets/site.min.css
nift minify --in-place generated/app.js
nift minify -i generated/site.css | Option | Effect |
|---|---|
| none | Writes the safe sibling output name.min.ext. |
-i, --in-place | Explicitly overwrites each source file. |
Supported extensions are HTML/HTM, CSS, JS/MJS/CJS, JSX, JSON, XML and SVG. At least one file is required. Unsupported, missing, malformed or unwritable files produce a non-zero status; other valid arguments in the invocation are still processed. Minification details →
General and aliases
| Canonical command | Purpose | Aliases |
|---|---|---|
nift about | Shows a short project description, installed version, license and website. | — |
nift version | Prints the installed version. | --version, -v |
nift commands | Prints the executable's built-in command map. | cmds, --help, -h |
nift rm | Removes tracked items and their owned files. | del |
nift cp | Copies a tracked item. | copy |
nift mv | Moves a tracked item. | move |
Removed spellings
build-all, build-updated, build-names, build-auto, info-all, info-watching, info-tracking and info-names are not aliases. They fail with a non-zero status and point to the unified replacement, such as nift build --all.
Commands reject unexpected arguments and unknown options instead of silently ignoring them. Run nift commands for the executable's concise built-in reminder.