Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/agentworkforce/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Expose the CLI's workspace-scoped `env set`, `env list`, and `env unset`
commands through the top-level `agentworkforce` binary.

## [4.1.51] - 2026-08-31

### Added
Expand Down
10 changes: 10 additions & 0 deletions packages/agentworkforce/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,20 @@ agentworkforce agent [--install-in-repo] [--no-launch-metadata] <persona>[@<tier
agentworkforce list [flags]
agentworkforce show <persona>
agentworkforce sources <list|add|remove>
agentworkforce env set <KEY> [--workspace <name>] [--cloud-url <url>] [--json] [--no-prompt]
agentworkforce env list [--workspace <name>] [--cloud-url <url>] [--json] [--no-prompt]
agentworkforce env unset <KEY> [--workspace <name>] [--cloud-url <url>] [--json] [--no-prompt]
agentworkforce harness check
agentworkforce --version
```

Workspace secrets are set from stdin so their values never enter argv:

```sh
printf '%s' "$RTH_TOKEN" | agentworkforce env set RTH_TOKEN
agentworkforce env list
```

This package is a thin wrapper around [`@agentworkforce/cli`](https://www.npmjs.com/package/@agentworkforce/cli).
It exists so the global install command and the binary name match the
project name.
Expand Down
7 changes: 7 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add workspace-scoped `env set`, `env list`, and `env unset` commands. Secret
values are accepted only from stdin, output is metadata-only, and cloud
deployments receive the variables through their runtime environment rather
than persona prompt inputs.

## [4.1.51] - 2026-08-31

### Added
Expand Down
23 changes: 23 additions & 0 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ agentworkforce persona compile <path/to/persona.ts|persona.js>
agentworkforce install [flags] <pkg|path>
agentworkforce deploy <path/to/persona.json|persona.ts|persona.js> [flags]
agentworkforce integrations [provider] [--all] [--json]
agentworkforce env set <KEY> [--workspace <name>] [--cloud-url <url>] [--json] [--no-prompt]
agentworkforce env list [--workspace <name>] [--cloud-url <url>] [--json] [--no-prompt]
agentworkforce env unset <KEY> [--workspace <name>] [--cloud-url <url>] [--json] [--no-prompt]
agentworkforce trigger <agent-name-or-id> [--workspace <id>] [--cloud-url <url>] [--json] [--no-prompt]
agentworkforce sources <list|add|remove>
agentworkforce harness check
Expand All @@ -37,6 +40,8 @@ agentworkforce --version
an authored source module such as `persona.ts` or `persona.js`.
- `integrations` — discover available integrations, known trigger events, and
connection status for the active workspace.
- `env` — manage runtime environment variables for the active workspace without
putting their values in persona inputs, argv, logs, or command output.
- `trigger` — manually fire an active deployed persona for testing. The
selector accepts agent id, compact agent id, deployed name, persona slug, or
persona id, and posts to the same cloud trigger endpoint used by the dashboard.
Expand Down Expand Up @@ -84,6 +89,24 @@ offline trigger catalog, rendering connection state as unknown. A provider
argument prints the full trigger list, connection details, and a persona/agent
snippet using the cloud provider id.

## Workspace environment variables

Use workspace environment variables for runtime-only values such as service
tokens that must be available through `process.env` but must not be substituted
into a persona's system prompt.

```sh
printf '%s' "$RTH_TOKEN" | agentworkforce env set RTH_TOKEN
agentworkforce env list
agentworkforce env unset RTH_TOKEN
```

`env set` accepts only the key on the command line and reads the value from
non-interactive stdin. It reports whether the key was created or overwritten.
`env list` returns only keys, last-set timestamps, and setter identities — never
values or masked fragments. All three commands use the active workspace unless
`--workspace <name>` is supplied; ambiguous workspace selection fails closed.

## Selectors

```
Expand Down
22 changes: 22 additions & 0 deletions packages/cli/src/cli-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@ Commands:
Discover workspace integrations, connection status, and
known trigger events. JSON output includes registration
health when the cloud status API provides it.
env set <KEY> Set or overwrite a workspace environment variable from
stdin. Values are never accepted on argv. Flags:
--workspace <name> override the active workspace
--cloud-url <url> override the workforce cloud URL
--json emit metadata only (never values)
--no-prompt fail instead of prompting for login
env list List workspace environment variable names, last-set
times, and setters. Values are never returned.
env unset <KEY> Remove a workspace environment variable; fails if the
key is not set. Accepts the same flags as env set.
trigger <agent-name-or-id> [payload-json] [flags]
Manually fire an active deployed persona for testing.
The selector accepts agent id, compact agent id,
Expand Down Expand Up @@ -401,6 +411,8 @@ Examples:
agentworkforce sources list
agentworkforce sources add ../my-personas --position 1
agentworkforce integrations --all
printf '%s' "$RTH_TOKEN" | agentworkforce env set RTH_TOKEN
agentworkforce env list
agentworkforce harness check
agentworkforce pick "review this PR for security issues"
agentworkforce agent "$(agentworkforce pick "fix the flaky test in foo.test.ts")"
Expand Down Expand Up @@ -5170,6 +5182,16 @@ export async function main(): Promise<void> {
return;
}

if (subcommand === 'env') {
try {
const { runEnv } = await import('./env-command.js');
await runEnv(rest);
return;
} catch (err) {
die(`agentworkforce env failed: ${err instanceof Error ? err.message : String(err)}`, false);
}
}

if (subcommand === 'trigger') {
await runTrigger(rest);
return;
Expand Down
Loading
Loading