@revos/cli 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/README.md +33 -9
  2. package/dist/adapters/oclif/commands/action-runs/get.mjs +1 -1
  3. package/dist/adapters/oclif/commands/action-runs/list.mjs +1 -1
  4. package/dist/adapters/oclif/commands/actions/get-input-schema.mjs +2 -2
  5. package/dist/adapters/oclif/commands/actions/get-params-schema.mjs +2 -2
  6. package/dist/adapters/oclif/commands/actions/get.mjs +1 -1
  7. package/dist/adapters/oclif/commands/actions/list.mjs +2 -2
  8. package/dist/adapters/oclif/commands/ai-instructions/create.mjs +1 -1
  9. package/dist/adapters/oclif/commands/ai-instructions/delete.mjs +1 -1
  10. package/dist/adapters/oclif/commands/ai-instructions/get.mjs +1 -1
  11. package/dist/adapters/oclif/commands/ai-instructions/list.mjs +1 -1
  12. package/dist/adapters/oclif/commands/ai-instructions/update.mjs +1 -1
  13. package/dist/adapters/oclif/commands/api.mjs +2 -2
  14. package/dist/adapters/oclif/commands/apply.d.mts +3 -2
  15. package/dist/adapters/oclif/commands/apply.mjs +2 -2
  16. package/dist/adapters/oclif/commands/auth/login.d.mts +3 -2
  17. package/dist/adapters/oclif/commands/auth/login.mjs +9 -3
  18. package/dist/adapters/oclif/commands/auth/logout.d.mts +2 -1
  19. package/dist/adapters/oclif/commands/auth/logout.mjs +3 -2
  20. package/dist/adapters/oclif/commands/auth/status.d.mts +4 -2
  21. package/dist/adapters/oclif/commands/auth/status.mjs +23 -3
  22. package/dist/adapters/oclif/commands/connections/create.mjs +1 -1
  23. package/dist/adapters/oclif/commands/connections/delete.mjs +1 -1
  24. package/dist/adapters/oclif/commands/connections/get.mjs +1 -1
  25. package/dist/adapters/oclif/commands/connections/list.mjs +1 -1
  26. package/dist/adapters/oclif/commands/connections/update.mjs +1 -1
  27. package/dist/adapters/oclif/commands/cubes/create.mjs +1 -1
  28. package/dist/adapters/oclif/commands/cubes/delete.mjs +1 -1
  29. package/dist/adapters/oclif/commands/cubes/get.mjs +1 -1
  30. package/dist/adapters/oclif/commands/cubes/list.mjs +1 -1
  31. package/dist/adapters/oclif/commands/cubes/update.mjs +1 -1
  32. package/dist/adapters/oclif/commands/diff.d.mts +3 -2
  33. package/dist/adapters/oclif/commands/diff.mjs +2 -2
  34. package/dist/adapters/oclif/commands/gservice-account-keys/get.mjs +1 -1
  35. package/dist/adapters/oclif/commands/gservice-account-keys/reveal.mjs +2 -2
  36. package/dist/adapters/oclif/commands/gservice-accounts/create.mjs +1 -1
  37. package/dist/adapters/oclif/commands/gservice-accounts/delete.mjs +1 -1
  38. package/dist/adapters/oclif/commands/gservice-accounts/get.mjs +1 -1
  39. package/dist/adapters/oclif/commands/gservice-accounts/list.mjs +1 -1
  40. package/dist/adapters/oclif/commands/init.d.mts +4 -1
  41. package/dist/adapters/oclif/commands/init.mjs +83 -3
  42. package/dist/adapters/oclif/commands/org/create.mjs +3 -2
  43. package/dist/adapters/oclif/commands/org/current.d.mts +12 -3
  44. package/dist/adapters/oclif/commands/org/current.mjs +27 -2
  45. package/dist/adapters/oclif/commands/org/get.mjs +3 -2
  46. package/dist/adapters/oclif/commands/org/list.mjs +15 -6
  47. package/dist/adapters/oclif/commands/org/switch.d.mts +3 -2
  48. package/dist/adapters/oclif/commands/org/switch.mjs +8 -2
  49. package/dist/adapters/oclif/commands/pull.d.mts +3 -2
  50. package/dist/adapters/oclif/commands/pull.mjs +2 -2
  51. package/dist/adapters/oclif/commands/score-groups/create.mjs +1 -1
  52. package/dist/adapters/oclif/commands/score-groups/delete.mjs +1 -1
  53. package/dist/adapters/oclif/commands/score-groups/get.mjs +1 -1
  54. package/dist/adapters/oclif/commands/score-groups/list.mjs +1 -1
  55. package/dist/adapters/oclif/commands/score-groups/update.mjs +1 -1
  56. package/dist/adapters/oclif/commands/scores/create.mjs +1 -1
  57. package/dist/adapters/oclif/commands/scores/delete.mjs +1 -1
  58. package/dist/adapters/oclif/commands/scores/list.mjs +1 -1
  59. package/dist/adapters/oclif/commands/scores/update.mjs +1 -1
  60. package/dist/adapters/oclif/commands/segments/create.mjs +1 -1
  61. package/dist/adapters/oclif/commands/segments/delete.mjs +1 -1
  62. package/dist/adapters/oclif/commands/segments/evaluate.mjs +2 -2
  63. package/dist/adapters/oclif/commands/segments/get-evaluation-history.mjs +2 -2
  64. package/dist/adapters/oclif/commands/segments/get-version.mjs +2 -2
  65. package/dist/adapters/oclif/commands/segments/get.mjs +1 -1
  66. package/dist/adapters/oclif/commands/segments/list-versions.mjs +2 -2
  67. package/dist/adapters/oclif/commands/segments/list.mjs +1 -1
  68. package/dist/adapters/oclif/commands/segments/restore-version.mjs +2 -2
  69. package/dist/adapters/oclif/commands/segments/update.mjs +1 -1
  70. package/dist/adapters/oclif/commands/sources/create.d.mts +1 -1
  71. package/dist/adapters/oclif/commands/sources/create.mjs +2 -2
  72. package/dist/adapters/oclif/commands/sources/delete.mjs +1 -1
  73. package/dist/adapters/oclif/commands/sources/get.mjs +1 -1
  74. package/dist/adapters/oclif/commands/sources/list-streams.mjs +2 -2
  75. package/dist/adapters/oclif/commands/sources/list.mjs +1 -1
  76. package/dist/adapters/oclif/commands/sources/update.d.mts +1 -1
  77. package/dist/adapters/oclif/commands/sources/update.mjs +2 -2
  78. package/dist/adapters/oclif/commands/status.d.mts +3 -2
  79. package/dist/adapters/oclif/commands/status.mjs +3 -3
  80. package/dist/adapters/oclif/commands/table-views/create.mjs +1 -1
  81. package/dist/adapters/oclif/commands/table-views/delete.mjs +1 -1
  82. package/dist/adapters/oclif/commands/table-views/list.mjs +1 -1
  83. package/dist/adapters/oclif/commands/table-views/update.mjs +1 -1
  84. package/dist/adapters/oclif/commands/tables/create.mjs +1 -1
  85. package/dist/adapters/oclif/commands/tables/delete.mjs +1 -1
  86. package/dist/adapters/oclif/commands/tables/get.mjs +1 -1
  87. package/dist/adapters/oclif/commands/tables/list.mjs +1 -1
  88. package/dist/adapters/oclif/commands/tables/update.mjs +1 -1
  89. package/dist/{base.command-cV5d65r8.mjs → base.command-BLken6pU.mjs} +20 -2
  90. package/dist/{base.command-D7X3ZNtY.d.mts → base.command-BmddDbHa.d.mts} +4 -0
  91. package/dist/context-D5uelKLe.d.mts +62 -0
  92. package/dist/{core-CMrP5BQS.mjs → core-DsGA_HuL.mjs} +102 -4
  93. package/dist/{factory-C6XLqhT9.mjs → factory-eslVs9tN.mjs} +3 -2
  94. package/dist/{index-BqKwXXAo.d.mts → index-Blr5iiwc.d.mts} +37 -42
  95. package/dist/index.d.mts +4 -3
  96. package/dist/index.mjs +2 -2
  97. package/dist/{presets-CJbFbHlw.mjs → presets-D0AIVsGO.mjs} +7 -2
  98. package/dist/templates/.devcontainer/Dockerfile +17 -0
  99. package/dist/templates/.devcontainer/devcontainer.json +14 -10
  100. package/dist/templates/.devcontainer/post-create.sh +46 -0
  101. package/dist/templates/.devcontainer/post-start.sh +65 -0
  102. package/dist/templates/.devcontainer/welcome.sh +27 -0
  103. package/dist/templates/README.md +81 -12
  104. package/dist/templates/gitignore +3 -1
  105. package/dist/{types-CGjxcj4L.d.mts → types-Bk2Cb5yt.d.mts} +6 -0
  106. package/package.json +1 -1
  107. package/dist/templates/.devcontainer/setup.sh +0 -35
package/README.md CHANGED
@@ -24,10 +24,22 @@ revos [command] [options]
24
24
  ## Global Options
25
25
 
26
26
  ```
27
- -o, --org <id> Override organization ID for this command
27
+ -o, --org <id> Override organization ID. Only accepted OUTSIDE a project —
28
+ inside a project, the org is anchored in revos.yaml and
29
+ --org is rejected.
28
30
  --json Format output as JSON
29
31
  ```
30
32
 
33
+ ## Project context and the org
34
+
35
+ The CLI walks up from the current directory looking for `revos.yaml` on every command. When it finds one:
36
+
37
+ - `revos apply / pull / diff / status` and every resource command (`connections`, `cubes`, `tables`, …) target `metadata.orgId` from `revos.yaml`. This is authoritative.
38
+ - `--org` and `REVOS_ORG_ID` are validated against `revos.yaml`. A mismatch is a hard error — this prevents a Dev Container generated for org A from silently writing to org B when you switch contexts.
39
+ - Your stored global default (`revos org switch`) is informational only inside a project. The CLI warns if it differs from the project's org but uses the project's org for actual API calls.
40
+
41
+ Outside a project, the CLI uses `REVOS_ORG_ID` (env), then `--org`, then your stored global default (`revos org switch`). `revos init`, `revos auth *`, and `revos org *` skip the strict in-project enforcement so you can still log in, list, or switch orgs from inside a project tree.
42
+
31
43
  ## Commands
32
44
 
33
45
  ### Project Initialization
@@ -61,19 +73,25 @@ destination Path or project name (default: current directory)
61
73
 
62
74
  If the destination already exists and is not empty, you will be prompted to confirm before proceeding. Use `--yes` to skip this prompt.
63
75
 
64
- **What it does:**
76
+ **What it does (greenfield — no `revos.yaml` discovered):**
65
77
 
66
78
  1. Fetches your organizations and prompts you to select one (auto-selects if only one).
67
79
  2. Provisions a GCP service account for your org (idempotent) and writes the key to `~/.revos/{project-name}-gsa-creds.json`.
68
80
  3. Writes `revos.yaml` — the project marker that pins this directory to your organization. CLI commands like `revos status` walk up from the current directory to find this file.
69
81
  4. Creates the project directory structure (medallion layout: bronze/silver/gold).
70
- 5. Generates `.devcontainer/devcontainer.json` with Python 3.11, Node.js, Google Cloud SDK (`bq`), and dbt pre-installed. The Dev Container mounts `~/.revos/{project-name}-gsa-creds.json` automatically.
82
+ 5. Generates `.devcontainer/` (`devcontainer.json`, `Dockerfile`, `post-create.sh`, `post-start.sh`, `welcome.sh`) with Python, Node.js, Google Cloud SDK (`bq`), GitHub CLI (`gh`), `jq`, and dbt pre-installed. The Dev Container persists three per-project named Docker volumes — `revos-{slug}-credentials` (`~/.revos`), `revos-{slug}-gcloud` (`~/.config/gcloud`), and `revos-{slug}-claude` (`~/.claude`) — so CLI login, GSA key, gcloud auth state, and Claude Code state all survive `Rebuild Container`. No host bind mounts.
71
83
  6. Generates `dbt/profiles.yml` pre-configured for BigQuery.
72
84
  7. Generates `.gitignore` and `README.md`.
73
85
  8. Scaffolds AI companion files: `CLAUDE.md`, `AGENTS.md`, and `.claude/skills/` with six pre-installed skills: `explore-lakehouse`, `create-connections`, `create-cubes`, `create-dbt-transformations`, `load-sample-data`, and `visualize-semantic-model`. Also writes `.claude/settings.json` with deny rules that block AI assistants from reading `~/.revos/` (CLI credentials and service account keys), `~/.config/gcloud/` (Google Cloud Application Default Credentials), from running `gcloud auth print-*-token` commands, and from editing the settings file itself (so the AI can't lift its own restrictions).
74
86
  9. Discovers every Connection and Cube currently in the org and writes them under `connections/` and `cubes/` so a developer joining an org with existing pipelines and cubes starts from the live state. Pass `--no-pull` to skip. Sources are managed only through the API surface (see [Sources](#sources)) and are referenced from Connection YAML by their server id.
75
87
 
76
- **Requires:** `revos auth login` first.
88
+ **What it does (in-project — re-run inside an existing `revos.yaml` tree):**
89
+
90
+ `revos init` becomes idempotent: it skips the org prompt, skips scaffolding (no overwriting of existing files), skips IaC discovery, and only provisions the GCP service account key if `~/.revos/{project-name}-gsa-creds.json` is missing. Useful inside the Dev Container — the named volume starts empty, so after `revos auth login` you run `revos init` to materialize the GSA key. Outside the container, re-running is a safe no-op if everything is already in place.
91
+
92
+ **Dev Container onboarding flow:** open project in VS Code → "Reopen in Container" → run `revos auth login` → run `revos init`. Subsequent container starts auto-activate the service account via `postStartCommand`.
93
+
94
+ **Requires:** `revos auth login` first (greenfield), or in-container login (in-project).
77
95
 
78
96
  ---
79
97
 
@@ -278,6 +296,12 @@ The CLI walks up from the current working directory to find `revos.yaml` (or set
278
296
  revos auth login
279
297
  ```
280
298
 
299
+ After the OAuth flow completes, the CLI picks your default organization:
300
+
301
+ - **Inside a project** (`revos.yaml` discovered) — uses `metadata.orgId` from `revos.yaml`; no prompt.
302
+ - **Outside a project, one org** — auto-selects it.
303
+ - **Outside a project, multiple orgs** — prompts you to pick.
304
+
281
305
  #### Logout
282
306
 
283
307
  ```bash
@@ -494,8 +518,8 @@ revos status --columns address,state,id
494
518
 
495
519
  ## Configuration
496
520
 
497
- | Variable | Description |
498
- | --------------- | -------------------------------------------------------- |
499
- | `REVOS_TOKEN` | Authentication token (alternative to `revos auth login`) |
500
- | `REVOS_API_URL` | API endpoint (default: `https://api.revos.ai`) |
501
- | `REVOS_ORG_ID` | Organization ID override |
521
+ | Variable | Description |
522
+ | --------------- | ------------------------------------------------------------------------------------------------------------------ |
523
+ | `REVOS_TOKEN` | Authentication token (alternative to `revos auth login`) |
524
+ | `REVOS_API_URL` | API endpoint (default: `https://api.revos.ai`) |
525
+ | `REVOS_ORG_ID` | Organization ID override. Inside a project, must match `metadata.orgId` in `revos.yaml`; mismatch is a hard error. |
@@ -1,4 +1,4 @@
1
- import { r as getCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { r as getCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/action-runs/get.ts
3
3
  var get_default = getCommand({
4
4
  resource: "actionRuns",
@@ -1,4 +1,4 @@
1
- import { i as listCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { i as listCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/action-runs/list.ts
3
3
  var list_default = listCommand({
4
4
  resource: "actionRuns",
@@ -1,5 +1,5 @@
1
- import { p as unwrap } from "../../../../core-CMrP5BQS.mjs";
2
- import { r as defineApiCommand } from "../../../../factory-C6XLqhT9.mjs";
1
+ import { x as unwrap } from "../../../../core-DsGA_HuL.mjs";
2
+ import { r as defineApiCommand } from "../../../../factory-eslVs9tN.mjs";
3
3
  import { Args, Flags } from "@oclif/core";
4
4
  //#region src/adapters/oclif/commands/actions/get-input-schema.ts
5
5
  var get_input_schema_default = defineApiCommand({
@@ -1,5 +1,5 @@
1
- import { p as unwrap } from "../../../../core-CMrP5BQS.mjs";
2
- import { r as defineApiCommand } from "../../../../factory-C6XLqhT9.mjs";
1
+ import { x as unwrap } from "../../../../core-DsGA_HuL.mjs";
2
+ import { r as defineApiCommand } from "../../../../factory-eslVs9tN.mjs";
3
3
  import { Args, Flags } from "@oclif/core";
4
4
  //#region src/adapters/oclif/commands/actions/get-params-schema.ts
5
5
  var get_params_schema_default = defineApiCommand({
@@ -1,4 +1,4 @@
1
- import { r as getCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { r as getCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/actions/get.ts
3
3
  var get_default = getCommand({
4
4
  resource: "actions",
@@ -1,5 +1,5 @@
1
- import { p as unwrap } from "../../../../core-CMrP5BQS.mjs";
2
- import { n as createListRender, r as defineApiCommand } from "../../../../factory-C6XLqhT9.mjs";
1
+ import { x as unwrap } from "../../../../core-DsGA_HuL.mjs";
2
+ import { n as createListRender, r as defineApiCommand } from "../../../../factory-eslVs9tN.mjs";
3
3
  import { Flags } from "@oclif/core";
4
4
  var list_default = defineApiCommand({
5
5
  description: "List available actions",
@@ -1,4 +1,4 @@
1
- import { t as createCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { t as createCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/ai-instructions/create.ts
3
3
  var create_default = createCommand({
4
4
  resource: "aiInstructions",
@@ -1,4 +1,4 @@
1
- import { n as deleteCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { n as deleteCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/ai-instructions/delete.ts
3
3
  var delete_default = deleteCommand({
4
4
  resource: "aiInstructions",
@@ -1,4 +1,4 @@
1
- import { r as getCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { r as getCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/ai-instructions/get.ts
3
3
  var get_default = getCommand({
4
4
  resource: "aiInstructions",
@@ -1,4 +1,4 @@
1
- import { i as listCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { i as listCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/ai-instructions/list.ts
3
3
  var list_default = listCommand({
4
4
  resource: "aiInstructions",
@@ -1,4 +1,4 @@
1
- import { a as updateCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { a as updateCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/ai-instructions/update.ts
3
3
  var update_default = updateCommand({
4
4
  resource: "aiInstructions",
@@ -1,5 +1,5 @@
1
- import { F as ApiError } from "../../../core-CMrP5BQS.mjs";
2
- import { r as defineApiCommand, t as bodyFlag } from "../../../factory-C6XLqhT9.mjs";
1
+ import { U as ApiError } from "../../../core-DsGA_HuL.mjs";
2
+ import { r as defineApiCommand, t as bodyFlag } from "../../../factory-eslVs9tN.mjs";
3
3
  import { client } from "@revos/api-client";
4
4
  import { Args, Flags } from "@oclif/core";
5
5
  //#region src/adapters/oclif/commands/api.ts
@@ -1,5 +1,6 @@
1
- import { c as IacError, s as AppliedResource } from "../../../index-BqKwXXAo.mjs";
2
- import { t as BaseCommand } from "../../../base.command-D7X3ZNtY.mjs";
1
+ import { f as AppliedResource } from "../../../index-Blr5iiwc.mjs";
2
+ import { c as IacError } from "../../../context-D5uelKLe.mjs";
3
+ import { t as BaseCommand } from "../../../base.command-BmddDbHa.mjs";
3
4
  import * as _$_oclif_core_interfaces0 from "@oclif/core/interfaces";
4
5
 
5
6
  //#region src/adapters/oclif/commands/apply.d.ts
@@ -1,5 +1,5 @@
1
- import { d as projectRoot, f as createApiClient, l as buildIacRegistry, o as apply, u as discoverProject, v as getConfig } from "../../../core-CMrP5BQS.mjs";
2
- import { t as BaseCommand } from "../../../base.command-cV5d65r8.mjs";
1
+ import { E as getConfig, _ as buildIacRegistry, b as createApiClient, m as apply, v as discoverProject, y as projectRoot } from "../../../core-DsGA_HuL.mjs";
2
+ import { t as BaseCommand } from "../../../base.command-BLken6pU.mjs";
3
3
  import { n as renderIacErrors, t as APPLY_ACTION_LABELS } from "../../../iac-render-BSZZEP0n.mjs";
4
4
  import chalk from "chalk";
5
5
  import { Args, Flags } from "@oclif/core";
@@ -1,9 +1,10 @@
1
- import { t as AuthResult } from "../../../../types-CGjxcj4L.mjs";
2
- import { t as BaseCommand } from "../../../../base.command-D7X3ZNtY.mjs";
1
+ import { t as AuthResult } from "../../../../types-Bk2Cb5yt.mjs";
2
+ import { t as BaseCommand } from "../../../../base.command-BmddDbHa.mjs";
3
3
  import * as _$_oclif_core_interfaces0 from "@oclif/core/interfaces";
4
4
 
5
5
  //#region src/adapters/oclif/commands/auth/login.d.ts
6
6
  declare class AuthLogin extends BaseCommand<typeof AuthLogin> {
7
+ static projectContextMode: "relaxed";
7
8
  static description: string;
8
9
  static flags: {
9
10
  dev: _$_oclif_core_interfaces0.BooleanFlag<boolean>;
@@ -1,10 +1,11 @@
1
- import { C as getActiveAuthConfig, D as setAuthEnv, E as setAuthConfig, O as tokenResponseToCredentials, P as saveCredentials, S as generatePKCEChallenge, b as buildAuthorizationUrl, f as createApiClient, j as getCredentialsPath, k as startOAuthServer, n as selectOrganization, p as unwrap, w as getUserInfo, x as exchangeCodeForTokens, y as AUTH_ENVS } from "../../../../core-CMrP5BQS.mjs";
2
- import { t as BaseCommand } from "../../../../base.command-cV5d65r8.mjs";
1
+ import { A as generatePKCEChallenge, D as AUTH_ENVS, F as setAuthEnv, H as saveCredentials, I as tokenResponseToCredentials, L as startOAuthServer, M as getUserInfo, O as buildAuthorizationUrl, P as setAuthConfig, b as createApiClient, j as getActiveAuthConfig, k as exchangeCodeForTokens, l as resolveProjectContext, n as selectOrganization, x as unwrap, z as getCredentialsPath } from "../../../../core-DsGA_HuL.mjs";
2
+ import { t as BaseCommand } from "../../../../base.command-BLken6pU.mjs";
3
3
  import chalk from "chalk";
4
4
  import { Flags } from "@oclif/core";
5
5
  import open from "open";
6
6
  //#region src/adapters/oclif/commands/auth/login.ts
7
7
  var AuthLogin = class extends BaseCommand {
8
+ static projectContextMode = "relaxed";
8
9
  static description = "Authenticate with RevOS via browser";
9
10
  static flags = {
10
11
  dev: Flags.boolean({ description: "Authenticate against the development environment" }),
@@ -50,7 +51,12 @@ var AuthLogin = class extends BaseCommand {
50
51
  this.log(chalk.green(`\nAuthenticated as ${userInfo.email || userInfo.sub}`));
51
52
  this.log(`\nCredentials saved to ${getCredentialsPath()}`);
52
53
  }
53
- try {
54
+ const projectCtx = resolveProjectContext();
55
+ if (projectCtx) {
56
+ credentials.organizationId = projectCtx.orgId;
57
+ saveCredentials(credentials);
58
+ if (!this.jsonEnabled()) this.log(chalk.green(`\nUsing organization from revos.yaml: ${projectCtx.orgId}`));
59
+ } else try {
54
60
  const orgs = unwrap(await createApiClient({
55
61
  apiUrl,
56
62
  token: tokenResponse.access_token
@@ -1,8 +1,9 @@
1
- import { t as BaseCommand } from "../../../../base.command-D7X3ZNtY.mjs";
1
+ import { t as BaseCommand } from "../../../../base.command-BmddDbHa.mjs";
2
2
 
3
3
  //#region src/adapters/oclif/commands/auth/logout.d.ts
4
4
  declare class AuthLogout extends BaseCommand<typeof AuthLogout> {
5
5
  static description: string;
6
+ static projectContextMode: "relaxed";
6
7
  run(): Promise<{
7
8
  deleted: boolean;
8
9
  }>;
@@ -1,9 +1,10 @@
1
- import { A as deleteCredentials } from "../../../../core-CMrP5BQS.mjs";
2
- import { t as BaseCommand } from "../../../../base.command-cV5d65r8.mjs";
1
+ import { R as deleteCredentials } from "../../../../core-DsGA_HuL.mjs";
2
+ import { t as BaseCommand } from "../../../../base.command-BLken6pU.mjs";
3
3
  import * as os from "os";
4
4
  //#region src/adapters/oclif/commands/auth/logout.ts
5
5
  var AuthLogout = class extends BaseCommand {
6
6
  static description = "Remove stored authentication credentials";
7
+ static projectContextMode = "relaxed";
7
8
  async run() {
8
9
  const deleted = deleteCredentials();
9
10
  if (!this.jsonEnabled()) {
@@ -1,11 +1,13 @@
1
- import { n as AuthStatusInfo } from "../../../../types-CGjxcj4L.mjs";
2
- import { t as BaseCommand } from "../../../../base.command-D7X3ZNtY.mjs";
1
+ import { n as AuthStatusInfo } from "../../../../types-Bk2Cb5yt.mjs";
2
+ import { t as BaseCommand } from "../../../../base.command-BmddDbHa.mjs";
3
3
 
4
4
  //#region src/adapters/oclif/commands/auth/status.d.ts
5
5
  declare class AuthStatus extends BaseCommand<typeof AuthStatus> {
6
6
  static description: string;
7
+ static projectContextMode: "relaxed";
7
8
  run(): Promise<AuthStatusInfo>;
8
9
  private renderStatus;
10
+ private renderProject;
9
11
  }
10
12
  //#endregion
11
13
  export { AuthStatus as default };
@@ -1,12 +1,14 @@
1
- import { M as isTokenExpired, N as loadCredentials, j as getCredentialsPath } from "../../../../core-CMrP5BQS.mjs";
2
- import { t as BaseCommand } from "../../../../base.command-cV5d65r8.mjs";
1
+ import { B as isTokenExpired, V as loadCredentials, l as resolveProjectContext, z as getCredentialsPath } from "../../../../core-DsGA_HuL.mjs";
2
+ import { t as BaseCommand } from "../../../../base.command-BLken6pU.mjs";
3
3
  import chalk from "chalk";
4
4
  //#region src/adapters/oclif/commands/auth/status.ts
5
5
  var AuthStatus = class extends BaseCommand {
6
6
  static description = "Show current authentication status";
7
+ static projectContextMode = "relaxed";
7
8
  async run() {
8
9
  const envToken = process.env.REVOS_TOKEN;
9
10
  const storedCredentials = loadCredentials();
11
+ const projectContext = resolveProjectContext();
10
12
  let status;
11
13
  if (envToken) status = {
12
14
  authenticated: true,
@@ -25,6 +27,12 @@ var AuthStatus = class extends BaseCommand {
25
27
  };
26
28
  if (!this.jsonEnabled() && expired) this.warn("Token has expired. Please run 'revos auth login' to re-authenticate.");
27
29
  } else status = { authenticated: false };
30
+ if (projectContext) status.project = {
31
+ name: projectContext.projectFile.metadata.name,
32
+ path: projectContext.projectFile.path,
33
+ orgId: projectContext.orgId,
34
+ inSyncWithGlobal: !storedCredentials?.organizationId || storedCredentials.organizationId === projectContext.orgId
35
+ };
28
36
  if (!this.jsonEnabled()) this.renderStatus(status);
29
37
  return status;
30
38
  }
@@ -32,6 +40,7 @@ var AuthStatus = class extends BaseCommand {
32
40
  if (!status.authenticated) {
33
41
  this.log(chalk.yellow("Not authenticated"));
34
42
  this.log(chalk.gray("\nRun 'revos auth login' to authenticate."));
43
+ this.renderProject(status);
35
44
  return;
36
45
  }
37
46
  this.log(chalk.bold("Authentication Status:\n"));
@@ -49,9 +58,20 @@ var AuthStatus = class extends BaseCommand {
49
58
  }
50
59
  if (status.organizationId) {
51
60
  const orgDisplay = status.organizationName ? `${status.organizationName} (${status.organizationId})` : status.organizationId;
52
- this.log(` Organization: ${orgDisplay}`);
61
+ const label = status.project ? "Global default" : "Organization";
62
+ this.log(` ${label}: ${orgDisplay}`);
53
63
  }
54
64
  if (status.credentialsPath) this.log(chalk.gray(`\n Credentials: ${status.credentialsPath}`));
65
+ this.renderProject(status);
66
+ }
67
+ renderProject(status) {
68
+ if (!status.project) return;
69
+ this.log("");
70
+ this.log(chalk.bold("Project:") + ` ${status.project.name ?? "(unnamed)"}`);
71
+ this.log(chalk.gray(` Path: ${status.project.path}`));
72
+ this.log(` Org: ${status.project.orgId}`);
73
+ if (!status.project.inSyncWithGlobal) this.log(chalk.yellow(` ⚠ Differs from your global default — apply/pull/diff use this project's org.`));
74
+ else this.log(chalk.gray(` ✓ In sync with global default`));
55
75
  }
56
76
  };
57
77
  //#endregion
@@ -1,4 +1,4 @@
1
- import { t as createCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { t as createCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/connections/create.ts
3
3
  var create_default = createCommand({
4
4
  resource: "connections",
@@ -1,4 +1,4 @@
1
- import { n as deleteCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { n as deleteCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/connections/delete.ts
3
3
  var delete_default = deleteCommand({
4
4
  resource: "connections",
@@ -1,4 +1,4 @@
1
- import { r as getCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { r as getCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/connections/get.ts
3
3
  var get_default = getCommand({
4
4
  resource: "connections",
@@ -1,4 +1,4 @@
1
- import { i as listCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { i as listCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/connections/list.ts
3
3
  var list_default = listCommand({
4
4
  resource: "connections",
@@ -1,4 +1,4 @@
1
- import { a as updateCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { a as updateCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/connections/update.ts
3
3
  var update_default = updateCommand({
4
4
  resource: "connections",
@@ -1,4 +1,4 @@
1
- import { t as createCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { t as createCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/cubes/create.ts
3
3
  var create_default = createCommand({
4
4
  resource: "cubes",
@@ -1,4 +1,4 @@
1
- import { n as deleteCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { n as deleteCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/cubes/delete.ts
3
3
  var delete_default = deleteCommand({
4
4
  resource: "cubes",
@@ -1,4 +1,4 @@
1
- import { r as getCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { r as getCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/cubes/get.ts
3
3
  var get_default = getCommand({
4
4
  resource: "cubes",
@@ -1,4 +1,4 @@
1
- import { i as listCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { i as listCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/cubes/list.ts
3
3
  var list_default = listCommand({
4
4
  resource: "cubes",
@@ -1,4 +1,4 @@
1
- import { a as updateCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { a as updateCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/cubes/update.ts
3
3
  var update_default = updateCommand({
4
4
  resource: "cubes",
@@ -1,5 +1,6 @@
1
- import { c as IacError, s as AppliedResource } from "../../../index-BqKwXXAo.mjs";
2
- import { t as BaseCommand } from "../../../base.command-D7X3ZNtY.mjs";
1
+ import { f as AppliedResource } from "../../../index-Blr5iiwc.mjs";
2
+ import { c as IacError } from "../../../context-D5uelKLe.mjs";
3
+ import { t as BaseCommand } from "../../../base.command-BmddDbHa.mjs";
3
4
  import * as _$_oclif_core_interfaces0 from "@oclif/core/interfaces";
4
5
 
5
6
  //#region src/adapters/oclif/commands/diff.d.ts
@@ -1,5 +1,5 @@
1
- import { d as projectRoot, f as createApiClient, l as buildIacRegistry, o as apply, s as formatDiffLine, u as discoverProject, v as getConfig } from "../../../core-CMrP5BQS.mjs";
2
- import { t as BaseCommand } from "../../../base.command-cV5d65r8.mjs";
1
+ import { E as getConfig, _ as buildIacRegistry, b as createApiClient, h as formatDiffLine, m as apply, v as discoverProject, y as projectRoot } from "../../../core-DsGA_HuL.mjs";
2
+ import { t as BaseCommand } from "../../../base.command-BLken6pU.mjs";
3
3
  import { n as renderIacErrors, t as APPLY_ACTION_LABELS } from "../../../iac-render-BSZZEP0n.mjs";
4
4
  import chalk from "chalk";
5
5
  import { Args, Flags } from "@oclif/core";
@@ -1,4 +1,4 @@
1
- import { r as getCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { r as getCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/gservice-account-keys/get.ts
3
3
  var get_default = getCommand({
4
4
  resource: "gserviceAccountKeys",
@@ -1,5 +1,5 @@
1
- import { p as unwrap } from "../../../../core-CMrP5BQS.mjs";
2
- import { r as defineApiCommand } from "../../../../factory-C6XLqhT9.mjs";
1
+ import { x as unwrap } from "../../../../core-DsGA_HuL.mjs";
2
+ import { r as defineApiCommand } from "../../../../factory-eslVs9tN.mjs";
3
3
  import { Args } from "@oclif/core";
4
4
  //#region src/adapters/oclif/commands/gservice-account-keys/reveal.ts
5
5
  var reveal_default = defineApiCommand({
@@ -1,4 +1,4 @@
1
- import { t as createCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { t as createCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/gservice-accounts/create.ts
3
3
  var create_default = createCommand({
4
4
  resource: "gserviceAccounts",
@@ -1,4 +1,4 @@
1
- import { n as deleteCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { n as deleteCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/gservice-accounts/delete.ts
3
3
  var delete_default = deleteCommand({
4
4
  resource: "gserviceAccounts",
@@ -1,4 +1,4 @@
1
- import { r as getCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { r as getCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/gservice-accounts/get.ts
3
3
  var get_default = getCommand({
4
4
  resource: "gserviceAccounts",
@@ -1,4 +1,4 @@
1
- import { i as listCommand } from "../../../../presets-CJbFbHlw.mjs";
1
+ import { i as listCommand } from "../../../../presets-D0AIVsGO.mjs";
2
2
  //#region src/adapters/oclif/commands/gservice-accounts/list.ts
3
3
  var list_default = listCommand({
4
4
  resource: "gserviceAccounts",
@@ -1,9 +1,10 @@
1
- import { t as BaseCommand } from "../../../base.command-D7X3ZNtY.mjs";
1
+ import { t as BaseCommand } from "../../../base.command-BmddDbHa.mjs";
2
2
  import * as _$_oclif_core_interfaces0 from "@oclif/core/interfaces";
3
3
 
4
4
  //#region src/adapters/oclif/commands/init.d.ts
5
5
  declare class Init extends BaseCommand<typeof Init> {
6
6
  static description: string;
7
+ static projectContextMode: "relaxed";
7
8
  static args: {
8
9
  destination: _$_oclif_core_interfaces0.Arg<string | undefined, Record<string, unknown>>;
9
10
  };
@@ -13,6 +14,8 @@ declare class Init extends BaseCommand<typeof Init> {
13
14
  "no-pull": _$_oclif_core_interfaces0.BooleanFlag<boolean>;
14
15
  };
15
16
  run(): Promise<void>;
17
+ private runInProject;
18
+ private activateGcloudInContainer;
16
19
  }
17
20
  //#endregion
18
21
  export { Init as default };