CLI
The pixie command line (the CLI of the netboot library; PXE is
pronounced "pixie") is built on duho: it
discovers commands, layers YAML config, then runs the selected command against a
single Pixie engine built from that config.
# Initiate the PXE process for a target (render artifacts + arm DHCP):
pixie initiate my-host
# Complete it (post-boot cleanup, disarm DHCP):
pixie complete my-host
A target argument is resolved by exact id, or by hostname prefix / MAC / IP.
Global options
| Option | Purpose |
|---|---|
-c, --config PATH |
Explicit config file (yaml/cfg); overrides discovery |
--baseconfig DIR |
Base config directory to search (default ./config) |
-l, --load-module M |
Import module(s) before building netboot (config/hook deps) |
--cmdspath PATH |
Extra directories/packages to search for commands |
-v / -q |
Increase / decrease log verbosity (from duho's LoggingArgs) |
Commands
initiate <target> [--iscsi]
Look up the target, build its render context, produce the netboot artifacts and
arm every DHCP backend in the target's zone. --iscsi prepares the target as an
iSCSI LUN.
complete <target>
Run post-boot cleanup for the target and disarm its DHCP backends.
Adding your own commands
Point --cmdspath (or the PIXIE_CMDS_PATH environment variable) at a package or
directory of command modules. A netboot command module exposes:
def register(parser, args): # optional: add argparse arguments
...
def run(netboot, args, conf): # required: the command body
...
A module that instead follows duho's plain run(args) contract is dispatched by
duho directly, so ordinary duho commands work too.
Both sources add to the built-in commands rather than replacing them. On a name
clash the more specific source wins: PIXIE_CMDS_PATH over --cmdspath, and
either over a built-in.
Environment
App settings are read through duho.env.Env("pixie"), so they live under the
PIXIE_ prefix:
PIXIE_CMDS_PATH— extra command sources,os.pathsep-separated (see above).- A
pixie_envPython module importable at startup (e.g. apixie_env.pyin the working directory) may ship settings asUPPER_CASEmodule variables. Precedence runs explicitenvvalues (kwargs or runtime writes) > realPIXIE_*environment variables >pixie_envmodule defaults, so an exported variable always beats a shipped default.
Commands receive the resolved accessor as args._env_, so a custom command can
read its own PIXIE_<KEY> settings without touching os.environ.