Skip to content

Add 'vars' command to inspect structure variables#140

Merged
httpdss merged 2 commits intomainfrom
codex/implement-feature-from-issue-135
May 9, 2026
Merged

Add 'vars' command to inspect structure variables#140
httpdss merged 2 commits intomainfrom
codex/implement-feature-from-issue-135

Conversation

@httpdss
Copy link
Copy Markdown
Owner

@httpdss httpdss commented May 8, 2026

Motivation

  • Provide a way to inspect the input variables declared by a structure definition before running generate so users and CI can see required inputs without creating files.
  • Support the same resolution rules as generate (built-in contribs, custom --structures-path, and local YAML files) and offer machine-readable output for automation.

Description

  • Add a new VarsCommand in structkit/commands/vars.py that loads a structure YAML, normalizes variables, and prints either aligned text or JSON via --json.
  • Implement robust structure resolution and error handling for missing files, invalid YAML, and malformed variables entries, exiting non-zero on failure.
  • Register the vars subcommand in structkit/main.py and add tests in tests/test_commands.py covering text output, JSON output, no-variables, custom --structures-path, and invalid-config failure.
  • Document the command and examples in docs/cli-reference.md and docs/usage.md.

Testing

  • Ran the full test suite with pytest -q and observed all tests passing (159 passed).
  • Ran the focused command tests with pytest tests/test_commands.py -q and observed them passing (20 passed).
  • Verified the CLI invocation python -m structkit.main vars structkit/contribs/github/workflows/run-struct.yaml --json returns the expected JSON output.

Codex Task

@httpdss
Copy link
Copy Markdown
Owner Author

httpdss commented May 9, 2026

@codex, please review

@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@httpdss
Copy link
Copy Markdown
Owner Author

httpdss commented May 9, 2026

@codex, please review

@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@httpdss httpdss marked this pull request as ready for review May 9, 2026 11:41
@httpdss httpdss merged commit 603285f into main May 9, 2026
3 checks passed
@httpdss httpdss deleted the codex/implement-feature-from-issue-135 branch May 9, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant