diff --git a/packages/cli/src/commands/environments/bind.ts b/packages/cli/src/commands/environments/bind.ts index af2977cc13..ddede274a8 100644 --- a/packages/cli/src/commands/environments/bind.ts +++ b/packages/cli/src/commands/environments/bind.ts @@ -10,11 +10,11 @@ import { formatOutput } from '../../utils/output-formatter.js'; /** * `os environments bind` — bind a locally-compiled artifact to an existing - * multi-environment server project. + * multi-environment server environment. * * Equivalent to `PATCH /api/v1/cloud/environments/` with * `metadata.artifact_path = `. The server's - * AppBundleResolver picks up the path on the next per-project kernel + * AppBundleResolver picks up the path on the next per-environment kernel * boot, registering the bundle's objects, views, and seed data. * * Use `--build` to compile `objectstack.config.ts` first so the artifact diff --git a/packages/cli/src/commands/environments/create.ts b/packages/cli/src/commands/environments/create.ts index 63b348089e..0bfac47d6e 100644 --- a/packages/cli/src/commands/environments/create.ts +++ b/packages/cli/src/commands/environments/create.ts @@ -7,10 +7,10 @@ import { formatOutput } from '../../utils/output-formatter.js'; import { readAuthConfig, writeAuthConfig } from '../../utils/auth-config.js'; /** - * `os environments create` — provision a new project. + * `os environments create` — provision a new environment. * * Delegates to `ProjectProvisioningService.provisionProject` on the server. - * On success, optionally activates the new project for the current session + * On success, optionally activates the new environment for the current session * and persists `activeEnvironmentId` into `~/.objectstack/credentials.json` * (unless `--no-activate` is passed). */ @@ -64,7 +64,7 @@ export default class EnvironmentsCreate extends Command { // Resolve the artifact to an absolute path so the server can read it // regardless of its CWD. Bail early if the file is missing — better - // to fail before provisioning than leave a half-bound project. + // to fail before provisioning than leave a half-bound environment. let metadata: Record | undefined; if (flags.artifact) { const path = await import('node:path'); diff --git a/packages/cli/src/commands/environments/list.ts b/packages/cli/src/commands/environments/list.ts index b53e4998f5..a125936f2f 100644 --- a/packages/cli/src/commands/environments/list.ts +++ b/packages/cli/src/commands/environments/list.ts @@ -6,7 +6,7 @@ import { createApiClient, requireAuth } from '../../utils/api-client.js'; import { formatOutput } from '../../utils/output-formatter.js'; /** - * `os environments list` — list projects visible to the current session. + * `os environments list` — list environments visible to the current session. * * Filters by organization via `--org`. Output format is the same * table/json/yaml shape used by other metadata commands, for a diff --git a/packages/cli/src/commands/environments/show.ts b/packages/cli/src/commands/environments/show.ts index 92c4f46ab4..15271573e2 100644 --- a/packages/cli/src/commands/environments/show.ts +++ b/packages/cli/src/commands/environments/show.ts @@ -6,9 +6,9 @@ import { createApiClient, requireAuth } from '../../utils/api-client.js'; import { formatOutput } from '../../utils/output-formatter.js'; /** - * `os environments show ` — show detailed information for a single project. + * `os environments show ` — show detailed information for a single environment. * - * Renders the project row plus its database, active credential, and + * Renders the environment row plus its database, active credential, and * membership row (same shape as `client.projects.get(id)`). */ export default class EnvironmentsShow extends Command { diff --git a/packages/cli/src/commands/environments/switch.ts b/packages/cli/src/commands/environments/switch.ts index 0750425157..b0e10b293e 100644 --- a/packages/cli/src/commands/environments/switch.ts +++ b/packages/cli/src/commands/environments/switch.ts @@ -6,13 +6,13 @@ import { createApiClient, requireAuth } from '../../utils/api-client.js'; import { readAuthConfig, writeAuthConfig } from '../../utils/auth-config.js'; /** - * `os environments switch ` — set the active project for this CLI session. + * `os environments switch ` — set the active environment for this CLI session. * * Calls `POST /api/v1/cloud/environments/:id/activate` to update the * server-side session, then persists `activeEnvironmentId` into * `~/.objectstack/credentials.json` so subsequent CLI commands (and any * client they create via `createApiClient`) automatically target this - * project. + * environment. */ export default class EnvironmentsSwitch extends Command { static override description = 'Activate an environment for subsequent CLI calls'; diff --git a/packages/cli/src/utils/api-client.ts b/packages/cli/src/utils/api-client.ts index 6213c0d7bf..393e44e7ee 100644 --- a/packages/cli/src/utils/api-client.ts +++ b/packages/cli/src/utils/api-client.ts @@ -16,7 +16,7 @@ export interface ApiClientOptions { */ token?: string; /** - * Explicit project id. Overrides the stored `activeEnvironmentId` from + * Explicit environment id. Overrides the stored `activeEnvironmentId` from * `~/.objectstack/credentials.json` (written by `os environments switch`). */ environmentId?: string; @@ -52,7 +52,7 @@ export async function createApiClient(options: ApiClientOptions = {}): Promise env > stored credentials) + // Resolve active environment id (explicit > env > stored credentials) let environmentId = options.environmentId || process.env.OS_ENVIRONMENT_ID; // If URL or token is missing, try to load from stored credentials