@workser/cli 0.6.20 → 0.6.21

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.
package/dist/index.js CHANGED
@@ -4035,6 +4035,84 @@ built next.
4035
4035
  Run it alongside \`workser verify\` before declaring an API task finished. An API
4036
4036
  somebody can call and an API somebody can integrate with are different products,
4037
4037
  and the spec is the difference.
4038
+ `
4039
+ },
4040
+ {
4041
+ topic: "apps",
4042
+ title: "The project's other apps \u2014 what they are, and wiring one to another",
4043
+ summary: "List every app in the project with its type, deploy state and URL; read a sibling's settings without exposing them; point a client at the right service.",
4044
+ commands: ["project", "env"],
4045
+ source: "skills/workser/reference/apps.md",
4046
+ body: `# The project's other apps
4047
+
4048
+ A project holds several apps \u2014 a web app, one or more services, maybe a phone
4049
+ or desktop app \u2014 and each has its own variables. Every command here takes
4050
+ \`--app <webAppId>\`; without it you are operating on the app whose folder you
4051
+ are in.
4052
+
4053
+ Start from the inventory rather than guessing:
4054
+
4055
+ \`\`\`bash
4056
+ workser project apps # every app: id, type, status, URL, local folder
4057
+ workser project app <id> # one app: preview + production URLs, local path
4058
+ \`\`\`
4059
+
4060
+ That answers the questions you actually need before wiring anything: which
4061
+ services exist, whether each is **deployed or only local**, and what its
4062
+ address is per environment.
4063
+
4064
+ ### Reading another app's config without exposing it
4065
+
4066
+ \`\`\`bash
4067
+ workser env list --app <id> --env production # KEYS only \u2014 values are masked
4068
+ workser env get <key> --app <id> # the value. Sensitive.
4069
+ \`\`\`
4070
+
4071
+ \`list\` is the one to reach for. It answers "does that service already have a
4072
+ \`STRIPE_SECRET_KEY\`?" without printing it, which is almost always the question.
4073
+ Use \`get\` only when you genuinely need the value in hand, and never echo it into
4074
+ a file the user will read, a commit, or a log.
4075
+
4076
+ ### Copying a value from one app to another
4077
+
4078
+ \`\`\`bash
4079
+ workser env set KEY="$(workser env get KEY --app <from> --quiet)" --app <to>
4080
+ \`\`\`
4081
+
4082
+ Two rules that are not optional:
4083
+
4084
+ - **Match the environment.** A production key set into preview, or the reverse,
4085
+ produces an app that works in one place and fails in the other with no
4086
+ message. Pass \`--env\` on both sides.
4087
+ - **Never copy a secret into a phone or desktop app.** Those bundles install on
4088
+ someone's device and anything inside can be read by whoever installs it. A
4089
+ client gets public values only (\`EXPO_PUBLIC_*\`, \`NEXT_PUBLIC_*\`); anything
4090
+ privileged stays in a service and the client reaches it over HTTP.
4091
+
4092
+ ### Pulling config into a local file
4093
+
4094
+ \`\`\`bash
4095
+ workser env pull --app <id> --env preview --out .env.local
4096
+ \`\`\`
4097
+
4098
+ Writes that app's cloud variables locally so \`npm run dev\` behaves like the
4099
+ deployed app. Keep the file out of git.
4100
+
4101
+ ### Pointing a client at a service
4102
+
4103
+ There is no magic wiring. Read the service's URL from \`project app <id>\`, then
4104
+ set it on the client under the key that client reads:
4105
+
4106
+ | Client | Key |
4107
+ | --- | --- |
4108
+ | Phone app (Expo) | \`EXPO_PUBLIC_API_URL\` |
4109
+ | Desktop app | \`NEXT_PUBLIC_API_URL\` |
4110
+ | Web app | \`NEXT_PUBLIC_API_URL\` |
4111
+
4112
+ Workser sets this for you **only** when the project has exactly one service \u2014
4113
+ then it is not a guess. With two or more, the choice is yours to make and to
4114
+ say out loud, because nothing else can know which service that client belongs
4115
+ to.
4038
4116
  `
4039
4117
  },
4040
4118
  {
@@ -4776,6 +4854,13 @@ same rule.
4776
4854
  - **Cloud and local are different environments.** \`env set\` configures the
4777
4855
  cloud; the files in the app folder configure this computer. Don't hand-edit
4778
4856
  one to change the other.
4857
+
4858
+ ## Another app's variables
4859
+
4860
+ Every command here takes \`--app <webAppId>\`; without it you are operating on
4861
+ the app whose folder you are in. Reading a sibling service's config, copying a
4862
+ value across, and pointing a client at a service are all covered in
4863
+ \`workser help apps\`.
4779
4864
  `
4780
4865
  },
4781
4866
  {
@@ -12189,7 +12274,7 @@ function colour(d) {
12189
12274
 
12190
12275
  // src/index.ts
12191
12276
  var pkg = {
12192
- version: true ? "0.6.20" : "0.0.0-dev"
12277
+ version: true ? "0.6.21" : "0.0.0-dev"
12193
12278
  };
12194
12279
  var program2 = new Command();
12195
12280
  program2.name("workser").description(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workser/cli",
3
- "version": "0.6.20",
3
+ "version": "0.6.21",
4
4
  "description": "Workser CLI — give your local AI agent native DevOps & infrastructure on Workser. The agent runs `workser …` to provision, deploy, and manage real apps.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -21,6 +21,7 @@ screen long. Find your row, run that **one** command — every line costs you.
21
21
  | See what was decided or written down for this project | `decision …`, `requirement …`, `doc …` | `workser help sdlc-entities` |
22
22
  | Follow the project's brand — colours, fonts, logo | `design …` | `workser help brand` |
23
23
  | Provision or query Postgres; list end users | `db …`, `auth …` | `workser help database` |
24
+ | See the project's other apps, and wire one to another | `project …`, `env … --app` | `workser help apps` |
24
25
  | Deploy, set env vars, read logs, check a domain | `deploy`, `env …`, `logs`, `versions`, `domain`, `open` | `workser help deploy` |
25
26
  | Save work before a risky change, undo it, sync this folder | `checkpoint`, `restore`, `sync` | `workser help version-control` |
26
27
  | Put files in the project's bucket | `storage …` | `workser help storage` |
@@ -0,0 +1,77 @@
1
+ ---
2
+ topic: apps
3
+ title: The project's other apps — what they are, and wiring one to another
4
+ summary: List every app in the project with its type, deploy state and URL; read a sibling's settings without exposing them; point a client at the right service.
5
+ commands: [project, env]
6
+ ---
7
+
8
+ # The project's other apps
9
+
10
+ A project holds several apps — a web app, one or more services, maybe a phone
11
+ or desktop app — and each has its own variables. Every command here takes
12
+ `--app <webAppId>`; without it you are operating on the app whose folder you
13
+ are in.
14
+
15
+ Start from the inventory rather than guessing:
16
+
17
+ ```bash
18
+ workser project apps # every app: id, type, status, URL, local folder
19
+ workser project app <id> # one app: preview + production URLs, local path
20
+ ```
21
+
22
+ That answers the questions you actually need before wiring anything: which
23
+ services exist, whether each is **deployed or only local**, and what its
24
+ address is per environment.
25
+
26
+ ### Reading another app's config without exposing it
27
+
28
+ ```bash
29
+ workser env list --app <id> --env production # KEYS only — values are masked
30
+ workser env get <key> --app <id> # the value. Sensitive.
31
+ ```
32
+
33
+ `list` is the one to reach for. It answers "does that service already have a
34
+ `STRIPE_SECRET_KEY`?" without printing it, which is almost always the question.
35
+ Use `get` only when you genuinely need the value in hand, and never echo it into
36
+ a file the user will read, a commit, or a log.
37
+
38
+ ### Copying a value from one app to another
39
+
40
+ ```bash
41
+ workser env set KEY="$(workser env get KEY --app <from> --quiet)" --app <to>
42
+ ```
43
+
44
+ Two rules that are not optional:
45
+
46
+ - **Match the environment.** A production key set into preview, or the reverse,
47
+ produces an app that works in one place and fails in the other with no
48
+ message. Pass `--env` on both sides.
49
+ - **Never copy a secret into a phone or desktop app.** Those bundles install on
50
+ someone's device and anything inside can be read by whoever installs it. A
51
+ client gets public values only (`EXPO_PUBLIC_*`, `NEXT_PUBLIC_*`); anything
52
+ privileged stays in a service and the client reaches it over HTTP.
53
+
54
+ ### Pulling config into a local file
55
+
56
+ ```bash
57
+ workser env pull --app <id> --env preview --out .env.local
58
+ ```
59
+
60
+ Writes that app's cloud variables locally so `npm run dev` behaves like the
61
+ deployed app. Keep the file out of git.
62
+
63
+ ### Pointing a client at a service
64
+
65
+ There is no magic wiring. Read the service's URL from `project app <id>`, then
66
+ set it on the client under the key that client reads:
67
+
68
+ | Client | Key |
69
+ | --- | --- |
70
+ | Phone app (Expo) | `EXPO_PUBLIC_API_URL` |
71
+ | Desktop app | `NEXT_PUBLIC_API_URL` |
72
+ | Web app | `NEXT_PUBLIC_API_URL` |
73
+
74
+ Workser sets this for you **only** when the project has exactly one service —
75
+ then it is not a guess. With two or more, the choice is yours to make and to
76
+ say out loud, because nothing else can know which service that client belongs
77
+ to.
@@ -113,3 +113,10 @@ same rule.
113
113
  - **Cloud and local are different environments.** `env set` configures the
114
114
  cloud; the files in the app folder configure this computer. Don't hand-edit
115
115
  one to change the other.
116
+
117
+ ## Another app's variables
118
+
119
+ Every command here takes `--app <webAppId>`; without it you are operating on
120
+ the app whose folder you are in. Reading a sibling service's config, copying a
121
+ value across, and pointing a client at a service are all covered in
122
+ `workser help apps`.