Skip to content

Conversation

@majiayu000
Copy link

Summary

This PR fixes #252

Changes

  • Created shared format package () with standardized format handling

    • Supports /// (default), /, and / formats
    • Added comprehensive tests for format parsing and validation
  • Updated policy commands to use shared format utilities

    • and now support yaml format
    • Maintained backward compatibility with existing formats
    • Added tests for yaml format and format aliases
  • Updated secret commands with standardized formats

    • : Changed from plain/p to human/h/plain/p for consistency
    • : Added format support (human, json, yaml)
    • : Added format support (human, json, yaml)
    • Updated tests to reflect new default format (human)

All commands now support the same set of format options with consistent behavior, improving user experience and enabling reliable automation.

Testing

  • All existing tests pass
  • Added comprehensive test coverage for new format functionality
  • Tested format aliases and edge cases

Generated with Claude Code

Implement unified format flag handling across policy and secret commands
to address issue spiffe#252. This change provides consistent format options
with standardized aliases across all CLI commands.

Changes:
- Created shared format package with standardized format handling
  - Supports human/h/plain/p (default), json/j, and yaml/y formats
  - Added comprehensive tests for format parsing and validation

- Updated policy commands to use shared format utilities
  - policy list and policy get now support yaml format
  - Maintained backward compatibility with existing formats
  - Added tests for yaml format and format aliases

- Updated secret commands with standardized formats
  - secret get: Changed from plain/p to human/h/plain/p for consistency
  - secret list: Added format support (human, json, yaml)
  - secret metadata get: Added format support (human, json, yaml)
  - Updated tests to reflect new default format (human)

All commands now support the same set of format options with consistent
behavior, improving user experience and enabling reliable automation.

Fixes spiffe#252

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Signed-off-by: majiayu000 <[email protected]>
@v0lkan
Copy link
Contributor

v0lkan commented Dec 31, 2025

Can we please resolve the conflicts?

Thanks for your contribution 🙏 .

…1348

Resolved conflict in app/spike/internal/cmd/policy/format.go:
- Kept the PR's implementation using shared format package
- Updated test_helper.go to work with the new simpler human output format
  (ID/Name on separate lines instead of tabwriter columns)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Standardize output format options across all CLI commands

2 participants