Skip to content

Commit 7fa3851

Browse files
os-litantclaude
andauthored
fix(cli): name the entity an environment in every string the os environments family prints (#12429)
ADR-0006's v5.0 rename `project` -> `environment` has no aliases, and AGENTS.md states "Project now only means the npm/monorepo sense". #10967 (PR #11227) renamed the COMMAND across these same five files; the ENTITY NOUN inside the strings oclif prints was left behind, so `os environments switch <id>` answered `Active project: ...`. 25 user-visible string literals swap to the post-rename noun: 5 `static override description`, 7 flag/arg descriptions, 9 success-path console lines, 3 `examples` arg placeholders (`<project-id>` -> `<environment-id>`) and the `switch` id-not-found error. No behaviour, flag/argument names, exit codes or `--format json`/`yaml` payloads change. `client.projects.*`, the `res.project`/`res.projects` response fields, the locals bound from them and the docblock comments are deliberately untouched: they are API surface in other packages, not CLI wording. Claude-Session: https://claude.ai/code/session_01UjujZN219uFzBhSYfMykCd Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5150053 commit 7fa3851

6 files changed

Lines changed: 59 additions & 25 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
"@objectstack/cli": patch
3+
---
4+
5+
fix(cli): the `os environments` family calls the entity an environment, not a project, in every string it prints (#12153)
6+
7+
Per ADR-0006 the v5.0 rename `project``environment` has no aliases, and AGENTS.md
8+
states "Project now only means the npm/monorepo sense". #10967 (PR #11227) renamed the
9+
**command** (`os projects …``os environments …`) across these same five files; the
10+
**entity noun** inside the strings oclif prints was left behind. A user ran
11+
`os environments switch <id>` and the tool answered `✓ Active project: …`.
12+
13+
25 user-visible string literals in `packages/cli/src/commands/environments/` are swapped
14+
to the post-rename noun. No behaviour, no flag or argument names, no exit codes, and no
15+
`--format json` / `--format yaml` payloads change — those are produced by
16+
`formatOutput(res, …)` straight from the control-plane response and are untouched.
17+
18+
| where | count | printed by |
19+
| --- | --- | --- |
20+
| `static override description` | 5 | `os environments --help` |
21+
| flag / arg `description` | 7 | each command's own `--help` |
22+
| success-path console output | 9 | `list` · `bind` · `create` · `show` · `switch` |
23+
| `examples` arg placeholder (`<project-id>``<environment-id>`) | 3 | `os environments bind --help` |
24+
| the `switch` id-not-found error | 1 | `os environments switch` on a bad id |
25+
26+
The five `static override description` strings now read as
27+
`content/docs/deployment/cli.mdx`'s command table has described them since the rename
28+
("List environments visible to the current session", "Provision a new environment", …),
29+
so the shipped `--help` and the shipped docs agree for the first time.
30+
31+
What is deliberately NOT renamed, because it is API surface in other packages rather than
32+
CLI wording, and each needs its own decision: `client.projects.*` (the `@objectstack/client`
33+
SDK method names), the `res.project` / `res.projects` response fields, the locals bound
34+
directly from them, and the docblock comments in these files.

packages/cli/src/commands/environments/bind.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ import { formatOutput } from '../../utils/output-formatter.js';
2121
* reflects the latest source.
2222
*/
2323
export default class EnvironmentsBind extends Command {
24-
static override description = 'Bind a local objectstack artifact to an existing project';
24+
static override description = 'Bind a local objectstack artifact to an existing environment';
2525

2626
static override examples = [
27-
'$ os environments bind <project-id> --artifact ./dist/objectstack.json',
28-
'$ os environments bind <project-id> --artifact ./dist/objectstack.json --build',
29-
'$ os environments bind <project-id> --reseed',
27+
'$ os environments bind <environment-id> --artifact ./dist/objectstack.json',
28+
'$ os environments bind <environment-id> --artifact ./dist/objectstack.json --build',
29+
'$ os environments bind <environment-id> --reseed',
3030
];
3131

3232
static override args = {
3333
environmentId: Args.string({
34-
description: 'Target project id (UUID)',
34+
description: 'Target environment id (UUID)',
3535
required: true,
3636
}),
3737
};
@@ -111,7 +111,7 @@ export default class EnvironmentsBind extends Command {
111111
delete existingMeta.artifactBindError;
112112
existingMeta.artifact_path = artifactAbs;
113113

114-
printKV('Project', args.environmentId, '🎯');
114+
printKV('Environment', args.environmentId, '🎯');
115115
printKV('Artifact', artifactAbs, '📦');
116116

117117
const res = await client.projects.update(args.environmentId, {
@@ -139,9 +139,9 @@ export default class EnvironmentsBind extends Command {
139139
} else if (flags.format === 'yaml') {
140140
await formatOutput(res, 'yaml');
141141
} else {
142-
console.log(`\n✓ Project bound to artifact`);
142+
console.log(`\n✓ Environment bound to artifact`);
143143
console.log(` ${args.environmentId}${artifactAbs}`);
144-
console.log(` The next request to this project will load the new bundle.`);
144+
console.log(` The next request to this environment will load the new bundle.`);
145145
console.log('');
146146
}
147147
} catch (error: any) {

packages/cli/src/commands/environments/create.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { readAuthConfig, writeAuthConfig } from '../../utils/auth-config.js';
1515
* (unless `--no-activate` is passed).
1616
*/
1717
export default class EnvironmentsCreate extends Command {
18-
static override description = 'Provision a new project';
18+
static override description = 'Provision a new environment';
1919

2020
static override examples = [
2121
'$ os environments create --org 00000000-0000-0000-0000-000000000000 --name Staging',
@@ -39,11 +39,11 @@ export default class EnvironmentsCreate extends Command {
3939
// the App Marketplace instead (`os package install`, `sys_package` with
4040
// `is_starter = true`).
4141
artifact: Flags.string({
42-
description: 'Path to a locally-compiled objectstack.json artifact to bind into this project',
42+
description: 'Path to a locally-compiled objectstack.json artifact to bind into this environment',
4343
}),
44-
'clone-from': Flags.string({ description: 'Clone schema from an existing project id' }),
44+
'clone-from': Flags.string({ description: 'Clone schema from an existing environment id' }),
4545
activate: Flags.boolean({
46-
description: 'Activate the new project for subsequent CLI calls',
46+
description: 'Activate the new environment for subsequent CLI calls',
4747
default: true,
4848
allowNo: true,
4949
}),
@@ -111,9 +111,9 @@ export default class EnvironmentsCreate extends Command {
111111
await formatOutput(res, 'yaml');
112112
} else {
113113
const p = res?.project ?? {};
114-
console.log(`\n✓ Project created: ${p.display_name ?? p.id} (${p.id})`);
114+
console.log(`\n✓ Environment created: ${p.display_name ?? p.id} (${p.id})`);
115115
if (flags.activate) {
116-
console.log(` active project set to ${p.id}`);
116+
console.log(` active environment set to ${p.id}`);
117117
}
118118
console.log('');
119119
}

packages/cli/src/commands/environments/list.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { formatOutput } from '../../utils/output-formatter.js';
1313
* consistent DX.
1414
*/
1515
export default class EnvironmentsList extends Command {
16-
static override description = 'List projects visible to the current session';
16+
static override description = 'List environments visible to the current session';
1717

1818
static override examples = [
1919
'$ os environments list',
@@ -25,7 +25,7 @@ export default class EnvironmentsList extends Command {
2525
url: Flags.string({ char: 'u', description: 'Server URL', env: 'OS_CLOUD_URL' }),
2626
token: Flags.string({ char: 't', description: 'Authentication token', env: 'OS_TOKEN' }),
2727
org: Flags.string({ description: 'Filter by organization id' }),
28-
status: Flags.string({ description: 'Filter by project status (active|provisioning|failed|…)' }),
28+
status: Flags.string({ description: 'Filter by environment status (active|provisioning|failed|…)' }),
2929
format: Flags.string({
3030
char: 'f',
3131
description: 'Output format',
@@ -57,9 +57,9 @@ export default class EnvironmentsList extends Command {
5757
} else if (flags.format === 'yaml') {
5858
await formatOutput(res, 'yaml');
5959
} else {
60-
console.log(`\nProjects (${projects.length}):\n`);
60+
console.log(`\nEnvironments (${projects.length}):\n`);
6161
if (projects.length === 0) {
62-
console.log(' (no projects)');
62+
console.log(' (no environments)');
6363
} else {
6464
for (const p of projects) {
6565
const active = p.id === activeId ? ' ★' : '';

packages/cli/src/commands/environments/show.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ import { formatOutput } from '../../utils/output-formatter.js';
1212
* membership row (same shape as `client.projects.get(id)`).
1313
*/
1414
export default class EnvironmentsShow extends Command {
15-
static override description = 'Show detailed information for a project';
15+
static override description = 'Show detailed information for an environment';
1616

1717
static override examples = [
1818
'$ os environments show 00000000-0000-0000-0000-000000000001',
1919
'$ os environments show proj-123 --format json',
2020
];
2121

2222
static override args = {
23-
id: Args.string({ description: 'Project id', required: true }),
23+
id: Args.string({ description: 'Environment id', required: true }),
2424
};
2525

2626
static override flags = {
@@ -49,7 +49,7 @@ export default class EnvironmentsShow extends Command {
4949
await formatOutput(res, 'yaml');
5050
} else {
5151
const p = res?.project ?? {};
52-
console.log(`\nProject: ${p.display_name ?? p.id}`);
52+
console.log(`\nEnvironment: ${p.display_name ?? p.id}`);
5353
console.log('─'.repeat(60));
5454
console.log(` id: ${p.id}`);
5555
console.log(` organization: ${p.organization_id ?? '—'}`);

packages/cli/src/commands/environments/switch.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ import { readAuthConfig, writeAuthConfig } from '../../utils/auth-config.js';
1515
* project.
1616
*/
1717
export default class EnvironmentsSwitch extends Command {
18-
static override description = 'Activate a project for subsequent CLI calls';
18+
static override description = 'Activate an environment for subsequent CLI calls';
1919

2020
static override examples = [
2121
'$ os environments switch 00000000-0000-0000-0000-000000000001',
2222
'$ os environments switch proj-123 --no-remote',
2323
];
2424

2525
static override args = {
26-
id: Args.string({ description: 'Project id to activate', required: true }),
26+
id: Args.string({ description: 'Environment id to activate', required: true }),
2727
};
2828

2929
static override flags = {
@@ -47,7 +47,7 @@ export default class EnvironmentsSwitch extends Command {
4747
const lookup = await client.projects.get(args.id);
4848
const project = lookup?.project;
4949
if (!project?.id) {
50-
throw new Error(`Project ${args.id} not found`);
50+
throw new Error(`Environment ${args.id} not found`);
5151
}
5252

5353
if (flags.remote) {
@@ -59,7 +59,7 @@ export default class EnvironmentsSwitch extends Command {
5959
cfg.lastUsedAt = new Date().toISOString();
6060
await writeAuthConfig(cfg);
6161

62-
console.log(`\n✓ Active project: ${project.display_name ?? project.id}`);
62+
console.log(`\n✓ Active environment: ${project.display_name ?? project.id}`);
6363
console.log(` id: ${project.id}`);
6464
if (!flags.remote) {
6565
console.log(' (local only — server session unchanged)');

0 commit comments

Comments
 (0)