Skip to main content

CLI — Nidus CLI

Nidus CLI is a command-line tool written in Rust for scaffolding, code generation, and dependency management of Delphi projects using the Nidus framework.

Download

Download the binary for your platform from the releases page.


Installation

Pre-built binary

PlatformFile
WindowsNidus-windows.exe
LinuxNidus-linux
macOSNidus-macos

Download and add to your system PATH.

Build from source

cargo install --git https://github.com/ModernDelphiWorks/Nidus-CLI

Shell tab-completion

# Bash
Nidus completions bash >> ~/.bashrc

# Zsh
Nidus completions zsh >> ~/.zshrc

# Fish
Nidus completions fish > ~/.config/fish/completions/Nidus.fish

Quick Start

# 1. Scaffold a new project
Nidus new MyApp

# 2. Install dependencies
cd MyApp
Nidus install

# 3. Generate a module
Nidus gen module User

# 4. Check project health
Nidus doctor

Commands

new — Scaffold a project

Creates the full Delphi/Nidus project structure: .dpr, AppModule.pas, src/modules/, .gitignore.

Nidus new <name> [--path <dir>] [--with-tests]
OptionDescription
--path <dir>Directory where the project will be created (default: .)
--with-testsAlso creates a test/ directory

init — Initialize in an existing project

Creates nidus.json in an existing Delphi project without touching any source files.

Nidus init [--download <url>] [--mainsrc <dir>] [--force]
OptionDescription
--download <url>Main framework git URL (default: official Nidus repo)
--mainsrc <dir>Sources directory (default: src/)
--forceOverwrite if nidus.json already exists

install — Install dependencies

Clones all dependencies listed in nidus.json, syncs .dproj search paths, and writes nidus.lock.

Nidus install
Nidus install --add <url> [--branch <branch>]
Nidus install --remove <url>
Nidus install --frozen
OptionDescription
--add <url>Register and clone a new dependency. Rolls back nidus.json if the clone fails.
--branch <branch>Branch to use with --add
--remove <url>Remove a dependency from nidus.json
--frozenFail if nidus.lock is missing or any repo diverges from the locked commit

update — Update dependencies

Fast-forwards all dependencies (or a specific one) to the latest remote commit and updates nidus.lock.

Nidus update
Nidus update --dep <url-or-name>

gen — Generate components

Generates .pas files for a Nidus module from templates.

Nidus gen <type> <name> [options]

Available types:

TypeFiles generated
moduleXxxModule.pas, XxxHandler.pas
handlerXxxHandler.pas
controllerXxxController.pas
serviceXxxService.pas
repositoryXxxRepository.pas
interfaceXxxInterface.pas
infraXxxInfra.pas
scaffoldAll of the above

Options:

OptionDescription
--path <dir>Path to the src/ folder (default: ./src)
--overwriteOverwrite existing files
--template <name>Use a custom template from ~/.Nidus/templates/<name>
--dry-runPreview files that would be generated without writing them
--interactive/-iSelect components via an interactive multi-select menu (requires TTY)

Examples:

Nidus gen module User
Nidus gen scaffold Order --dry-run
Nidus gen scaffold Payment --interactive
Nidus gen module Auth --template jwt-template

remove — Remove a module

Deletes the module directory and removes its units from the .dpr file.

Nidus remove <name>
Nidus rm <name>

sync — Sync .dproj paths

Adds src/Source sub-paths from the dependencies directory to the .dproj DCC_UnitSearchPath.

Nidus sync
Nidus add-paths

doctor — Project health check

Runs a 5-section health check and reports issues and warnings.

Nidus doctor
Nidus doctor --fix
Nidus doctor --json
SectionChecks
A. Configurationnidus.json validity, mainsrc, download URL
B. Project Structure.dpr, .dproj, src/, AppModule.pas, modules/
C. DependenciesClone status, .git/ integrity, DCC_UnitSearchPath sync
D. Module Consistency.dpr unit paths, module registration, AppModule.pas references
E. EnvironmentCustom templates count, CLI version
OptionDescription
--fixAuto-fix issues: clones missing deps (C1/C2) and syncs .dproj paths (C4)
--jsonStructured JSON output — ideal for CI/CD pipelines

deps — List dependencies

Shows all dependencies with clone status, branch, and last commit SHA/date.

Nidus deps
Nidus deps --json

outdated — Check for updates

Fetches each dependency's remote and compares with the local HEAD. Reports which repos have new commits — without modifying anything.

Nidus outdated

clean — Remove build artifacts

Removes Delphi build artifacts. Git-tracked files are never deleted.

Nidus clean              # dry-run (list only)
Nidus clean --execute # actually delete
Nidus clean --execute --yes # skip confirmation
Nidus clean --path ./MyApp
RemovedItems
Files*.dcu, *.dcp, *.bpl, *.bpi, *.drc, *.map
DirectoriesWin32/, Win64/, OSX32/, OSX64/, __history/, __recovery/

template — Manage templates

Nidus template list
Nidus template install <source>
Nidus template update [<name>]
Nidus template create <name>
Nidus template config <name> [<key> <value>]
Nidus template publish <name> <git-url>
SubcommandDescription
listList installed custom templates
install <source>Install a template from a git URL or local path
update [name]Update one or all installed templates
create <name>Create a new template scaffold
config <name>Get or set template configuration (persisted to template.json)
publish <name> <url>Push a local template to a git remote

info — Project information

Displays the CLI banner, version, and — when nidus.json is present — a project summary.

Nidus info

Generated project structure

MyApp/
├── MyApp.dpr
├── nidus.json
├── nidus.lock
├── .gitignore
└── src/
├── AppModule.pas
└── modules/
└── user/
├── UserModule.pas
├── UserHandler.pas
├── UserController.pas
├── UserService.pas
├── UserRepository.pas
├── UserInterface.pas
└── UserInfra.pas

nidus.json

{
"name": "MyApp",
"mainsrc": "src/",
"download": "https://github.com/ModernDelphiWorks/Nidus.git",
"dependencies": {
"https://github.com/HashLoad/Horse.git": "",
"https://github.com/ModernDelphiWorks/ModernSyntax.git": ""
}
}
FieldDescription
mainsrcRelative path to the sources directory
downloadMain framework repository URL
dependenciesMap of "url": "branch" (empty string = default branch)

nidus.lock

Automatically generated by install and update. Records the exact commit SHA of each cloned dependency for reproducible builds.

{
"version": "1",
"generated_at": "2026-03-28T12:00:00Z",
"dependencies": {
"https://github.com/HashLoad/Horse.git": {
"branch": "master",
"commit": "abc123...",
"locked_at": "2026-03-28T12:00:00Z"
}
}
}

Use Nidus install --frozen to enforce exact commit matching in CI/CD.