Home Documentation Templates Examples Showcase GitHub
Theme

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.

CommandUse it whenWhat it does
nift buildNormal developmentChecks every tracked page and rebuilds only pages affected by the current dependency state.
nift build name...You explicitly want particular pagesBuilds the named tracked pages, whether or not the ordinary incremental check considers them current.
nift build --allYou need a full rebuildBuilds every tracked page regardless of incremental state.
nift build --autoYou want continuous rebuildingRuns the incremental check every 200 ms. Press q to stop in an interactive terminal.
nift build --repairA build was interrupted or derived state is suspectReconstructs 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

CommandResult
nift status [-p]Dry-runs the incremental analysis and reports which pages need rebuilding and why, without changing output or page metadata.
nift infoShows resolved metadata for all tracked entries.
nift info name...Shows resolved metadata for the requested tracked names.
nift info --allExplicit spelling of the default all-entry metadata view.
nift info --namesLists tracked names.
nift info --trackingShows tracking state, including the tracking file and resolved paths.
nift info --watchingShows watched directories and their content-extension, template and output-extension rules.
The 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

CommandWhat 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 destinationCopies a tracked item.
nift mv source destinationMoves 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

CommandWhat it does
nift watch directory [content-ext] [template] [output-ext]Adds a watched directory, using supplied rules or project defaults.
nift unwatch directoryRemoves 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.

OptionEffect
--ext=.extChanges the default content/output extension, for example --ext=.php or --ext=.txt.
--target=platformCreates the small provider-specific files needed by a supported static-hosting target.
--handoverWrites 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
OptionEffect
noneWrites the safe sibling output name.min.ext.
-i, --in-placeExplicitly 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 commandPurposeAliases
nift aboutShows a short project description, installed version, license and website.
nift versionPrints the installed version.--version, -v
nift commandsPrints the executable's built-in command map.cmds, --help, -h
nift rmRemoves tracked items and their owned files.del
nift cpCopies a tracked item.copy
nift mvMoves 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.