-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
developer experienceenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomersuser experience
Description
Output format options are inconsistent across SPIKE CLI commands. Different commands support different format names, aliases, and some commands ignore the format parameter entirely. All commands that produce output should support a unified set of format options.
Current Behavior
Policy commands:
- Formats: json, human
Secret commands:
- Formats: plain, yaml, json, y, p, j
Other commands:
- Some ignore the --format flag entirely
This inconsistency creates confusion:
- --format plain works for secrets but not policies
- --format human works for policies but not secrets
- --format yaml works for secrets but not policies
- Some commands silently ignore the format parameter
Proposed Behavior
Standardize on three formats with consistent aliases across ALL commands:
| Format | Aliases | Description |
|---|---|---|
| human | h, plain, p | Human-readable, friendly output (default) |
| json | j | Valid JSON output (for scripting/parsing) |
| yaml | y | Valid YAML output (for scripting/parsing) |
Examples
# All equivalent - human readable
spike secret list --format human
spike secret list --format h
spike secret list --format plain
spike secret list --format p
# All equivalent - JSON
spike policy list --format json
spike policy list --format j
# All equivalent - YAML
spike secret get db/creds --format yaml
spike secret get db/creds --format y
Scope
Every command that produces output (except error messages) should honor the format parameter:
- spike secret list
- spike secret get
- spike secret metadata get
- spike policy list
- spike policy get
- spike operator recover
- spike operator restore
- spike cipher encrypt (for metadata output)
- spike cipher decrypt
Rationale
- Consistency: Users should not need to remember which formats work with which commands
- Scriptability: Predictable JSON/YAML output enables reliable automation
- Discoverability: Fewer format names to document and learn
- Backward compatibility: Keeping plain/p as aliases for human/h preserves existing scripts
Implementation Notes
- Create a shared format parsing function in app/spike/internal/cmd/
- Default to human when --format is not specified
- Ensure structured formats (json, yaml) produce valid, parseable output
Metadata
Metadata
Assignees
Labels
developer experienceenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomersuser experience