You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/prompts/dev.implement-cli-args-parsing.prompt.md
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,7 @@ Use it for context and evaluate each CLI against the CLI Contract Baseline:
77
77
- Support repeatable flags for multiple values and document ordering, de-duplication, and limits.
78
78
- Reject unknown flags and surplus positional arguments with exit code `2`.
79
79
- Follow standard conventions for `-h/--help`, `-v/--version`, `--verbose`, and `--quiet`. These are must-have arguments for every CLI.
80
+
- Support env var equivalents for CLI flags (for example `LOG_FILE` for `--log-file`), with precedence: CLI flags > env vars > config file > defaults.
80
81
- Provide `--yes` or `--no-input` for non-interactive operation and make prompts opt-in.
81
82
82
83
### Modern parser defaults 🧱
@@ -124,13 +125,18 @@ Use it for context and evaluate each CLI against the CLI Contract Baseline:
124
125
- Offer `--dry-run` when the command mutates resources.
125
126
- Keep interactive prompts opt-in and always provide a non-interactive equivalent.
126
127
128
+
### Logging output controls 🧾
129
+
130
+
- Default to no logging output unless explicitly enabled.
131
+
- Provide options for structured log file (`--log-json-file`), human-readable log file (`--log-file`), console logging (`--log-console`), and pretty/colour console output (`--log-console-pretty`).
132
+
- Console logs must go to stderr and never mix with stdout payloads.
133
+
127
134
### Logging verbosity controls 🔊
128
135
129
136
-`--verbose` raises verbosity one step; allow `-v`, `-vv`, `-vvv` to increment levels (for example INFO → DEBUG → TRACE).
130
137
-`--quiet` lowers verbosity one step; allow `-q`, `-qq` similarly.
131
138
- Document the exact mapping from flags to log levels in `--help`.
132
139
- Provide `--log-level <level>` for explicit control; flags are convenience.
133
-
- Support an environment variable for verbosity (for example `LOG_LEVEL` or `VERBOSITY`), with precedence: CLI flags > env vars > config file > defaults.
134
140
- Keep diagnostics on `stderr` and keep outputs deterministic.
135
141
136
142
### Wrappers and shared libraries 📦
@@ -170,12 +176,13 @@ Use it for context and evaluate each CLI against the CLI Contract Baseline:
Copy file name to clipboardExpand all lines: .github/prompts/dev.implement-logging.prompt.md
+19-1Lines changed: 19 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,6 +74,21 @@ Use it for context and evaluate each runtime that emits structured logs against
74
74
-**Timing information**: log duration for slow or critical operations (or emit metrics instead).
75
75
-**Avoid noise**: do not add "started/finished" logs to trivial or idempotent methods.
76
76
77
+
### Output destinations and defaults 🎯
78
+
79
+
-**No logs by default**: logging output is disabled unless explicitly enabled by configuration or CLI flags.
80
+
-**Structured log file option**: provide a CLI argument or configuration option for the structured log file name/path (for example `--log-json-file` or `LOG_JSON_FILE`). When set, emit structured logs in NDJSON.
81
+
-**Human-readable log file option**: provide a CLI argument or configuration option for the human-readable log file name/path (for example `--log-file` or `LOG_FILE`). When set, emit human-readable logs.
82
+
-**Console logging toggle**: provide a CLI argument or configuration option to enable logging to the console (for example `--log-console` or `LOG_CONSOLE=true`).
83
+
-**Pretty/colour console toggle**: provide a CLI argument or configuration option for pretty, colourised console output (for example `--log-console-pretty` or `LOG_CONSOLE_PRETTY=true`).
84
+
-**Separate streams**: console logs must go to stderr and never mix with stdout payloads.
85
+
86
+
### Logging verbosity controls 🔊
87
+
88
+
- Provide `--log-level <level>` for explicit control.
89
+
- Support verbosity flags (`--verbose` with `-v`, `-vv`, `-vvv`, and `--quiet` with `-q`, `-qq`) and document the mapping in `--help`.
90
+
- Support an environment variable for verbosity (for example `LOG_LEVEL`) with precedence: CLI flags > env vars > config file > defaults.
91
+
77
92
### Log levels 🎚️
78
93
79
94
| Level | Purpose |
@@ -102,6 +117,7 @@ Flag any misuse (e.g., logging an error condition at INFO).
102
117
-**No-colour mode**: auto-disable colour when stdout is not a TTY; honour `NO_COLOR` or similar environment variables.
103
118
-**Level tags and icons**: use short, consistent tags (INFO, WARN, ERROR) with an optional single icon per level.
104
119
-**Bounded output**: truncate or wrap large fields; never allow unbounded blobs to break layout.
120
+
-**Stdout separation**: console logs must never be written to stdout; keep stdout for primary results only.
105
121
106
122
### Performance ⚡
107
123
@@ -120,12 +136,14 @@ Flag any misuse (e.g., logging an error condition at INFO).
0 commit comments