### Add nested projects note to README Source: https://github.com/anguriatech/envy/blob/master/specs/014-nested-projects/quickstart.md Add this markdown note to the Quickstart section, including the directory tree example. ```markdown #### Nested projects (monorepo / multi-project support) Since v0.3.2, `envy init` works in subdirectories of existing envy projects. Each project gets its own UUID in the vault and its own `envy.toml` + `envy.enc`. Commands resolve the closest `envy.toml` automatically — running `envy list` from a child directory shows the child's secrets, not the parent's. /monorepo/ envy.toml ← org-wide credentials (UUID: a1b2c3d4) envy.enc /project-a/ envy init ← project-specific credentials (UUID: e5f6a7b8) envy.toml envy.enc /project-b/ envy init ← different UUID again envy.toml envy.enc ``` -------------------------------- ### Install dependencies on Ubuntu/Debian Source: https://github.com/anguriatech/envy/blob/master/CONTRIBUTING.md Install the OS keyring backend required by the `keyring` crate, the Rust stable toolchain, and optionally the `cargo-audit` vulnerability scanner. ```bash sudo apt-get install -y libsecret-1-dev pkg-config # Rust stable toolchain curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh rustup default stable # Optional: security vulnerability scanner cargo install cargo-audit ``` -------------------------------- ### Initialize and set environment variables Source: https://github.com/anguriatech/envy/blob/master/specs/006-cli-sync-commands/quickstart.md Prerequisite setup for Phase 1: initializes envy.toml and sets secrets for development and production environments. ```bash cd my-project/ envy init # creates envy.toml envy set STRIPE_KEY=sk_test_abc envy set DATABASE_URL=postgres://dev -e development envy set STRIPE_KEY=sk_live_xyz -e production ``` -------------------------------- ### Check current branch Source: https://github.com/anguriatech/envy/blob/master/specs/014-nested-projects/quickstart.md Run this command to verify you are on the 014-nested-projects branch before starting. ```bash git branch --show-current ``` -------------------------------- ### Backward compatibility without --format Source: https://github.com/anguriatech/envy/blob/master/specs/008-output-formats/quickstart.md Verifies that commands without `--format` behave identically to before the feature. Shows `envy list` and `envy get` outputs. ```bash envy init envy set FOO=bar # Without --format: identical to before this feature envy list # FOO envy get FOO # bar ``` -------------------------------- ### envy hooks install examples Source: https://github.com/anguriatech/envy/blob/master/docs/commands/envy-hooks.md Installs the pre-commit hook. The --force variant replaces a hand-written hook, keeping a backup. ```bash envy hooks install envy hooks install --force # replace a hand-written hook (backup kept) ``` -------------------------------- ### Verify current branch Source: https://github.com/anguriatech/envy/blob/master/specs/013-encrypt-strict/quickstart.md Run this command to confirm you are on the 013-encrypt-strict branch before starting implementation. Expected output is '013-encrypt-strict'. ```bash git branch --show-current # Expected: 013-encrypt-strict ``` -------------------------------- ### Verify Envy development setup Source: https://github.com/anguriatech/envy/blob/master/docs/developer-guide.md Check that the Rust toolchain and pkg-config are installed. The rustc version should show stable (e.g., 1.85.0); pkg-config is only required on Ubuntu. ```bash rustc --version # should show stable, e.g. rustc 1.85.0 cargo --version pkg-config --version # Ubuntu only ``` -------------------------------- ### envy init example Source: https://github.com/anguriatech/envy/blob/master/docs/commands/envy-init.md Example of initialising Envy in a project directory. Run once per project before any other command; no secrets are written to disk. ```bash cd my-project envy init ``` -------------------------------- ### Get single secret with JSON format and error handling Source: https://github.com/anguriatech/envy/blob/master/specs/008-output-formats/quickstart.md Retrieves a single secret using `envy get --format json`. Shows successful output and error case with exit code 1 when key is missing. ```bash envy init envy set API_KEY=my-token # Found envy get API_KEY --format json # {"key":"API_KEY","value":"my-token"} # Not found — exit 1 envy get MISSING_KEY --format json; echo "exit: $?" # {"error":"key not found"} # exit: 1 ``` -------------------------------- ### Run a basic example with ENVY_BIN Source: https://github.com/anguriatech/envy/blob/master/examples/README.md Run the basic example script from its directory, specifying the envy binary path via ENVY_BIN. The script is headless and idempotent, printing a success line like 'basic: OK' on completion. ```bash cd basic ENVY_BIN=./target/debug/envy ./tutorial.sh ``` -------------------------------- ### Add strict envy encrypt paragraph to developer guide Source: https://github.com/anguriatech/envy/blob/master/specs/013-encrypt-strict/quickstart.md Add a paragraph in the GitOps section (around line 76) of docs/developer-guide.md describing the strict contract since v0.3.1, including the three cases and the silent-key-rotation gap closed. ```markdown #### `envy encrypt` is strict since v0.3.1 `envy encrypt` no longer silently re-seals an envelope with a different passphrase. The contract is: - If the envelope does not exist in `envy.enc` → create with the user-supplied passphrase. - If the envelope exists AND the passphrase matches → re-seal with the same passphrase (a fresh salt + nonce are generated regardless). - If the envelope exists AND the passphrase does NOT match → fail with exit 2 and the hint `use envy rotate -e ENV to change the envelope's passphrase.` This closes the silent-key-rotation gap that was present in v0.3.0 (where a headless `envy encrypt` with a wrong passphrase would silently re-seal the envelope, locking the rest of the team out). The dedicated path for key rotation is `envy rotate` (spec 012). ``` -------------------------------- ### Conventional commit message examples Source: https://github.com/anguriatech/envy/blob/master/CONTRIBUTING.md Follow the conventional commits style for commit messages. Examples show feat, fix, docs, and test types with scope and description. ```text feat: add --json output flag to `envy list` fix: handle empty passphrase in headless mode docs: clarify progressive disclosure in README test: add E2E scenario for legacy .env migration ``` -------------------------------- ### Install Xcode Command Line Tools on macOS Source: https://github.com/anguriatech/envy/blob/master/CONTRIBUTING.md Install the Xcode Command Line Tools for the C compiler required by SQLCipher's bundled build. `libsecret` is not needed on macOS. ```bash xcode-select --install ``` -------------------------------- ### Verification commands Source: https://github.com/anguriatech/envy/blob/master/specs/014-nested-projects/quickstart.md Run these commands to verify the implementation. The grep command must return zero matches (exit 1). ```bash cargo fmt --check cargo clippy -- -D warnings cargo test cargo build grep -r ParentProjectExists src/ # Must return zero matches (exit 1) ``` -------------------------------- ### Nested projects directory structure Source: https://github.com/anguriatech/envy/blob/master/README.md Example directory layout for monorepo support. Each project has its own envy.toml and envy.enc, and commands resolve the closest envy.toml automatically. ```text /monorepo/ envy.toml ← org-wide credentials envy.enc /project-a/ envy init ← project-specific credentials (different UUID) envy.toml envy.enc /project-b/ envy init envy.toml envy.enc ``` -------------------------------- ### VHS tapes directory structure Source: https://github.com/anguriatech/envy/blob/master/specs/015-docs-examples-demos/plan.md Shows the three hero VHS tapes for quickstart, team-sync, and ci-cd demos. Each tape declares Output at file start, requires envy on PATH, sets dummy passphrases for headless deterministic vault, and uses explicit typing/font/size settings with sleeps. ```text vhs/ ├── quickstart.tape # init → set (2 dummy) → list → run -- echo ├── team-sync.tape # Dev A encrypt → show envy.enc → Dev B decrypt → run └── ci-cd.tape # headless encrypt + status --format json + diff gates ``` -------------------------------- ### envy rotate examples Source: https://github.com/anguriatech/envy/blob/master/docs/commands/envy-rotate.md Interactive example rotates the production environment. Headless mode example sets ENVY_PASSPHRASE_PRODUCTION and ENVY_PASSPHRASE_PRODUCTION_NEW environment variables. Dummy values only; never commit real secrets. ```bash envy rotate -e production ``` ```bash ENVY_PASSPHRASE_PRODUCTION='old-pass' ENVY_PASSPHRASE_PRODUCTION_NEW='new-pass' \ envy rotate -e production ``` -------------------------------- ### envy migrate examples Source: https://github.com/anguriatech/envy/blob/master/docs/commands/envy-migrate.md Two example invocations: migrating the default .env file and specifying the staging environment with -e staging. ```bash envy migrate .env ``` ```bash envy migrate .env -e staging ``` -------------------------------- ### Install envy binary on Windows (PowerShell) Source: https://github.com/anguriatech/envy/blob/master/specs/007-ci-smoke-workflows/plan.md Conditional step for Windows runners that downloads and runs the PowerShell installer, then appends the cargo bin directory to GITHUB_PATH. Uses PowerShell shell. ```yaml - name: Install envy (Windows) if: runner.os == 'Windows' run: | irm https://github.com/anguriatech/envy/releases/latest/download/envy-installer.ps1 | iex "$env:USERPROFILE\.cargo\bin" | Out-File -FilePath $env:GITHUB_PATH -Append shell: powershell ``` -------------------------------- ### Seal all environments with one shared passphrase (ENVY_PASSPHRASE) Source: https://github.com/anguriatech/envy/blob/master/specs/009-multi-env-encrypt/quickstart.md Sets a single passphrase for all environments and runs 'envy encrypt'. Writes envy.enc with all environments sealed, exits 0 with no prompts. ```bash export ENVY_PASSPHRASE="correct-horse-battery-staple" envy encrypt # → envy.enc written with all environments sealed # → Exit 0, no prompts ``` -------------------------------- ### Short aliases for encrypt/decrypt Source: https://github.com/anguriatech/envy/blob/master/specs/006-cli-sync-commands/quickstart.md Shows that 'envy enc' and 'envy dec' are aliases for the full commands. ```bash envy enc # same as envy encrypt envy dec # same as envy decrypt ``` -------------------------------- ### Build and quality gates Source: https://github.com/anguriatech/envy/blob/master/specs/016-interactive-tui/quickstart.md Commands to build the project and run quality gates: cargo build, cargo clippy with warnings as errors, and cargo test. ```bash cargo build cargo clippy -- -D warnings cargo test ``` -------------------------------- ### Seal only one environment with -e flag Source: https://github.com/anguriatech/envy/blob/master/specs/006-cli-sync-commands/quickstart.md Encrypts only the staging environment using the -e flag. Output shows sealed environments and secret count. ```bash envy enc -e staging # Sealed 1 environment(s) → envy.enc # ✓ staging (3 secrets) ``` -------------------------------- ### Repository changes tree for docs examples demos Source: https://github.com/anguriatech/envy/blob/master/specs/015-docs-examples-demos/plan.md Lists new and modified files for the feature, including docs pages, examples, VHS tapes, tests, and CI workflow. ```text README.md # MODIFIED — linked command table (FR-001), docs/examples/demos sections (FR-011) docs/ ├── commands/ # NEW — 17 pages + _template.md (FR-002, FR-003) │ ├── _template.md │ └── envy-{init,set,get,list,rm,run,migrate,encrypt,decrypt,export,diff,status,rotate,scan,audit,hooks,completions}.md ├── developer-guide.md # MODIFIED — architecture tree refresh (FR-008) └── assets/ # NEW (CI-generated) — demo GIFs examples/ ├── basic/ # NEW — README + envy.toml.example + tutorial.sh ├── team-sync/ # NEW — README + dev_a.sh + dev_b.sh ├── ci-cd/ # NEW — README + workflow.yml + headless.sh └── monorepo/ # NEW — README + apps/*/envy.toml.example + script.sh vhs/ ├── quickstart.tape # NEW ├── team-sync.tape # NEW └── ci-cd.tape # NEW tests/ └── e2e_devops_scenarios.sh # MODIFIED — Scenario 15 (FR-005) .github/ └── workflows/ └── ci.yml # MODIFIED — FR-010 docs check + vhs-demos job (FR-007) ``` -------------------------------- ### Scenario 3: Smoke test runs after release published Source: https://github.com/anguriatech/envy/blob/master/specs/007-ci-smoke-workflows/quickstart.md Shows the smoke test workflow triggered by a release: published event after a cargo-dist tag push. The Ubuntu job installs the binary via curl, verifies it with envy --version, then performs a round-trip: envy init, envy set, envy encrypt with ENVY_PASSPHRASE, checks ./envy.enc exists (artifact_path bug guard), envy rm, envy decrypt, and envy get to verify the value. The same round-trip runs on macos and windows; all three must pass for the release to be deployable. ```bash # Maintainer creates and publishes a release (via cargo-dist tag push) git tag v0.2.0 git push origin v0.2.0 # release.yml (cargo-dist) runs and publishes GitHub Release with installers # release: published event fires → smoke-test.yml triggers # Ubuntu job: curl --proto '=https' --tlsv1.2 -LsSf \ https://github.com/anguriatech/envy/releases/latest/download/envy-installer.sh | sh envy --version # confirm binary works mkdir /tmp/smoke && cd /tmp/smoke envy init # creates envy.toml envy set DB_PASS=secret123 -e production ENVY_PASSPHRASE=top-secret envy encrypt -e production test -f ./envy.enc || exit 1 # artifact_path bug guard envy rm DB_PASS -e production ENVY_PASSPHRASE=top-secret envy decrypt RESULT=$(envy get DB_PASS -e production) [ "$RESULT" = "secret123" ] || exit 1 # round-trip verified # Same round-trip runs on macos-latest and windows-latest # All three pass → release is confirmed deployable ``` -------------------------------- ### Clone and build Envy Source: https://github.com/anguriatech/envy/blob/master/CONTRIBUTING.md Clone the repository, change into the directory, and run `cargo build`. A successful build confirms the environment is set up correctly. ```bash git clone https://github.com/anguriatech/envy.git cd envy cargo build ``` -------------------------------- ### Install keyring dependencies on Linux Source: https://github.com/anguriatech/envy/blob/master/specs/007-ci-smoke-workflows/plan.md Step for Linux runners to install Secret Service backend required by the keyring crate. Uses apt-get to install libsecret-1-dev, dbus-x11, and gnome-keyring. ```yaml - name: Install keyring dependencies (Linux) if: runner.os == 'Linux' run: | sudo apt-get update -q sudo apt-get install -y libsecret-1-dev dbus-x11 gnome-keyring ``` -------------------------------- ### Install via PowerShell (Windows) Source: https://github.com/anguriatech/envy/blob/master/README.md Install envy on Windows using PowerShell. ```powershell irm https://github.com/anguriatech/envy/releases/latest/download/envy-installer.ps1 | iex ``` -------------------------------- ### Commit envy.enc Source: https://github.com/anguriatech/envy/blob/master/specs/006-cli-sync-commands/quickstart.md Adds the encrypted vault file to git and commits it for team sharing. ```bash git add envy.enc git commit -m "chore: update encrypted secrets" ``` -------------------------------- ### Install envy binary on Unix (Linux + macOS) Source: https://github.com/anguriatech/envy/blob/master/specs/007-ci-smoke-workflows/plan.md Conditional step for Unix runners that downloads and runs the installer script, then adds the cargo bin directory to PATH. Uses curl with TLS 1.2. ```yaml - name: Install envy (Unix) if: runner.os != 'Windows' run: | curl --proto '=https' --tlsv1.2 -LsSf \ https://github.com/anguriatech/envy/releases/latest/download/envy-installer.sh | sh echo "$HOME/.cargo/bin" >> $GITHUB_PATH ``` -------------------------------- ### Install Envy via npm Source: https://github.com/anguriatech/envy/blob/master/README.md Install Envy globally using npm. ```bash npm install -g @anguriatech/envy ``` -------------------------------- ### Install via NPM Source: https://github.com/anguriatech/envy/blob/master/README.md Install envy globally via npm, or run without installing using npx. ```bash npm install -g @anguriatech/envy # or run without installing: npx @anguriatech/envy ``` -------------------------------- ### Install via Cargo Source: https://github.com/anguriatech/envy/blob/master/README.md Install envy using Cargo, which installs the 'envy' command. ```bash cargo install envy-secrets # installs the `envy` command ``` -------------------------------- ### envy encrypt usage examples Source: https://github.com/anguriatech/envy/blob/master/docs/commands/envy-encrypt.md Examples of sealing environments. The third example uses headless CI mode with the ENVY_PASSPHRASE_DEVELOPMENT environment variable and redirects stdin from /dev/null. All values are dummy placeholders. ```bash envy encrypt envy enc -e staging ENVY_PASSPHRASE_DEVELOPMENT='team-pass-dummy' envy encrypt -e development < /dev/null ``` -------------------------------- ### envy hooks install syntax Source: https://github.com/anguriatech/envy/blob/master/docs/commands/envy-hooks.md Shows the command syntax for installing the pre-commit hook. Use --force to overwrite an existing non-envy hook, which is backed up first. ```text envy hooks install [--force] ``` -------------------------------- ### Install envy via npm Source: https://github.com/anguriatech/envy/blob/master/site/index.html Install the cross-platform npm wrapper globally, or run it without installing using npx. ```bash npm install -g @anguriatech/envy ``` ```bash npx @anguriatech/envy ``` -------------------------------- ### Build from source Source: https://github.com/anguriatech/envy/blob/master/README.md Build envy from source, requiring Rust 1.85+. ```bash git clone https://github.com/anguriatech/envy.git cd envy && cargo install --path . ``` -------------------------------- ### Replace match arm in cmd_init (lines 57-60) Source: https://github.com/anguriatech/envy/blob/master/specs/014-nested-projects/quickstart.md Replace the existing match arm that returns ParentProjectExists with a comment indicating nested projects are supported. ```rust Ok((_, found_dir)) => { return Err(CliError::ParentProjectExists( found_dir.display().to_string(), )); } ``` ```rust Ok((_, found_dir)) => { // A parent has envy.toml, but the cwd does not. // Proceed with init — nested projects are supported (spec 014). } ``` -------------------------------- ### envy.toml schema example Source: https://github.com/anguriatech/envy/blob/master/specs/003-core-logic/plan.md Shows the minimal TOML schema for envy.toml, created by `envy init`. The file links the directory to its vault and must not be deleted. ```toml # Created by `envy init`. Do not delete — this file links the directory to its vault. project_id = "550e8400-e29b-41d4-a716-446655440000" ``` -------------------------------- ### Install Envy via Homebrew or NPM Source: https://github.com/anguriatech/envy/blob/master/README.md Install Envy using Homebrew on macOS/Linux or NPM on all platforms. Choose the method that matches your environment. ```bash # Homebrew (macOS & Linux) brew install anguriatech/tap/envy # NPM (all platforms) npm install -g @anguriatech/envy ``` -------------------------------- ### Verify Rust and Cargo versions Source: https://github.com/anguriatech/envy/blob/master/CONTRIBUTING.md Check that `rustc` is version 1.85.x or later and that `cargo` is available. ```bash rustc --version # rustc 1.85.x or later cargo --version ``` -------------------------------- ### envy run examples Source: https://github.com/anguriatech/envy/blob/master/docs/commands/envy-run.md Examples of running commands with different environments. Secrets are injected in addition to the inherited environment, never replacing it. ```bash envy run -- npm run dev envy run -e staging -- python main.py envy run -e production -- ./server --port 8080 ``` -------------------------------- ### Format Check with cargo fmt Source: https://github.com/anguriatech/envy/blob/master/CONTRIBUTING.md Run this command to verify code formatting. It must pass before a PR is merged. ```bash cargo fmt --check ``` -------------------------------- ### Initialize Envy in a project Source: https://github.com/anguriatech/envy/blob/master/README.md Initialize Envy in your project directory. This creates an envy.toml file that is safe to commit. ```bash cd my-project envy init # creates envy.toml (safe to commit) ``` -------------------------------- ### envy rm usage examples Source: https://github.com/anguriatech/envy/blob/master/docs/commands/envy-rm.md Examples of deleting secrets: one for the default environment and one specifying the production environment with -e. ```bash envy rm STRIPE_KEY envy rm DB_URL -e production ``` -------------------------------- ### Example: nested project initialisation with envy init Source: https://github.com/anguriatech/envy/blob/master/specs/014-nested-projects/contracts/cli-init.md Demonstrates the relaxed behaviour in v0.3.2 where ancestor projects no longer block initialisation. The example shows creating a monorepo, initialising the parent, then initialising a child project, and setting secrets under each project's UUID. ```bash $ mkdir -p /monorepo/project-a $ cd /monorepo && envy init ✓ Initialised envy project a1b2c3d4-.... $ cd /monorepo/project-a && envy init # v0.3.1: rejected with "parent project detected" ✓ Initialised envy project e5f6a7b8-.... # v0.3.2: succeeds with different UUID $ envy set API_KEY=sk_test_123 # stores under child's UUID $ cd /monorepo && envy set CI_TOKEN=ghp_... # stores under parent's UUID ``` -------------------------------- ### Run the basic tutorial script Source: https://github.com/anguriatech/envy/blob/master/examples/basic/README.md Run the tutorial from the examples/basic directory. The script is headless and uses dummy values for ENVY_PASSPHRASE and ENVY_PASSPHRASE_DEVELOPMENT, so no keyring daemon or prompts are needed. ```bash # From anywhere: cd examples/basic ENVY_BIN=./target/debug/envy ./tutorial.sh # or just: ./tutorial.sh ``` -------------------------------- ### envy get usage examples Source: https://github.com/anguriatech/envy/blob/master/docs/commands/envy-get.md Examples of envy get with different flags and piping. Values are decrypted with AES-256-GCM and output as-is. Exit codes: 0 success, 1 key not found, 2 empty/invalid key name, 4 vault or crypto failure. ```bash envy get STRIPE_KEY envy get DB_URL -e production envy get API_TOKEN | pbcopy # copy to clipboard without echo ``` -------------------------------- ### Update doc comment at line 46 Source: https://github.com/anguriatech/envy/blob/master/specs/014-nested-projects/quickstart.md Replace the doc comment to remove the ParentProjectExists reference. ```rust /// - [`CliError::AlreadyInitialised`] — `envy.toml` exists in the cwd. /// - [`CliError::VaultOpen`] — keyring, vault open, or DB write failed. ``` -------------------------------- ### Set up Perl on Windows for vendored OpenSSL Source: https://github.com/anguriatech/envy/blob/master/specs/007-ci-smoke-workflows/plan.md Step for Windows runners to install Perl 5.38, required to compile vendored OpenSSL. Must appear before any cargo build or cargo test step. ```yaml - name: Set up Perl (Windows — required to compile vendored OpenSSL) if: runner.os == 'Windows' uses: shogo82148/actions-setup-perl@v1 with: perl-version: '5.38' ``` -------------------------------- ### Missing envy.enc Source: https://github.com/anguriatech/envy/blob/master/specs/006-cli-sync-commands/quickstart.md When envy.enc is not present in the current project, decrypt fails with an error message and exit code 1. ```bash # No envy.enc in current project envy decrypt # stderr: # error: envy.enc not found at /home/user/my-project/envy.enc # Exit code: 1 ``` -------------------------------- ### Restore secrets after git pull (envy decrypt) Source: https://github.com/anguriatech/envy/blob/master/specs/006-cli-sync-commands/quickstart.md Decrypts envy.enc after pulling changes. Prompts for passphrase and imports all environments, showing upserted secrets. ```bash git pull envy decrypt # Enter passphrase: ········ # Output: # Imported 2 environment(s) from envy.enc # ✓ development (2 secrets upserted) # ✓ production (1 secret upserted) ``` -------------------------------- ### Wrong passphrase (all skipped) Source: https://github.com/anguriatech/envy/blob/master/specs/006-cli-sync-commands/quickstart.md When the wrong passphrase is provided, no environments are decrypted. Outputs an error to stderr and exits with code 1. ```bash envy decrypt # Enter passphrase: ········ (wrong key) # stderr: # error: no environments could be decrypted — check your passphrase # Exit code: 1 ``` -------------------------------- ### Run Unit and Integration Tests with cargo test Source: https://github.com/anguriatech/envy/blob/master/CONTRIBUTING.md Runs all tests except those marked #[ignore] which require a live OS keyring daemon. Includes tests/db.rs and tests/sync_artifact.rs. ```bash cargo test ``` -------------------------------- ### envy list usage examples Source: https://github.com/anguriatech/envy/blob/master/docs/commands/envy-list.md Examples of listing secret key names. The default table format shows only key names, but --format json includes decrypted values, which should be treated as sensitive. ```bash envy list envy ls -e staging # JSON for scripts (WARNING: includes decrypted values) envy list --format json ``` -------------------------------- ### envy set usage examples Source: https://github.com/anguriatech/envy/blob/master/docs/commands/envy-set.md Examples of setting secrets: inline assignment where only the first '=' separates key from value, multi-environment targeting with -e production, and reading from stdin via pipe. Dummy values are used; never commit real secrets. ```bash # Inline assignment — only the FIRST '=' separates key from value envy set STRIPE_KEY=sk_test_dummy123 # Multi-environment envy set DB_URL=postgres://prod-db -e production # Secrets from stdin (safe against ps/history leaks) echo "super-secret-value" | envy set --stdin API_TOKEN ``` -------------------------------- ### Verify envy binary version Source: https://github.com/anguriatech/envy/blob/master/specs/007-ci-smoke-workflows/plan.md Runs `envy --version` to confirm the binary is installed and working. If this fails (e.g., DLL missing, PATH wrong), the job aborts immediately with a clear error. ```yaml - name: Verify envy binary run: envy --version ``` -------------------------------- ### Cargo build and test commands Source: https://github.com/anguriatech/envy/blob/master/docs/developer-guide.md Build the project (first build compiles SQLCipher, takes ~2 minutes). Run all tests; integration tests are skipped in CI because no keyring is needed. Use --nocapture to see println! output, and -- --ignored to run integration tests that require a live keyring daemon. ```bash # Build the project (first build compiles SQLCipher — takes ~2 minutes) cargo build # Run all tests (integration tests skipped in CI — no keyring needed) cargo test # Run tests with println! output visible cargo test -- --nocapture # Run a specific test module cargo test cli::commands cargo test core::sync cargo test db:: # Run integration tests (requires live keyring daemon) cargo test -- --ignored # Check for warnings (all warnings are errors in this project) cargo clippy -- -D warnings # Security audit of dependencies cargo audit # Format code cargo fmt # Check formatting without changing files (useful in CI) cargo fmt --check ``` -------------------------------- ### Install libsecret-1-dev and pkg-config on Ubuntu Source: https://github.com/anguriatech/envy/blob/master/specs/001-vault-db-schema/tasks.md Required before cargo build because the keyring crate needs libsecret-1-dev to compile on Linux. One-time system setup; CI/CD pipelines must also install this package. ```bash sudo apt-get install -y libsecret-1-dev pkg-config ``` -------------------------------- ### Security Audit with cargo audit Source: https://github.com/anguriatech/envy/blob/master/CONTRIBUTING.md Checks for known vulnerabilities in the dependency tree. Flag any findings in the PR description. ```bash cargo audit ``` -------------------------------- ### Check current git branch Source: https://github.com/anguriatech/envy/blob/master/specs/012-cli-rotate/quickstart.md Verify you are on the 012-cli-rotate branch before starting implementation. The expected output is 012-cli-rotate. ```bash git branch --show-current # Expected: 012-cli-rotate ``` -------------------------------- ### Run security audit with cargo audit Source: https://github.com/anguriatech/envy/blob/master/specs/001-vault-db-schema/quickstart.md Runs cargo audit and expects 0 vulnerabilities. Should be run before any commit touching Cargo.toml or Cargo.lock. ```bash cargo audit # Expected: 0 vulnerabilities ``` -------------------------------- ### Create a feature branch from master Source: https://github.com/anguriatech/envy/blob/master/CONTRIBUTING.md Run this command to create and switch to a new branch for your feature. The branch name should follow the pattern feat/your-feature-name. ```bash git checkout -b feat/your-feature-name ``` -------------------------------- ### Lint with cargo clippy Source: https://github.com/anguriatech/envy/blob/master/CONTRIBUTING.md Run this command to enforce zero warnings. The -D warnings flag is enforced in CI and must pass before a PR is merged. ```bash cargo clippy -- -D warnings ``` -------------------------------- ### Seal environments with per-environment passphrases (ENVY_PASSPHRASE_DEVELOPMENT, ENVY_PASSPHRASE_PRODUCTION) Source: https://github.com/anguriatech/envy/blob/master/specs/009-multi-env-encrypt/quickstart.md Sets separate passphrases for development and production, then runs 'envy encrypt'. Writes envy.enc with both environments sealed independently, exits 0 with no prompts. ```bash export ENVY_PASSPHRASE_DEVELOPMENT="dev-secret-pass" export ENVY_PASSPHRASE_PRODUCTION="prod-secret-pass" envy encrypt # → envy.enc written with both environments sealed independently # → Exit 0, no prompts ``` -------------------------------- ### Headless CI/CD with GitHub Actions Source: https://github.com/anguriatech/envy/blob/master/specs/006-cli-sync-commands/quickstart.md GitHub Actions workflow that decrypts secrets using ENVY_PASSPHRASE environment variable and runs a deploy script. No terminal prompt is shown. ```yaml # .github/workflows/deploy.yml - name: Decrypt secrets env: ENVY_PASSPHRASE: ${{ secrets.ENVY_PASSPHRASE }} run: | envy decrypt envy run -e production -- ./deploy.sh ``` -------------------------------- ### Abort on malformed envy.enc Source: https://github.com/anguriatech/envy/blob/master/specs/009-multi-env-encrypt/quickstart.md Writes invalid JSON to envy.enc and runs 'envy encrypt'. The command fails with an error message indicating the file is malformed and exits with code 1. ```bash echo "not json" > envy.enc envy encrypt # error: envy.enc is malformed: expected value at line 1 column 1 # Exit 1 ``` -------------------------------- ### Run Bash E2E Scenarios Source: https://github.com/anguriatech/envy/blob/master/CONTRIBUTING.md Exercises the full CLI binary across nine real-world scenarios. Requires a working OS keyring. Run before submitting any PR that touches cli/, core/sync.rs, or crypto/artifact.rs. ```bash bash tests/e2e_devops_scenarios.sh ``` -------------------------------- ### Seal vault for team sharing (envy encrypt) Source: https://github.com/anguriatech/envy/blob/master/specs/006-cli-sync-commands/quickstart.md Encrypts all environments into envy.enc. Prompts for passphrase and confirmation. Output shows sealed environments and secret counts. ```bash envy encrypt # Enter passphrase: ········ # Confirm passphrase: ········ # Output: # Sealed 2 environment(s) → envy.enc # ✓ development (2 secrets) # ✓ production (1 secret) ``` -------------------------------- ### Install via shell installer (macOS & Linux) Source: https://github.com/anguriatech/envy/blob/master/README.md Install envy on macOS and Linux using the shell installer script. ```bash curl --proto '=https' --tlsv1.2 -LsSf https://github.com/anguriatech/envy/releases/latest/download/envy-installer.sh | sh ``` -------------------------------- ### CI/CD workflow with envy decrypt, diff, and run Source: https://github.com/anguriatech/envy/blob/master/README.md Example GitHub Actions workflow for decrypting secrets, asserting no unsealed drift, and deploying. Requires setting the ENVY_PASSPHRASE_PRODUCTION secret. The `envy diff -e production` command exits with code 1 if the vault differs from the artifact. ```yaml # .github/workflows/deploy.yml - name: Decrypt secrets env: ENVY_PASSPHRASE_PRODUCTION: ${{ secrets.ENVY_PASSPHRASE_PRODUCTION }} run: envy decrypt # Gate on exact artifact state before deploying - name: Assert no unsealed drift env: ENVY_PASSPHRASE_PRODUCTION: ${{ secrets.ENVY_PASSPHRASE_PRODUCTION }} run: | envy diff -e production # exit 1 if vault ≠ artifact echo "✓ Artifact matches vault" - name: Deploy run: envy run -e production -- ./scripts/deploy.sh ``` -------------------------------- ### Run local verification commands Source: https://github.com/anguriatech/envy/blob/master/specs/013-encrypt-strict/quickstart.md Run these commands locally before opening the PR. The CI quality gate runs all of the above. The grep step is the explicit SC-006 acceptance criterion. ```bash cargo fmt --check cargo clippy -- -D warnings cargo test cargo build ENVY_BIN=$(pwd)/target/debug/envy bash tests/e2e_devops_scenarios.sh grep -r confirm_key_rotation src/ # Must return zero matches ``` -------------------------------- ### Install Envy via Cargo Source: https://github.com/anguriatech/envy/blob/master/README.md Install Envy using Cargo from crates.io. ```bash cargo install envy-secrets ``` -------------------------------- ### Initialize Cargo project with cargo new Source: https://github.com/anguriatech/envy/blob/master/specs/001-vault-db-schema/quickstart.md Creates a new binary crate named 'envy' and changes into its directory. Run from the parent directory where the project should be created. ```bash cargo new envy --bin cd envy ``` -------------------------------- ### Progressive disclosure with partial access Source: https://github.com/anguriatech/envy/blob/master/specs/006-cli-sync-commands/quickstart.md When environments are sealed with different passphrases, decrypting with only the dev key imports only development and skips production. Exit code 0 indicates partial access is expected. ```bash envy decrypt # Enter passphrase: ········ (dev key) # Output: # Imported 1 environment(s) from envy.enc # ✓ development (2 secrets upserted) # ⚠ production skipped — different passphrase or key # Exit code: 0 (not an error — partial access is the expected behaviour) ``` -------------------------------- ### Install Envy via Homebrew Source: https://github.com/anguriatech/envy/blob/master/README.md Install Envy on macOS using Homebrew from the anguriatech tap. ```bash brew install anguriatech/tap/envy ``` -------------------------------- ### Rust helper function setup_project for integration tests Source: https://github.com/anguriatech/envy/blob/master/specs/004-cli-interface/tasks.md Creates an initialised Envy project in a given directory by running the envy init command. Used by integration tests T028–T034 to avoid duplication across the 6 tests that need an initialised project. ```rust fn setup_project(dir: &std::path::Path) { std::process::Command::new(env!("CARGO_BIN_EXE_envy")) .arg("init") .current_dir(dir) .status() .expect("envy init failed"); } ``` -------------------------------- ### envy get syntax Source: https://github.com/anguriatech/envy/blob/master/docs/commands/envy-get.md Syntax for the envy get command. The -e/--env flag targets an environment (default: development). ```text envy get KEY [-e ENV] ``` -------------------------------- ### Key rotation with confirmation Source: https://github.com/anguriatech/envy/blob/master/specs/009-multi-env-encrypt/quickstart.md Runs 'envy encrypt' and selects 'production'. Entering a different passphrase triggers a warning that the passphrase does not match existing data and continuing will rotate the key. Requires confirmation with 'y' to replace the production envelope. ```bash envy encrypt # → User selects 'production' # → Enters a new passphrase (different from the one that sealed it) # ⚠ Passphrase does not match existing data for 'production'. # Continuing will ROTATE the key. # Continue and rotate key? [y/N]: y # → production envelope replaced with new passphrase ``` -------------------------------- ### envy init syntax Source: https://github.com/anguriatech/envy/blob/master/docs/commands/envy-init.md Shows the command syntax for initialising Envy in the current directory. No flags are available. ```text envy init ``` -------------------------------- ### Install Pre-commit Hook and Blocked Commit Output Source: https://github.com/anguriatech/envy/blob/master/README.md Installs a pre-commit hook that runs envy scan on every commit. Attempting to commit a leaked secret is blocked. ```bash envy hooks install git commit -m "..." # envy: blocked -- a vault secret's plaintext value was found in a file # you're about to commit. Run 'envy scan --reveal' for details. ``` -------------------------------- ### Run unit and integration tests Source: https://github.com/anguriatech/envy/blob/master/docs/developer-guide.md Commands to run unit tests (no keyring needed) and integration tests that require a live OS keyring daemon. Integration tests are marked with #[ignore] and are skipped by default. ```bash # Run all unit tests (default — no keyring needed): cargo test # Run integration tests (requires keyring daemon): cargo test -- --ignored ``` -------------------------------- ### Shell autocompletion installation Source: https://github.com/anguriatech/envy/blob/master/README.md Commands to install shell completion scripts for bash, zsh, fish, and powershell. For zsh, after writing the file, run 'autoload -Uz compinit && compinit'. ```bash envy completions bash >> ~/.bash_completion envy completions zsh > ~/.zfunc/_envy # then: autoload -Uz compinit && compinit envy completions fish > ~/.config/fish/completions/envy.fish envy completions powershell >> $PROFILE ``` -------------------------------- ### Smart merge: seal only development without touching production Source: https://github.com/anguriatech/envy/blob/master/specs/009-multi-env-encrypt/quickstart.md When envy.enc already has 'production' sealed by a teammate, sets a passphrase for development only and runs 'envy encrypt'. The existing production envelope remains unchanged while development is newly sealed. ```bash export ENVY_PASSPHRASE_DEVELOPMENT="my-dev-pass" envy encrypt # → envy.enc now has both 'development' (new) and 'production' (unchanged) ``` -------------------------------- ### Add strict envy encrypt paragraph to README Source: https://github.com/anguriatech/envy/blob/master/specs/013-encrypt-strict/quickstart.md Add a paragraph in the 'Multi-Environment with Separate Passphrases' section (around line 362) explaining the strict behaviour since v0.3.1, including the failure message and exit code 2. ```markdown #### Strict `envy encrypt` — no silent key rotation Since v0.3.1, `envy encrypt` is strict: the passphrase you provide must either match the existing envelope (re-seal) or be the first time you're creating the envelope. If neither condition holds, `envy encrypt` fails with `passphrase does not match the existing envelope. use envy rotate -e ENV to change the envelope's passphrase.` (exit 2) — the artifact is left unchanged. Use `envy rotate -e ENV` as the dedicated path for key rotation. It verifies the current passphrase before accepting the new one, so a typo in either passphrase cannot silently lock the team out. ``` -------------------------------- ### Scenario 4: Smoke test catches broken Windows binary Source: https://github.com/anguriatech/envy/blob/master/specs/007-ci-smoke-workflows/quickstart.md Describes a smoke test failure when a Windows binary is missing a DLL (e.g., libcrypto-3-x64.dll not statically linked, the bug from v0.1.0). The smoke-test.yml triggers on release: published; ubuntu and macos pass, windows fails because envy --version produces no output and exits non-zero. The maintainer reverts the release and fixes the build; the Perl installation step in ci.yml is the preventive fix for this bug. ```bash # A release is published with a Windows binary that has a missing DLL # (e.g., libcrypto-3-x64.dll not statically linked — the bug from v0.1.0) # smoke-test.yml triggers on release: published # ubuntu-latest → PASS (binary works fine) # macos-latest → PASS (binary works fine) # windows-latest → FAIL (envy --version produces no output, exits non-zero) # Maintainer sees the failure, reverts the release, and fixes the build # The Perl installation step in ci.yml is the preventive fix for this exact bug ``` -------------------------------- ### Run local verification commands Source: https://github.com/anguriatech/envy/blob/master/specs/012-cli-rotate/quickstart.md Run these commands locally before opening the PR. The CI quality gate runs all of the above; ensure they pass locally to avoid a CI round-trip. ```bash cargo fmt --check cargo clippy -- -D warnings cargo test cargo build ENVY_BIN=$(pwd)/target/debug/envy bash tests/e2e_devops_scenarios.sh ``` -------------------------------- ### Run full test suite locally before pushing Source: https://github.com/anguriatech/envy/blob/master/CONTRIBUTING.md Execute these commands to verify formatting, linting, tests, and end-to-end DevOps scenarios. The clippy command treats warnings as errors with -D warnings. ```bash cargo fmt --check cargo clippy -- -D warnings cargo test bash tests/e2e_devops_scenarios.sh ``` -------------------------------- ### Invalid format value error Source: https://github.com/anguriatech/envy/blob/master/specs/008-output-formats/quickstart.md Attempts to use an unsupported format `xml` with `envy list`. Shows the error message listing possible values and exit code 2. ```bash envy list --format xml # error: invalid value 'xml' for '--format ' # [possible values: table, json, dotenv, shell] # exit code: 2 echo $? # 2 ``` -------------------------------- ### envy get with pipe to clipboard Source: https://github.com/anguriatech/envy/blob/master/docs/commands/envy-get.md Outputs the raw decrypted value of a secret, pipeline-safe with no labels or trailing metadata. Use with pbcopy to copy without echo. ```bash envy get API_KEY | pbcopy ``` -------------------------------- ### envy export usage examples Source: https://github.com/anguriatech/envy/blob/master/docs/commands/envy-export.md Example invocations: default dotenv output, JSON format for staging, and shell format for eval. Never commit real secrets. ```bash envy export # dotenv envy export -e staging --format json eval $(envy export --format shell) # load into the current shell ``` -------------------------------- ### envy get --format json not found output Source: https://github.com/anguriatech/envy/blob/master/specs/008-output-formats/contracts/output-formats.md JSON format for envy get when the key is not found. Returns an error object. Exit code is 1. ```json {"error":"key not found"} ``` -------------------------------- ### envy get --format json found output Source: https://github.com/anguriatech/envy/blob/master/specs/008-output-formats/contracts/output-formats.md JSON format for envy get when the key is found. Returns the key and value. Exit code is 0. ```json {"key":"API_KEY","value":"abc123"} ``` -------------------------------- ### Update envy encrypt row in README command table Source: https://github.com/anguriatech/envy/blob/master/specs/013-encrypt-strict/quickstart.md Replace the existing `envy encrypt` row in the README command table (around line 309) to mention the strict behaviour requiring a matching passphrase. ```markdown | `envy encrypt [-e ENV]` | `enc` | Seal vault into `envy.enc` (strict: passphrase must match an existing envelope — use `envy rotate` to change it) | ``` -------------------------------- ### JSON output example Source: https://github.com/anguriatech/envy/blob/master/specs/010-status-command/contracts/status-command.md Example JSON object printed to stdout with --format json. Contains environments array (sorted by name) and artifact object. last_modified_at is null when secret_count is 0. ```json { "environments": [ { "name": "development", "secret_count": 3, "last_modified_at": "2026-03-25T10:15:00Z", "status": "modified" }, { "name": "production", "secret_count": 5, "last_modified_at": "2026-03-23T08:00:00Z", "status": "in_sync" }, { "name": "staging", "secret_count": 2, "last_modified_at": null, "status": "never_sealed" } ], "artifact": { "found": true, "path": "./envy.enc", "last_modified_at": "2026-03-25T10:20:00Z", "environments": ["development", "production"] } } ``` -------------------------------- ### envy get --format table output Source: https://github.com/anguriatech/envy/blob/master/specs/008-output-formats/contracts/output-formats.md Default table format for envy get. Outputs the raw value only, newline-terminated. Key not found results in exit code 1 with nothing on stdout. ```text abc123 ``` -------------------------------- ### Project structure tree Source: https://github.com/anguriatech/envy/blob/master/AGENTS.md Shows the layout of the src/, tests/, and .github/ directories with module responsibilities and key types. ```text src/ crypto/ artifact.rs — ArtifactError, SyncArtifact, EncryptedEnvelope, KdfParams, ArtifactPayload, derive_key, seal_envelope, unseal_envelope core/ diff.rs — ChangeType, DiffEntry, DiffReport, compute_diff (pure diff logic, no I/O) sync.rs — SyncError, UnsealResult, seal_artifact, unseal_artifact, write_artifact, read_artifact core/ status.rs — SyncStatus, StatusRow, derive_sync_status, get_status_report cli/ mod.rs — Commands enum (Init, Set, Get, List, Rm, Run, Migrate, Encrypt, Decrypt, Export, Diff, Status), run() commands.rs — cmd_* handlers (pub(super)); cmd_diff, cmd_status, render_diff_table, write_diff_json, is_color_enabled, colorize error.rs — CliError (incl. EnvNotFound, ArtifactUnreadable), exit-code mappers tests/ sync_artifact.rs — e2e integration tests for envy.enc pipeline cli_integration.rs — CLI integration tests (requires OS keyring; ignored in CI) .github/ workflows/ release.yml — cargo-dist managed release workflow (allow-dirty: ["ci"]) ci.yml — 3-OS matrix CI (ubuntu/macos/windows); quality gate (fmt/clippy/audit) + cargo test + E2E script; Perl on Windows, dbus/gnome-keyring on Linux smoke-test.yml — post-release smoke test; installs via official installers (no Rust toolchain); full round-trip with envy.enc placement assertion ``` -------------------------------- ### envy scan usage examples Source: https://github.com/anguriatech/envy/blob/master/docs/commands/envy-scan.md Example invocations: basic scan, scan with environment and reveal, and using exit code to gate a pre-commit hook. Exit code 0 means clean, 1 means leaks found, 2+ means error. ```bash envy scan envy scan -e production --reveal envy scan || echo "leaks found — fix before committing" ``` -------------------------------- ### envy audit examples Source: https://github.com/anguriatech/envy/blob/master/docs/commands/envy-audit.md Runs the audit command with default settings and with environment and limit flags. ```bash envy audit envy audit -e production --limit 10 ``` -------------------------------- ### Multi-Environment Encryption with Separate Passphrases Source: https://github.com/anguriatech/envy/blob/master/README.md Encrypts each environment with its own passphrase. The smart merge preserves other envelopes untouched when committing. ```bash envy enc -e development # dev passphrase envy enc -e staging # staging passphrase envy enc -e production # prod passphrase (restricted) # Smart Merge: each seal preserves the other envelopes untouched git add envy.enc && git commit -m "chore: rotate secrets" ```