Skip to content

API Reference

Generated from docstrings, organized by area:

  • Args — Args, Cmd, Cli, Argument, ArgumentBuilder, the Arg annotation 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, and utf8_stdio.
  • Discovery — discover_commands, discover_entry_points (installed-distribution plugins), CmdBuilder, ModuleCommand, and the register_command_provider extension seam.
  • Env — duho.Env, the prefixed, app-wide environment accessor (.bool, .list, .paths).
  • Formatters — opt-in --help formatters: DefaultsFormatter (append (default: X)), ColorHelpFormatter (ANSI), and ColorDefaultsFormatter (both), selected via a class's _help_formatter_.
  • Presets — LoggingArgs, the ready-made verbosity/log-level mixin, and ConfigArgs, the --config/-c mixin.
  • Config (opt-in, import duho.config) — ConfigBackend, the JSON/TOML/YAML/INI backends, and load/loads/dump/dumps; see the configuration guide.
  • Logging — colored formatting, custom levels, and stderr setup helpers.
  • Agent help — the machine-readable --help document (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 .py files; 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.