API Reference
Generated from docstrings, organized by area:
- Args —
Args,Cmd,Cli,Argument,ArgumentBuilder, theArgannotation helper,Meta(the typed, typo-safe metadata form), the argument factories (Count,Append,Const,Choice,Extend),UpdateAction, and the module-level entry points (parser,parse,parse_globals,main,finish_parse,command,subcommand,value_sources,print_agent_help,print_completion). - Runtime —
duho.app, the multi-command app runner (discovery, config/env thread-down, and dispatch),run_command, andutf8_stdio. - Discovery —
discover_commands,discover_entry_points(installed-distribution plugins),CmdBuilder,ModuleCommand, and theregister_command_providerextension seam. - Env —
duho.Env, the prefixed, app-wide environment accessor (.bool,.list,.paths). - Formatters — opt-in
--helpformatters:DefaultsFormatter(append(default: X)),ColorHelpFormatter(ANSI), andColorDefaultsFormatter(both), selected via a class's_help_formatter_. - Presets —
LoggingArgs, the ready-made verbosity/log-level mixin, andConfigArgs, the--config/-cmixin. - Config (opt-in,
import duho.config) —ConfigBackend, the JSON/TOML/YAML/INI backends, andload/loads/dump/dumps; see the configuration guide. - Logging — colored formatting, custom levels, and stderr setup helpers.
- Agent help — the machine-readable
--helpdocument (AGENT_HELP/--help-agents,describe,print_agent_help). - Completion — bash/zsh/fish/PowerShell completion-script generation.
- Text —
expand,pysafe,snakecase/camelcase/kebabcase,parse_bool,gettext. - QualName — dotted-name algebra for command qualnames.
- Fanout (opt-in,
import duho.fanout) — run one command against many targets and roll their exit codes into one. - RunPath (opt-in,
import duho.runpath) — ordered step commands from a directory of numbered.pyfiles; see the RunPath guide. - Scaffold (opt-in,
import duho.scaffold) — generate a run-from-checkout launcher pair for an app. - Testing (opt-in,
import duho.testing) —invoke, run a command line in-process and get its status and output; see the testing guide. - MCP (opt-in,
import duho.mcp) — expose a duho CLI as MCP tools. - Parsers — subparser utilities and helper functions.