Skip to content

Command ​

CLI command utilities to compose command trees, parse options/arguments, render help, and execute handlers.

How to import? ​

The library exposes the DServerCommand and SC namespaces from the main entry or via direct import (tree-shaking friendly).

typescript
import { DServerCommand, SC } from "@duplojs/server-utils";
import * as DServerCommand from "@duplojs/server-utils/command";
import * as SC from "@duplojs/server-utils/command";

Entrypoint ​

exec ​

creates the root command, reads process arguments, and runs the command tree.

execOptions ​

only parses options from process arguments.

Command builder ​

create ​

creates a command with optional description, options, and subjects.

createArgument ​

creates a positional argument parser used in command subjects.

Option builders ​

createBooleanOption ​

creates a flag option that returns true when present.

createOption ​

creates an option with a single parsed value.

createArrayOption ​

creates an option that parses a delimited list of values.

Released under the MIT license.