Skip to content

feat(cli): env-var management verbs for all four scopes#170

Merged
donbeave merged 3 commits into
mainfrom
feature/workspace-env-cli
Apr 25, 2026
Merged

feat(cli): env-var management verbs for all four scopes#170
donbeave merged 3 commits into
mainfrom
feature/workspace-env-cli

Conversation

@donbeave

Copy link
Copy Markdown
Member

Summary

Adds jackin config env {set,unset,list} (Global and per-Agent scopes) and jackin workspace env {set,unset,list} (Workspace and per-WorkspaceAgent scopes), exposing the full four-scope EnvScope surface that ConfigEditor::set_env_var and ConfigEditor::remove_env_var already implement.

This is a deliberate CLI-first prerequisite for Stage 3 (Secrets tab) of the workspace-manager-TUI series. Per the standing rule that the operator console is simplified and CLI carries the full feature surface, the TUI must not be the first interface for env management — this PR closes that gap.

What's inside

Commit Subject
510990df test(config): cover all EnvScope variants in remove_env_var unit tests
c336469a feat(cli): add env-var management verbs for all four scopes
fc233e18 docs(commands): document config env and workspace env verbs

Routing:

  • config env [--agent X] → Global / Agent scopes
  • workspace env <WS> [--agent X] → Workspace / WorkspaceAgent scopes

No new dependencies. ConfigEditor::remove_env_var already returns bool with the right semantics — unset is wired directly with idempotent "not set" output and exit 0 on missing keys.

Tests:

  • 5 new editor unit tests covering all four EnvScope variants on remove_env_var
  • 10 new integration tests in tests/cli_env.rs (the first end-to-end CLI test file in the repo; uses assert_cmd/predicates already in dev-deps)
  • Full suite: 843 passing, no regressions

Out of scope

  • TUI Secrets tab (Stage 3, follow-on PR)
  • Value masking, validation of op:// references, POSIX env-name rules
  • [docker.mounts] global mount management
  • CHANGELOG.md (operator curates manually)

Test plan

  • cargo nextest run -p jackin — 843 passed
  • cargo nextest run -p jackin --test cli_env — 10/10 pass
  • cargo clippy -- -D warnings — clean (CI gate)
  • cargo fmt -- --check — clean
  • cargo build --all-targets — clean
  • bun run build (docs) — 45 pages built, no warnings
  • Manual smoke: jackin config env set FOO bar, --agent, --comment, unset, list across both parents

donbeave and others added 3 commits April 25, 2026 01:28
Adds unit tests for `ConfigEditor::remove_env_var` covering the three
previously untested EnvScope variants (Agent, Workspace, WorkspaceAgent)
plus a sibling-preservation test at Global scope. Production code is
unchanged.

Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Claude <noreply@anthropic.com>
Adds `jackin config env {set,unset,list}` (global and per-agent) and
`jackin workspace env {set,unset,list}` (per-workspace and per-workspace-
agent). Calls existing ConfigEditor::set_env_var / remove_env_var; no new
editor methods. Includes integration tests in tests/cli_env.rs as the
first end-to-end CLI test file.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Documents the new `jackin config env {set,unset,list}` and
`jackin workspace env {set,unset,list}` verbs landed in the prior
commit. Worked examples per scope; notes on idempotent unset
semantics; clarifies that values are stored as-typed and resolved
at launch.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
@donbeave donbeave merged commit 05d8457 into main Apr 25, 2026
5 checks passed
@donbeave donbeave deleted the feature/workspace-env-cli branch April 25, 2026 01:50
donbeave added a commit that referenced this pull request May 6, 2026
* test(config): cover all EnvScope variants in remove_env_var unit tests

Adds unit tests for `ConfigEditor::remove_env_var` covering the three
previously untested EnvScope variants (Agent, Workspace, WorkspaceAgent)
plus a sibling-preservation test at Global scope. Production code is
unchanged.

Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Claude <noreply@anthropic.com>

* feat(cli): add env-var management verbs for all four scopes

Adds `jackin config env {set,unset,list}` (global and per-agent) and
`jackin workspace env {set,unset,list}` (per-workspace and per-workspace-
agent). Calls existing ConfigEditor::set_env_var / remove_env_var; no new
editor methods. Includes integration tests in tests/cli_env.rs as the
first end-to-end CLI test file.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>

* docs(commands): document config env and workspace env verbs

Documents the new `jackin config env {set,unset,list}` and
`jackin workspace env {set,unset,list}` verbs landed in the prior
commit. Worked examples per scope; notes on idempotent unset
semantics; clarifies that values are stored as-typed and resolved
at launch.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>

---------

Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Claude <noreply@anthropic.com>
donbeave added a commit that referenced this pull request May 7, 2026
* test(config): cover all EnvScope variants in remove_env_var unit tests

Adds unit tests for `ConfigEditor::remove_env_var` covering the three
previously untested EnvScope variants (Agent, Workspace, WorkspaceAgent)
plus a sibling-preservation test at Global scope. Production code is
unchanged.

Co-authored-by: Claude <noreply@anthropic.com>

* feat(cli): add env-var management verbs for all four scopes

Adds `jackin config env {set,unset,list}` (global and per-agent) and
`jackin workspace env {set,unset,list}` (per-workspace and per-workspace-
agent). Calls existing ConfigEditor::set_env_var / remove_env_var; no new
editor methods. Includes integration tests in tests/cli_env.rs as the
first end-to-end CLI test file.

Co-authored-by: Claude <noreply@anthropic.com>

* docs(commands): document config env and workspace env verbs

Documents the new `jackin config env {set,unset,list}` and
`jackin workspace env {set,unset,list}` verbs landed in the prior
commit. Worked examples per scope; notes on idempotent unset
semantics; clarifies that values are stored as-typed and resolved
at launch.

Co-authored-by: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Codex <codex@openai.com>
donbeave added a commit that referenced this pull request May 7, 2026
* test(config): cover all EnvScope variants in remove_env_var unit tests

Adds unit tests for `ConfigEditor::remove_env_var` covering the three
previously untested EnvScope variants (Agent, Workspace, WorkspaceAgent)
plus a sibling-preservation test at Global scope. Production code is
unchanged.


* feat(cli): add env-var management verbs for all four scopes

Adds `jackin config env {set,unset,list}` (global and per-agent) and
`jackin workspace env {set,unset,list}` (per-workspace and per-workspace-
agent). Calls existing ConfigEditor::set_env_var / remove_env_var; no new
editor methods. Includes integration tests in tests/cli_env.rs as the
first end-to-end CLI test file.


* docs(commands): document config env and workspace env verbs

Documents the new `jackin config env {set,unset,list}` and
`jackin workspace env {set,unset,list}` verbs landed in the prior
commit. Worked examples per scope; notes on idempotent unset
semantics; clarifies that values are stored as-typed and resolved
at launch.


---------

Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Claude <noreply@anthropic.com>
donbeave added a commit that referenced this pull request May 7, 2026
* test(config): cover all EnvScope variants in remove_env_var unit tests

Adds unit tests for `ConfigEditor::remove_env_var` covering the three
previously untested EnvScope variants (Agent, Workspace, WorkspaceAgent)
plus a sibling-preservation test at Global scope. Production code is
unchanged.


* feat(cli): add env-var management verbs for all four scopes

Adds `jackin config env {set,unset,list}` (global and per-agent) and
`jackin workspace env {set,unset,list}` (per-workspace and per-workspace-
agent). Calls existing ConfigEditor::set_env_var / remove_env_var; no new
editor methods. Includes integration tests in tests/cli_env.rs as the
first end-to-end CLI test file.


* docs(commands): document config env and workspace env verbs

Documents the new `jackin config env {set,unset,list}` and
`jackin workspace env {set,unset,list}` verbs landed in the prior
commit. Worked examples per scope; notes on idempotent unset
semantics; clarifies that values are stored as-typed and resolved
at launch.


---------

Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Claude <noreply@anthropic.com>
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.

1 participant