Menu ▾ ▴

#111 feat(cli): add protected environment editing

closed
nobody
None
2026-10-07
2026-10-05
Anonymous
No

Originally created by: thomijasir

Summary

Changing several secrets currently takes individual commands or a manually managed export/edit/import workflow. Add dopbase env edit <ENVIRONMENT_REF> to edit an environment as .env text, validate it, preview changed key names, and save after confirmation. Supports --editor and --dry-run.

  • Check the environment and secret metadata before password confirmation; offer to add secrets when it is empty. Existing sessions always confirm plaintext access, while a fresh login avoids a second password prompt.
  • Use protected editor profiles, private files, isolated child environments, and cleanup before submitting the save. Show progress while checking and saving. Preserve comments and ordering across CLI and UI sessions.
  • Export values, layout, and revision from one snapshot; reject concurrent changes during preview and apply through the existing atomic import.
  • Show project/environment in a single environment-list column, including the list after cloning.

Closes [#109].

Compatibility

  • Export responses add revision and envLayout. The editor requires a server that supports these fields and fails safely against older servers. No database migration is needed.
  • Initial editor support is for interactive Linux/macOS terminals and human accounts. Custom editor commands require acknowledgement. Editors receive plaintext, and comments remain unencrypted metadata; the documented security limits apply.
  • Human environment listings now use one ENVIRONMENT column. JSON output keeps its existing shape.

Verification

  • cargo test --manifest-path app/Cargo.toml --locked --all-features --test cli commands::environment -- --test-threads=4 — 18 passed.
  • cargo test --manifest-path app/Cargo.toml --locked --all-targets --all-features --quiet -- --test-threads=4 — 290 passed, one Docker-dependent test ignored. Docker was unavailable; integration tests used temporary local SQLite and HTTP fixtures.
  • bun run test:ui — 213 passed.
  • bun run typecheck:ui, bun run lint:ui, and Rust Clippy with -D warnings — passed.
  • Rust formatting, Prettier checks for changed Markdown/TypeScript files, bun run test:docs, and git diff --check — passed.
  • codegraph sync — up to date.

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.md when public behavior changed, or explained why they are not needed.
  • [x] I updated relevant documentation inside /docs.

Related

Tickets: #109

Discussion

  • Anonymous

    Anonymous - 2026-10-05

    Ticket changed by: dopbase

    • status: open --> closed
     

Log in to post a comment.