Skip to content

CLI

Commands

# Authenticate
daimyo login              # OAuth2 PKCE browser flow
daimyo login --device     # Device authorization flow (headless / CI)
daimyo logout             # Clear stored tokens

# List all available scopes
daimyo list-scopes

# Show details of a specific scope
daimyo show python-general

# View template context for debugging
daimyo context python-general
daimyo context python-general --category python.testing
daimyo context python-general --format json
daimyo context python-general --sources

# Query rules and katas (same data as MCP tools, markdown output)
daimyo get-category-index python-general
daimyo get-rules python-general --categories python.testing,python.web
daimyo get-kata-category-index python-general
daimyo get-katas python-general
daimyo get-kata TDD-cycle --scope python-general

# Query Tenka (User Stories and ACs)
daimyo get-user-stories python-general
daimyo get-acceptance-criteria python-general --stories US123
daimyo get-validation-status python-general
daimyo get-tenka-history python-general

# Manage Tenka Fulfillment
daimyo tenka import-results python-general path/to/report.xml
daimyo tenka validate-ac python-general AC101.1 "Manual check passed" --pass

# Authenticate
daimyo login
daimyo login --device
daimyo logout

# Check for updates
daimyo check-updates

# Version information
daimyo --version

Authentication Commands

daimyo login

Authenticate with daimyo using OAuth2/OIDC. Requires oidc_issuer_url and oidc_client_id to be configured.

daimyo login           # PKCE browser flow (default)
daimyo login --device  # Device authorization flow for headless environments

Options:

  • --device: Use the RFC 8628 device authorization flow instead of opening a browser. Prints a verification URL and device code; the user authenticates on any browser and the CLI polls until complete.

On success, tokens are stored in the configured backend (keyring by default) and reused automatically for subsequent commands.

daimyo logout

Remove all stored tokens from the configured backend.

daimyo logout

If no tokens are stored, the command exits cleanly without error.

Tip

See Authentication for full setup instructions, token storage options, and scope access control.

Template Context Command

The context command displays the Jinja2 template context available when rendering rules for a scope. This is useful for debugging template issues and understanding what variables are available in templates.

Basic usage:

daimyo context <scope_name>

Options:

  • --category, -c: Show context for a specific category (includes category key and when description)
  • --format, -f: Output format - yaml (default), json, or table
  • --sources, -s: Annotate each variable with its source (config, scope, category, or plugins)

Examples:

# View context in YAML format (default)
daimyo context python-general

# View context for a specific category
daimyo context python-general --category python.testing

# JSON format for programmatic use
daimyo context python-general --format json

# Table format for quick scanning
daimyo context python-general --format table

# Show variable sources
daimyo context python-general --sources

Output includes:

  • Configuration variables: All DAIMYO_* settings from environment or config files
  • Scope metadata: name, description, tags, sources
  • Category info: key and when description (if --category specified)
  • Plugin context: Variables provided by enabled plugins
  • Plugin metadata: Available Jinja2 filters and tests from plugins

Query Commands

These commands expose the same data as the MCP tools, outputting markdown to stdout. Log messages go only to the log files, keeping stdout clean for piping and scripting.

When SCOPE_NAME is omitted, all query commands fall back to the DEFAULT_SCOPE setting.

daimyo get-category-index

Prints a hierarchical index of all rule categories in a scope with their descriptions. Use this to decide which categories to pass to get-rules.

daimyo get-category-index python-general
daimyo get-category-index          # uses DEFAULT_SCOPE

daimyo get-rules

Prints all rules for a scope in markdown format with MUST/SHOULD markers.

daimyo get-rules python-general
daimyo get-rules python-general --categories python.testing,python.web
daimyo get-rules                   # uses DEFAULT_SCOPE

Options:

  • --categories, -c TEXT: Comma-separated category filters. Including a parent category also pulls in all its subcategories.

daimyo get-kata-category-index

Prints a hierarchical index of all categories that contain katas.

daimyo get-kata-category-index python-general

daimyo get-katas

Lists available kata names organised by category, optionally filtered.

daimyo get-katas python-general
daimyo get-katas python-general --categories python.testing

Options:

  • --categories, -c TEXT: Comma-separated category filters.

daimyo get-kata

Prints the procedure for a specific kata.

daimyo get-kata TDD-cycle --scope python-general
daimyo get-kata TDD-cycle --scope python-general --category python.testing
daimyo get-kata TDD-cycle          # uses DEFAULT_SCOPE

Options:

  • --scope, -s TEXT: Scope to retrieve the kata from (uses DEFAULT_SCOPE if omitted).
  • --category, -c TEXT: Category key to disambiguate when the same kata name exists in multiple categories.

daimyo get-user-stories

Lists user stories for a scope.

daimyo get-user-stories python-general
daimyo get-user-stories --status not_validated
daimyo get-user-stories --tags Functional,Technical

Options:

  • --status TEXT: Filter by validation status: validated, not_validated, or all (default).
  • --include-inactive: Include deactivated user stories.
  • --tags, -t TEXT: Comma-separated tags to filter by (at-least-one-match).

daimyo get-acceptance-criteria

Lists acceptance criteria for a scope.

daimyo get-acceptance-criteria python-general
daimyo get-acceptance-criteria --stories US123,US456
daimyo get-acceptance-criteria --tags "OWASP A03:2021"

Options:

  • --stories TEXT: Comma-separated user story IDs to filter by.
  • --status TEXT: Filter by validation status.
  • --include-inactive: Include deactivated ACs and stories.
  • --tags, -t TEXT: Comma-separated tags to filter by (at-least-one-match).

daimyo get-validation-status

Displays the validation status of acceptance criteria.

daimyo get-validation-status python-general
daimyo get-validation-status --passing not_validated --automation automated

Options:

  • --acs TEXT: Comma-separated AC reference IDs to filter by.
  • --passing TEXT: Filter by passing status: validated, not_validated, or all.
  • --automation TEXT: Filter by automation coverage: automated, has_manual, or all.

daimyo get-tenka-history

Prints the requirement change history for a scope.

daimyo get-tenka-history python-general
daimyo get-tenka-history --since 2024-05-01
daimyo get-tenka-history --since-last-commit

Options:

  • --since DATE: ISO 8601 date/datetime filter.
  • --since-last-fulfillment: Only show changes since the latest fulfillment entry.
  • --since-last-commit: Only show changes since the last git commit to the tenka file.

daimyo tenka import-results

Import automated test results into the tenka fulfillment file. Test cases are linked to ACs via __ACn_m fragments in the test name (e.g. test_login__AC1_2).

daimyo tenka import-results python-general path/to/report.xml

Arguments:

  • SCOPE_NAME: Target scope name.
  • REPORT: Path to the jUnit/xUnit/nUnit XML report file.

daimyo tenka validate-ac

Record a manual validation verdict for an acceptance criterion.

daimyo tenka validate-ac python-general AC101.1 "Manual check passed" --pass

Arguments:

  • SCOPE_NAME: Target scope name.
  • AC_REF: AC reference (e.g. AC1.2).
  • VERDICT: Human-readable description of what was verified.

Options:

  • --pass / --no-pass: (Required) Whether the AC passed.

Tip

Pipe any query command into a pager or file for easy review:

daimyo get-rules python-general | less
daimyo get-category-index python-general > categories.md

Global Options

All CLI commands support global configuration options that must be specified before the command:

# Override configuration file
daimyo --config /custom/config.toml list-scopes
daimyo -c ~/.daimyo/config/settings.toml serve

# Override rules directory
daimyo --rules-path /custom/rules show my-scope
daimyo -r ~/rules list-scopes

# Override both
daimyo --config /custom/config.toml --rules-path /custom/rules mcp
daimyo -c /custom/config.toml -r /custom/rules serve

Available global options:

  • --config PATH / -c PATH: Path to configuration file
  • --rules-path PATH / -r PATH: Path to rules directory
  • --version / -v: Show version and exit

Warning

These are global options and must appear before the command name.

  • Correct: daimyo --config myconfig.toml serve
  • Wrong: daimyo serve --config myconfig.toml