Skip to content

feat: add --hide-secrets flag to redact env var values#32

Open
JoshSalway wants to merge 1 commit intolaravel:mainfrom
JoshSalway:feature/hide-secrets-flag
Open

feat: add --hide-secrets flag to redact env var values#32
JoshSalway wants to merge 1 commit intolaravel:mainfrom
JoshSalway:feature/hide-secrets-flag

Conversation

@JoshSalway
Copy link

Summary

  • Adds a --hide-secrets global option to BaseCommand so it is available on all commands
  • When passed, environment variable values (arrays with key/value structure) are replaced with ******** in JSON output
  • Keys remain visible; only values are redacted
  • Opt-in only — default behaviour is unchanged

Closes #26

Test plan

  • Unit tests added for redactSecrets() covering nested structures, edge cases, and non-env-var data
  • All 33 tests pass (31 existing + 2 new)
  • Manual: cloud environment:get <env> --no-interaction --hide-secrets should show ******** for env var values
  • Manual: same command without --hide-secrets should show real values (no regression)

🤖 Generated with Claude Code

When passed, the --hide-secrets flag replaces environment variable
values with '********' in JSON output. Keys remain visible. This is
opt-in and does not change default behaviour.

Closes laravel#26

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JoshSalway JoshSalway changed the title Add --hide-secrets flag to redact env var values feat: add --hide-secrets flag to redact env var values Mar 16, 2026
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.

Feature: --hide-secrets flag to redact environment variable values in output

1 participant