Released v1

This commit is contained in:
Steve Cliff
2026-02-12 10:37:19 +00:00
commit b07572fed5
77 changed files with 19518 additions and 0 deletions
@@ -0,0 +1,22 @@
## MODIFIED Requirements
### Requirement: Root command and global flags
The system SHALL provide a root command `pcli` that serves as the entry point. The root command SHALL register global flags: `--format` (string, default `json`, values `json` or `table`), `--url` (string, overrides `PLANKA_URL`), `--api-key` (string, overrides `PLANKA_API_KEY`), and `--log-level` (string, default `warn`, values `debug`, `info`, `warn`, `error`). The root command SHALL initialize the logger based on `--log-level` and configure it to write structured JSON to stderr. The root command SHALL validate that URL and API key are available (from flags or environment) before executing any subcommand.
#### Scenario: Display help
- **WHEN** `pcli` is run with no arguments or `--help`
- **THEN** the system SHALL display usage information listing all resource subcommands and global flags
#### Scenario: Invalid format flag
- **WHEN** `--format` is set to an unsupported value
- **THEN** the system SHALL print an error and exit with code 1
#### Scenario: Log level controls output
- **WHEN** `--log-level=debug` is set
- **THEN** DEBUG-level log entries SHALL appear on stderr
- **AND** stdout SHALL contain only the command's data output
#### Scenario: Missing API key
- **WHEN** neither `PLANKA_API_KEY` environment variable nor `--api-key` flag is provided
- **THEN** the system SHALL print an error indicating `PLANKA_API_KEY` must be set via `--api-key` flag or `PLANKA_API_KEY` environment variable
- **AND** the system SHALL exit with code 1