#42 feat(cli): support JSON and YAML secret files
Originally created by: thomijasir
Summary
Add dotenv, JSON, and YAML support to secret initialization, import, and export. The CLI infers formats from filenames, accepts explicit --format overrides, reads init and import data from stdin, and validates JSON and YAML as flat string mappings without exposing secret values.
The change keeps import previews, expected revisions, export password confirmation, overwrite protection, private file permissions, and server schemas unchanged. Public CLI documentation now covers the new formats and notes that the Admin UI remains dotenv-only.
Closes [#18]
Compatibility
Existing dotenv commands remain compatible. Unknown extensions, including .env.production, still default to dotenv. Stdout export still defaults to dotenv, and global --json remains separate from secret serialization.
No migration is required. The changelog is intentionally left for the next release preparation commit, following the current release workflow.
Verification
cargo fmt --manifest-path app/Cargo.toml -- --checkcargo clippy --manifest-path app/Cargo.toml --locked --all-targets --all-features -- -D warningscargo test --manifest-path app/Cargo.toml --locked --all-targets --all-featuresbun run docs:buildcodegraph sync
Checklist
- [x] I kept this pull request focused on one problem.
- [x] I added or updated tests for behavior changes, or explained why tests are not needed.
- [x] I updated the documentation and
CHANGELOG.mdwhen public behavior changed, or explained why they are not needed. - [x] I updated relevan documentation inside
/docs
Ticket changed by: dopbase