Workbench CLI reference
All Workbench commands, supported options, stage rules, and observable side effects.
Invocation
From the repo root with dependencies installed:
bun run workbench [command] [options]
The default is setup; bun run onboard [options] invokes the same command.
Commands
| Command | Behavior |
|---|---|
setup |
Clone missing references, then interactive environment setup; plain/noninteractive mode only checks provider connections |
references |
Clone missing reference repositories into this checkout’s ignored .references/ directory |
doctor |
Check Bun and Effect configuration; add --stage to check hosted credential configuration |
secrets |
Resolve and validate development configuration without printing values, writing files, or deploying |
auth cloudflare / auth planetscale |
Authenticate the selected Alchemy profile; requires a terminal |
plan --stage dev-you |
Read-only configuration, credential, and infrastructure plan |
provision --stage dev-you |
Fresh plan, typed confirmation, deployment, then save local API settings |
dev |
Run local frontend and API with the selected profile and an existing personal database stage |
Preview and apply a personal environment:
bun run workbench plan --stage dev-you --profile team
bun run workbench provision --stage dev-you --profile team
The CLI provisions personal dev-* stages only; it rejects production and preview stages. Provision requires an interactive terminal and typing the exact stage name. --plain does not bypass confirmation or permit unattended apply. Declining stops deployment and leaves the previous local API target unchanged. Approved deployments can apply pending migrations; review those before confirming.
Personal stages provision a database branch, runtime role, Hyperdrive connection, and API Worker, with no website Worker. The CLI has no teardown command.
Reference repositories
Run bun run references (alias for bun run workbench references) to prepare reference source without connecting cloud accounts. Interactive onboarding runs this first. Git and network access are required.
The command makes shallow clones of T3 Code (t3code), OpenCode (opencode), Executor (executor), Alchemy (alchemy), and Cal.com (calcom). See AGENTS.md for engineering reference scope.
Existing clones are kept without fetching, resetting, or changing local edits. A conflicting non-Git path stops the command. Failed or interrupted clones leave no published checkout; completed clones remain available for a retry. Each clone has a three-minute timeout, with no automatic retry. Clones belong to the current checkout, so run the command in each new worktree that needs references.
Options
| Option | Default | Behavior |
|---|---|---|
--profile NAME |
Process ALCHEMY_PROFILE, otherwise default |
Alchemy credential profile |
--stage NAME |
Unset | Only for doctor, plan, and provision; required for the last two unless requesting help |
--secrets-file PATH |
Unset | Inject credentials through op run; relative to the caller’s working directory |
--plain |
Off | Plain progress; setup performs read-only connection checks |
--help, -h |
Off | Print help without running the workflow |
Unknown commands, flags, invalid values, and extra arguments are rejected. Provider names are lowercase cloudflare and planetscale.
Development secrets
After an administrator grants individual Proton membership and development-vault access:
pass-cli login
bun run workbench secrets
The check runs bun run env:verify with APP_ENV=development, resolves configured references through the Effect configuration provider, and captures diagnostics without displaying secret values. It stops after one minute on failure or timeout; it does not provision resources. With no references configured, it validates defaults without requiring Proton login.
Guided onboarding performs the same check before connecting services. Returning users can select Check development secrets. Plain setup continues to check provider connections only.
The legacy --secrets-file flag continues to use 1Password; it does not configure Proton. Shared Proton references and personal overrides follow the credentials guide.
Stages and profiles
Stages must match dev-<suffix>, with a 1–40 character suffix of lowercase letters, digits, or hyphens, starting and ending with a letter or digit. Total length: 5–44 characters. prod, preview, dev-You, and dev-you- are rejected.
Profiles use 1–64 letters, digits, underscores, or hyphens and start with a letter or digit. The wizard remembers stages per profile; scripted commands require an explicit stage each time.
Output and failures
- Help and successful workflows exit
0; argument errors, workflow failures, and declined provisioning exit1. - Plain setup reports connection status and can succeed with disconnected providers. Use
doctor --stageto fail on missing credential configuration;planverifies actual stack access. - Ink progress requires terminal input and output; other runs use text.
- Captured failure output is withheld to protect secrets. Use the indicated diagnostic commands locally.
- Timeouts: one minute normally, three for plans, ten for authentication/deployment, and none for local development.
Deployment can succeed before saving local settings fails. Relink or refresh the existing environment; this does not roll back cloud resources. Failed or cancelled deployments preserve the previous local target.
Related repository commands
bun run doctor is React Doctor for the frontend. bun run workbench doctor checks infrastructure configuration. See stacked PRs for code submission; submitting does not merge or deploy previews.
Native private runtime regression
From the repository root, run the local SQLite/Pi regression with a synthetic model response:
bun run --cwd apps/server test:private-runtime:native
The test blocks external network access and disposes its temporary workerd state. It does not use live model credentials or deploy resources. See private runtime for its scope and remaining integration.
Native Team runtime regression
Run the Pi/Computer/code-mode regression locally:
bun run --cwd apps/server test:team-runtime:native
The test blocks external network access, supplies synthetic model responses, and disposes its temporary native Worker/SQLite state. It exercises separate sandbox execution, canonical reply delivery, recovery, revocation and scheduled admission.
With Docker running, also run the real Linux execution regression:
WORKBENCH_TEST_COMPUTER=true bun run test apps/server/test/team-computer-native.test.ts
This builds the production Computer image and starts the production Worker with Alchemy’s local runtime. It verifies Python decimal calculations, generated-file bytes, runtime Ruby installation and execution, nonzero exit status and separation between operation filesystems. It uses no model credentials or hosted Cloudflare resources. Docker may download the pinned base images and Debian packages during the build; the running agent container downloads Ruby from Debian package repositories to verify direct outbound access. The regular suite skips this Docker-dependent test unless the flag is set.
Run the opt-in native browser regression:
WORKBENCH_TEST_BROWSER=true bun run test apps/server/test/browser-native.test.ts
It uses the production browser adapter, native Pi browser tool, a local Chromium process and Dynamic Workers. It verifies screenshots saved to the working filesystem, browser-session recovery, separate cookie jars and denied execution after revocation. Alchemy may download its pinned Chromium build on first use. The test uses invented page content, no model credentials and no hosted Cloudflare resources. Hosted Live View and real model acceptance are checked separately in the PR preview and production.
TEAM_AGENT_MODEL selects the shared Team agent’s provider model ID; AI_GATEWAY_API_KEY supplies the existing gateway credential. Preview and production select openai/gpt-6.1-sol. Preview resolves its key from Workbench Preview Deployment → Environment → AI_GATEWAY_API_KEY; production uses the separate Workbench Production Deployment → Environment → AI_GATEWAY_API_KEY reference. Both must resolve before starting model work. An unset model permits identity setup and reports model-required. See Team agent for activation dependencies.
Personal agent runtime
Run the native personal-agent regression without live model or provider credentials:
bun run test apps/server/test/personal-runtime-native.test.ts
bun run test apps/server/src/runtime/personal-agent/chat.test.ts
PERSONAL_AGENT_MODEL optionally selects the personal model. When unset, it uses TEAM_AGENT_MODEL and the stage’s existing AI_GATEWAY_API_KEY. Account setup reuses the existing Executor host/service configuration, EXECUTOR_CONSENT_CALLBACK_URL, and EXECUTOR_CATALOG_OAUTH_CLIENTS. Providers still need their matching OAuth client registrations. See personal agent for isolation, capabilities and verification limits.
Alchemy state-store upgrades
Alchemy 2.0.0-beta.85 requires Cloudflare state-store protocol v8. After approval for this shared infrastructure deployment, an operator with the existing Cloudflare profile can upgrade the store:
bun run --cwd infra state bootstrap --backend cloudflare --name alchemy-state-store --no-input
This updates the state-store Worker while preserving its Durable Object state and existing authentication/encryption secrets. Update other checkouts to the same Alchemy version before planning or deploying; older clients cannot use the upgraded store. Running application Workers are unaffected. Do not use --force to bypass a missing encryption key.
Preview database state
Read the recorded database branch for PR #123 with the authorized preview credentials:
APP_ENV=preview bun scripts/environment.ts run -- bun run --cwd infra state read workbench/pr-123/DatabaseBranch --backend cloudflare --no-input
The state record contains the physical branch name. Use it rather than assuming the branch is named after its stage. This command reads state without deploying. See database isolation for branch reuse and replacement behavior.
Route lint
Check the directory route convention and its rule tests from the repository root:
bunx vp lint apps/web/src/routes
bun run test scripts/oxlint/directory-routes.test.ts
Route filename violations exit with an error. See UI organization for destinations, exceptions, and manual moves.
Production announcement preview
Preview the Slack payload for an already successful production deployment, without posting or deploying:
GH_TOKEN="$(gh auth token)" \
GITHUB_REPOSITORY=CreditWurthy/workbench \
GITHUB_REF=refs/heads/main \
GITHUB_SHA="<deployed-commit-sha>" \
GITHUB_RUN_ID="<production-workflow-run-id>" \
PRODUCTION_ACTION=deploy \
LINEAR_RELEASE_URL="https://linear.app/wurthy/pipeline/workbench-production/release/<release-slug>" \
bun scripts/announce-production.ts --dry-run
Replace angle-bracket placeholders with the deployed SHA, run ID, and matching release slug. The GitHub token requires read access to repository contents, Actions runs/jobs, and pull requests. No Slack credential is used in a dry run. CI invokes the script without --dry-run after successful deployment and release reporting, using the production webhook secret described in credentials.
Linear issue check
Validate a saved GitHub pull-request event without network access or credentials:
GITHUB_EVENT_PATH=/absolute/path/to/pr-event.json bun run linear:check
The JSON must contain pull_request.title and pull_request.body (string or null). The check exits 1 for missing title identifiers or relationships and 0 for valid metadata. GITHUB_EVENT_NAME=merge_group acknowledges prior per-PR validation. See the ticket convention for supported relationships.
Preview cleanup
Run on the repository’s default branch with GitHub Actions access. These commands permanently remove closed PR previews and their database records:
# Retry one closed PR.
gh workflow run preview-cleanup.yml --repo CreditWurthy/workbench --ref main -f pr=123
# Sweep all remaining closed PR previews.
gh workflow run preview-cleanup.yml --repo CreditWurthy/workbench --ref main
The optional pr input accepts a positive PR number of up to nine digits; empty selects a sweep. Other branch refs are skipped. Sweeps require the existing preview environment’s Cloudflare state access; teardown also requires its PlanetScale credentials. Inventory failures fail the job; GitHub lookup failures skip the affected PR. A sweep exceeding GitHub’s 256-job matrix limit fails explicitly; retry individual PRs to reduce it. See cleanup retries for scheduling and safeguards.
Daily digest
Run the workflow from main after configuring daily reporting credentials:
# Preview in the workflow summary without posting to Slack.
gh workflow run daily-digest.yml --repo CreditWurthy/workbench --ref main
# Post the latest completed reporting window to Slack.
gh workflow run daily-digest.yml --repo CreditWurthy/workbench --ref main -f post=true
The optional Boolean post input defaults to false; scheduled runs post automatically. An available posting checkpoint suppresses duplicate delivery for that cutoff. Other branches are skipped by the workflow and blocked by the production environment.
For local diagnosis, supply GH_TOKEN, LINEAR_API_KEY, AI_GATEWAY_API_KEY, DIGEST_STATE_PATH, and optionally DIGEST_MODEL through your process environment. Set GITHUB_STEP_SUMMARY to a local output filename to inspect the preview:
bun scripts/daily-digest.ts run
# Also requires SLACK_DAILY_WEBHOOK_URL and posts a real Slack message.
bun scripts/daily-digest.ts run --post
DIGEST_STATE_PATH names a persistent checkpoint file. window is a workflow helper that writes the reporting date to GITHUB_OUTPUT. See reporting and recovery behavior before retrying a failed post.
Authentication schema
From the repository root:
bun run auth:generate
bun run db:generate
The first command directly runs Better Auth CLI auth@1.7.12 with packages/auth/auth.config.ts and the Relations V2 Drizzle adapter, writing /tmp/workbench-auth-schema.ts. Compare that reference with the reviewed definitions in packages/db/src/schema/auth-schema.ts and edit those definitions directly. Preserve the UUID active organization selection and existing slug and membership uniqueness constraints rather than copying generator defaults over them. The second command compares the checked-in schema with committed snapshots and writes migration SQL offline. Neither command connects to a database. Review and commit schema changes, SQL, and snapshots together. See auth persistence for deployment ownership.
Deployment configuration
Edit configuration fields in the dedicated Proton environment vault. The committed .env.preview and .env.production references select those values; deployments resolve them automatically.
GitHub needs only the environment’s scoped Proton reader credential for this configuration source. To restore or rotate that bootstrap secret, transfer its recovery value directly through stdin:
pass-cli item view --vault-name 'Workbench Production' --item-title 'Workbench preview deployment reader' --field password | gh secret set PROTON_PASS_PERSONAL_ACCESS_TOKEN --env preview
pass-cli item view --vault-name 'Workbench Production' --item-title 'Workbench production deployment reader' --field password | gh secret set PROTON_PASS_PERSONAL_ACCESS_TOKEN --env production
The recovery items hold expiring credentials: renew the Proton identity and update its recovery value before transferring a new credential. Grant a replacement identity viewer access only to the same dedicated environment vault. Application references remain stable because they use unique vault/item names. Infrastructure and reporting credentials use the same Proton-backed loading path. See credential ownership.
Finance Core runtime resources
Verify the committed resource package and run its actual binary runner tests:
python3 -m venv /tmp/finance-runtime-python
/tmp/finance-runtime-python/bin/python -m pip install --require-hashes -r packages/finance-core-runtime/requirements.txt
bun run --cwd packages/finance-core-runtime verify
bun run --cwd packages/finance-core-runtime probe /tmp/finance-runtime-python/bin/python
To restore only the four expected files from an existing trusted offline Finance Core checkout:
bun run --cwd packages/finance-core-runtime prepare:source /path/to/finance-core
Preparation reads immutable Git objects at the manifest’s exact revision, verifies every expected hash and writes only the four package resources. It does not download sources or update the pin. The probe creates disposable invented XLSX captures and checks actual draft bytes and rejection paths; it does not deploy a Computer or save client artifacts. See the protocol and runtime responsibilities.
Finance Core diagnostic probe
Use a trusted checkout containing the pinned commit and a dedicated Python environment:
git clone https://github.com/CreditWurthy/finance-core.git /tmp/finance-core
python3 -m venv /tmp/finance-python
/tmp/finance-python/bin/python -m pip install openpyxl==3.1.5 et-xmlfile==2.0.0
bun run finance:probe /tmp/finance-core /tmp/finance-python/bin/python
bun run test run scripts/finance-core/diagnostic.test.ts
The command executes only the pinned revision documented in the Finance Core boundary, creates disposable invented captures, checks expected metrics and deterministic receipts, and prints artifact/source hashes. It does not save or publish drafts. Private repository access is required. The dedicated dependency versions reproduce this probe; they are not a general Finance Core runtime dependency lock.
Frontend builds
bun run build
bun run build:admin
build verifies both Workbench and the separate internal admin app. build:admin builds only the admin app. Both use the repository environment runner. bun run dev starts both local frontends and the API; its output includes the separate admin origin.
Environment commands
bun run env:check
bun run env:verify
bun scripts/environment.ts run -- <command> [arguments...]
Both checks load and validate the selected environment and verify every configured Proton reference without starting application services. The runner supplies the same configuration to standalone commands, masks secret output, excludes Proton authentication variables, and preserves the child exit status. Alchemy commands consume the configuration provider directly through the stack’s secrets option. Choose provider profiles explicitly with --profile or ALCHEMY_PROFILE; environment files cannot redirect Alchemy’s profile selection.
Inside GitHub Actions, the pinned Proton installer authenticates first, then bun scripts/environment.ts github registers secret masks and exports only application configuration for later steps. No resolved environment file is committed or uploaded.
Jev configuration
TYPESAFE_API_KEY is an optional server-only key for the native Effect TypeSafe provider. JEV_MODEL defaults to jev-latest. Existing application paths do not call Jev; a future workflow must explicitly provide the Jev layer.
After adding a sandbox key through the stage’s secret configuration, verify configuration and inspect a read-only plan:
bun run env:check
bun run workbench plan --stage dev-yourname --profile team
The plan reads provider state and proposes bindings without deploying. It does not make a paid Jev request or validate the key against TypeSafe.
Raindrop configuration
RAINDROP_WRITE_KEY is an optional server-only SDK write key; RAINDROP_PROJECT_ID is the destination project slug. Both must be nonempty to enable collection. Alchemy sets RAINDROP_STAGE from the deployment stage. See Raindrop observability for the exact metadata contract and delivery limits.
After storing the key through the stage’s secret setup, verify development configuration and inspect a read-only plan:
bun run workbench secrets
bun run workbench plan --stage dev-yourname --profile team
Neither command deploys or sends a Raindrop event. No live ingestion check runs automatically.
Private runtime read-only verification
Inspect the production declaration without applying it, through the normal environment loader:
APP_ENV=production bun run infra:plan --stage prod --no-input
This can resolve existing operator-owned references and read provider state. It does not deploy, rotate credentials, apply migrations or activate a model. Review resource and binding changes before publication; a successful plan alone does not prove a Worker bundle was rebuilt or the trusted loopback ran. See the runtime acceptance boundary.
Executor app provisioning configuration
Provisioning is disabled by default. Configure these stage-owned values only for a reviewed activation of the Finance setup consumer:
| Variable | Purpose |
|---|---|
EXECUTOR_PROVISIONING_ENABLED |
Boolean; when true, deployment attaches a once-per-minute Server cron. |
EXECUTOR_API_URL |
HTTPS origin of the intended host, without credentials, path, query or fragment. |
EXECUTOR_ORGANIZATION_ID |
Native Executor organization that owns the provisioned apps. |
EXECUTOR_PROVISIONING_ORGANIZATION_ID |
Workbench firm UUID whose authorized pending operations may be consumed. |
EXECUTOR_MANAGEMENT_TOKEN |
Dedicated stage-owned bearer credential for app creation/deployment; never supplied to agents. |
EXECUTOR_FINANCE_TEMPLATE_FILES |
JSON array of reviewed { "path": "...", "content": "..." } source entries, including root index.ts and package.json with an exact dependencies.apps version compatible with the host. |
Template source is configuration, not a provider credential store. Keep secrets out of it; its snapshot and SHA-256 digest are persisted with the app binding. Use separate preview and production credentials and firm mappings. A provisioned app still needs audience configuration, scoped agent access and provider consent. Changing these values does not authorize deployment or activation; use the existing read-only plan and deployment policy.
Executor provider consent configuration
Leave EXECUTOR_CONSENT_ENABLED=false until browser return routing and reviewed templates are ready. The restricted consent boundary requires the provisioning host/firm configuration above as well as:
| Variable | Purpose |
|---|---|
EXECUTOR_CONSENT_ENABLED |
Enables the restricted consent API; false by default. It does not deploy callback routing. |
EXECUTOR_CONSENT_REQUIREMENT |
App-scoped QuickBooks requirement name shared by the Finance and intake templates. |
EXECUTOR_CONSENT_CLIENT_ID |
Registered provider OAuth client ID. |
EXECUTOR_CONSENT_CLIENT_SECRET |
Provider OAuth client secret, held only by the backend. |
EXECUTOR_CONSENT_INTAKE_FILES |
Reviewed source files with pinned dependencies.apps, an app-scoped requirement and the verified connectionIdentity query. Same source format as the Finance template; no schedules, webhooks or automatic background provider work. |
Use the same provider definition in both templates so native provider references match. The source files contain no credentials. A successful completion must verify the saved account’s actual provider company and environment. This change does not ship a live-tested QuickBooks intake template or configure Intuit redirect URIs.
Authenticated endpoints follow this sequence. JSON requests use the Workbench origin and session; no Executor management credential is accepted from the browser:
| Method and path | Caller and payload |
|---|---|
POST /spaces/:spaceId/finance-connections |
Provider admin/lead: {userId, organizationId, sourceId, environment}; returns the intent ID, status and expiry. |
GET /spaces/:spaceId/finance-connections/:connectionId |
Named recipient or current manager; returns only ID, status and expiry. |
POST /spaces/:spaceId/finance-connections/:connectionId/start |
Named recipient; returns the provider authorization URL once. |
POST /spaces/:spaceId/finance-connections/:connectionId/complete |
Same recipient: {callbackUrl} containing the original registered native callback URL. The configured Linear callback reaches this authenticated boundary; QuickBooks browser relay activation remains unfinished. |
DELETE /spaces/:spaceId/finance-connections/:connectionId |
Current manager; cancels pending consent or unlinks the active Finance assignment. In-flight or uncertain outcomes require reconciliation. |
Native shared-account MCP grants use runsAs: [{kind: "app"}]. They authorize the app rather than pinning a company identity forever. Workbench must control and verify assignments, and the Finance template must enforce its approved source identity; management tokens never belong in agent configuration. Initial scoped MCP authorization still uses the supported browser flow and is separate from provider consent.
Linear connection preview
EXECUTOR_CONSENT_PROVIDER=linear selects browser OAuth for Linear’s remote MCP server. Set EXECUTOR_CONSENT_SOURCE_ID=https://mcp.linear.app/mcp/readonly and EXECUTOR_CONSENT_REQUIREMENT=linear. With no explicit source files, the server builds the pinned native MCP import. EXECUTOR_CONSENT_CALLBACK_URL must exactly match the dedicated host’s EXECUTOR_OAUTH_CALLBACK_URL; for the pilot it is the preview frontend’s /executor/callback. The app requests only read. Dynamic client registration supplies the Linear OAuth client; no key form is used.
EXECUTOR_ACTIVATION_STAGE limits activation to an exact Alchemy stage and EXECUTOR_PROVISIONING_ORGANIZATION_ID limits the consumer to the configured firm. Creating a client-bound Finance space commits the Team identity and setup intent, then queues background provisioning. The enabled consumer also runs once per minute, including on the isolated preview, to recover pending intents. GET /spaces/:spaceId/finance-connections reports setupStatus; the page polls while setup runs and offers Add connection when ready. POST /spaces/:spaceId/finance-connections/provision remains an authorized dispatch/recovery boundary, rather than an initial user step. SQL claims prohibit replaying unknown mutations.
EXECUTOR_AUTO_GRANTS_ENABLED=true also provisions a native read-only, one-app MCP OAuth grant. Configure EXECUTOR_SERVICE_EMAIL, secret EXECUTOR_SERVICE_PASSWORD, and secret EXECUTOR_GRANT_ENCRYPTION_KEY (64 lowercase hexadecimal characters) for the dedicated control-plane identity. Its machine sign-in and native consent authorize the service’s own scoped agent, not the human’s Linear account. Native session cookies are discarded after provisioning. Grant receipts and AES-GCM ciphertext live in finance_executor_grant; the authenticated context pins the organization, space, host and native app. The Team DO retains refreshed tokens privately. Neither the service password nor the management PAT is sent to the agent.
EXECUTOR_PROVISIONING_ORGANIZATION_ID accepts one firm UUID or the explicit value * for all authorized client-bound Finance spaces in the activated stage. Stage activation remains separate from this rollout filter.
EXECUTOR_SHARED_APP_ID optionally attaches one preinstalled native app to each space’s existing scoped grant. It must declare caller-scoped workbenchSpace.many() and no globally linked app accounts. The control plane creates the context identity and records it before updating the connection. This allows installed skills and setup checks before provider consent; it does not activate a provider OAuth integration. Keep its finance code and source versions in Executor. See shared Finance app.
For browser testing, create a client and Finance space, open Settings → Connections, wait for connections to become ready, choose Add connection → Linear, approve the intended workspace on Linear, then send @Wes list three recent Linear issues in Team. There is no key-submission endpoint. Disconnect unlinks the account and blocks grant release and retained context use. The picker also offers Notion and Sentry through their native OAuth/MCP flows. Each provider needs its own human consent. The live catalog search also installs other integrations, including QuickBooks, as separate native apps for the space. Their declared OAuth methods appear after installation. A provider may still need OAuth client configuration on the native host; a missing client is reported as setup required rather than connected. The existing three-provider adapter keeps its one-account-per-provider behavior.
Executor domain infrastructure
Use the operator Alchemy profile with Railway and Cloudflare DNS access. Plan the production-only domain stack, inspect its domain and scoped DNS changes, then deploy only when authorized:
CLOUDFLARE_ACCOUNT_ID=3319e72549b86d6f527fd17cfaa204e6 bun run infra:domains:plan
CLOUDFLARE_ACCOUNT_ID=3319e72549b86d6f527fd17cfaa204e6 bun run infra:domains:deploy
The stack references the existing Executor service and owns only its custom domain and DNS records. Verify https://executor.wurthy.co/health after deployment. Normal application releases do not manage zone DNS, and this stack does not change authentication or Workbench API URLs. The canonical URL cutover requires the authentication migration prerequisite.
Executor bootstrap
Production runs the following steps automatically before Alchemy deployment. The plan performs no mutations:
APP_ENV=production bun scripts/environment.ts run -- bun scripts/executor.ts plan
The apply command is a deployment-job operation. It requires GITHUB_ENV and appends verified Executor runtime bindings for subsequent deployment steps:
bun scripts/executor.ts apply
Run apply only in an authorized production deployment with the production Proton inputs loaded. It provisions the persistent Executor service and native resources, then enables Finance provisioning for the prod stage. See production Executor bootstrap for prerequisites, retained state, and recovery.
Executor origin migration
After the compatibility release succeeds, run from the repository root with the production Proton reader, cf CLI and existing Alchemy state profile. The tool verifies the fully active API Worker’s deployed origin bindings before switching. Use a new private absolute receipt path for each preparation:
APP_ENV=production bun scripts/environment.ts run -- bun run executor:origin prepare /private/path/executor-origin.json
APP_ENV=production bun scripts/environment.ts run -- bun run executor:origin apply /private/path/executor-origin.json
prepare validates live Finance bindings and saves encrypted rollback data without changing the selected origin. apply switches the existing service to executor.wurthy.co, verifies replacement machine grants and atomically updates bindings. Provider OAuth accounts and app/account assignments are retained. The command is production-only; a reused receipt path or changed inventory stops preparation or commit. Retain the receipt for recovery; it contains authenticated ciphertext and private resource metadata, not plaintext OAuth tokens.
For an authorized rollback before new live clients or permission edits intervene:
APP_ENV=production bun scripts/environment.ts run -- bun run executor:origin rollback /private/path/executor-origin.json
Rollback restores the original Railway origin and obtains fresh scoped grants so an uncertain old refresh-cache entry cannot override recovery. The command refuses changed scope or inventory. See migration behavior for release ordering and acceptance.
Finance Core Executor preparation
Sign in to the self-hosted production instance and export the existing shared app’s working source. Select its ID from the app list, and check pending edits against the deployed version before proceeding:
executor apps login --host https://workbench-executor-production-production.up.railway.app
executor apps list --host https://workbench-executor-production-production.up.railway.app
executor apps source --host https://workbench-executor-production-production.up.railway.app \
--app <existing-shared-app-id> > /tmp/finance-app-source.json
Use a local checkout containing the reviewed commit of private CreditWurthy/finance-core. The pin lives in scripts/executor/finance-core/source.json; packaging exports that exact Git object, verifies every file and builds its original tool catalog. It updates the committed Computer archive and app package inputs without changing the source repository. Preparation then replaces the reviewed old adapter in the exported app. The output directory must not exist:
bun run finance:executor:package /path/to/finance-core
bun run finance:executor:prepare /tmp/finance-app-source.json /tmp/finance-app-prepared
Preparation writes complete files.json, receipt.json, and the compressed app seed plus manifest. The receipt records package/archive/source hashes and not_deployed status. Copy the reviewed seed and manifest into scripts/executor/assets/ for first-install bootstrap only. It performs no remote writes. It accepts text-only app exports; an export containing binary/object references requires separate reconciliation. Review the resulting diff, retained account/provider definitions, source pin and local app type check before deployment.
After explicit deployment approval, save against revision.commit from the source export, inspect the returned removed paths, then deploy the new commit printed by the save:
executor apps commit --host https://workbench-executor-production-production.up.railway.app \
--app <existing-shared-app-id> --expected <exported-source-commit> \
--files /tmp/finance-app-prepared/files.json --message "Replace the old adapter with the complete pinned Finance Core package"
executor apps deploy --host https://workbench-executor-production-production.up.railway.app \
--app <existing-shared-app-id> --commit <new-source-commit>
Never deploy after a rejected save or unexplained removal. Host versions without source-commit support require a separately reviewed update procedure; do not fall back to an unguarded deploy. Verify the app’s active version, complete package inventory, default skill, original catalog, per-file hashes and retained account requirements. Release the matching Computer image through the standard Production workflow. Then verify the scoped Team finance_core tool executes an original synthetic calculation, reports the same package revision, and rejects model-supplied scope. See update behavior and limits.
Worker analysis
Build and report the API Worker without deploying or loading Proton credentials:
bun run worker:analyze
To include a local startup CPU profile, use Node 24 and install the pinned Cloudflare CLI:
npm install --global cf@0.15.0
bun run worker:analyze --profile
Compare with a previously generated report:
bun run worker:analyze --profile --baseline /path/to/previous/upload.json
--observe-only reports a historical baseline without enforcing current size/tooling policy; CI uses it only for the PR base. Normal builds and current-revision analysis enforce that policy.
--root <checkout> selects the source checkout; --output <directory> changes the report directory. By default reports are in infra/.alchemy/worker-analysis/head/. --summary also appends the report to GITHUB_STEP_SUMMARY when present. CI builds a separate PR base checkout for its comparison; both snapshots use the current analysis compiler and build settings. Dependency installation belongs to each checkout.
The local profile uses cf workers check --prebuilt with a generated analysis-only Build Output manifest and workerd 1.20261027.1, matching the API compatibility date. Alchemy continues to own deployment. The profile records sampled active CPU and does not predict Cloudflare startup validation or measure a cold HTTP request. See Worker measurements for hosted timings and artifact contents.
Invitation email status
Generate local invitation and access-addition HTML and plain-text previews without sending email:
bun run email:preview
Open dist/email-previews/firm-invitation.html, client-invitation.html, long-name-invitation.html, member-added.html, or conversation-added.html. An optional output directory can be passed as the first argument. Preview links use a reserved example domain; the local preview copies the real logo alongside each fixture. Published messages use the configured HTTPS frontend origin instead. Browser previews do not establish Gmail, Outlook or Apple Mail compatibility or live deliverability.
Invitation delivery runs through the server’s Effect workflow on Cloudflare Workflows. Configure stage-owned Resend credentials and its signed webhook before activation. See invitation email for the settings, recovery rules and status API. Manual deployments continue to require approval.
Email activation review
Review the activation procedure before live testing. These commands inspect infrastructure without deploying or sending email:
APP_ENV=production bun run infra:plan --stage prod --no-input
APP_ENV=production bun scripts/environment.ts run -- cf workers list --per-page 100
APP_ENV=production bun scripts/environment.ts run -- cf workers secrets list --worker '<production-server-name>'
APP_ENV=production bun scripts/environment.ts run -- cf workflows list --search '<production-workflow-name>'
Select names from the current stage’s outputs and Worker metadata; inspect all pages if the requested resource is absent. Secret listings expose binding names, not secret values. Plans and private state output require private review; retain only action summaries in shared evidence. Never dump the resolved environment or use a send request to validate a credential without approval. Inspect Resend domains, key scope and webhook settings in its authenticated operator dashboard when the runtime sending key cannot read them.
Email backlog review
Use an existing authorized database connection to the intended production branch. WORKBENCH_REVIEW_DATABASE_URL below is an operator-supplied connection variable, not application configuration. Do not create a role, rotate a password or start a tunnel that provisions credentials merely to run this review.
psql "$WORKBENCH_REVIEW_DATABASE_URL" -X --set ON_ERROR_STOP=1
Start a read-only transaction and check table availability first:
BEGIN READ ONLY;
SET LOCAL statement_timeout = '10s';
SELECT name, to_regclass('public.' || name) IS NOT NULL AS present
FROM (VALUES ('invitation_email'), ('notification_email'),
('notification_event'), ('notification_email_item'),
('notification_email_suppression')) AS tables(name);
Run each query below only if all of its referenced tables are present. Missing tables require migration review; they do not establish zero pending deliveries. These aggregates omit message contents, recipient mailboxes and invitation URLs. Counts are an inventory, not a determination of current sending eligibility.
SELECT stage, status, count(*) AS jobs, min(created_at) AS oldest,
count(*) FILTER (WHERE attempts > 0 AND provider_id IS NULL)
AS unacknowledged_attempts
FROM invitation_email GROUP BY stage, status ORDER BY stage, status;
SELECT stage, status, count(*) AS jobs, min(created_at) AS oldest,
count(*) FILTER (WHERE attempts > 0 AND provider_id IS NULL)
AS unacknowledged_attempts
FROM notification_email GROUP BY stage, status ORDER BY stage, status;
SELECT e.kind, count(*) AS uncaptured_sources, min(e.created_at) AS oldest
FROM notification_event e
WHERE NOT EXISTS (
SELECT 1 FROM notification_email_item i
WHERE i.event_id = e.id AND i.channel = 'email'
)
GROUP BY e.kind ORDER BY e.kind;
SELECT stage, reason, count(*) AS suppressed_mailboxes
FROM notification_email_suppression
GROUP BY stage, reason ORDER BY stage, reason;
Source events have no stage column; their eventual email jobs acquire the active stage during capture. The source count includes events that current access, mailbox verification or suppression may exclude. Inspect those decisions privately when approving the backlog. End the review transaction, including after an error:
ROLLBACK;
Generative UI studio
Run the standalone synthetic conversation examples on the loopback address at port 3012:
bun run --cwd apps/generative-ui dev
With a personal sandbox TYPESAFE_API_KEY configured in the process environment, compose new local examples through the existing Effect provider:
bun run --cwd apps/generative-ui compose
This submits synthetic candidate descriptions to TypeSafe and writes complete reports and their evidence-first versions to the ignored apps/generative-ui/src/generated.local.json. It performs no deployment or product writes. Existing local results remain intact on failure. Reload the studio after success. JEV_MODEL uses the provider’s jev-latest default unless configured explicitly.
Verify the experiment:
bun run test apps/server/src/domain/generative-ui/compose.test.ts apps/server/src/runtime/team-agent/display.test.ts
bun run --cwd apps/generative-ui build
See generated-answer behavior and evaluation.
Jev response evaluation
Run the built-in synthetic response cases without a model request:
bun run jev:eval --output /tmp/jev-response-offline.json
For an explicit live run, supply a sandbox or preview TYPESAFE_API_KEY through the process environment. Set JEV_MODEL to a versioned model identifier for reproducibility. Do not paste credentials into commands, output files or examples. Run:
bun run jev:eval --live --output /tmp/jev-response-live.json
bun run jev:eval --live --open-help --output /tmp/jev-response-open-help.json
--open-help compares the broader provisional policy; it does not enable that policy in Workbench. The report includes the structural baseline, single-question and focused-question results, missed invitations, unwanted interruptions, abstentions, failures, latency and usage. See evaluation boundaries.