@somewhere-cloud/cli 0.38.57 → 0.38.59

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 (151) hide show
  1. package/CHANGELOG.md +77 -80
  2. package/README.md +52 -27
  3. package/dist/commands/ai.js +1 -1
  4. package/dist/commands/ai.js.map +1 -1
  5. package/dist/commands/api.d.ts +1 -1
  6. package/dist/commands/api.js +2 -2
  7. package/dist/commands/api.js.map +1 -1
  8. package/dist/commands/auth.d.ts +3 -3
  9. package/dist/commands/auth.js +4 -4
  10. package/dist/commands/auth.js.map +1 -1
  11. package/dist/commands/browser.d.ts +1 -1
  12. package/dist/commands/browser.js +9 -9
  13. package/dist/commands/browser.js.map +1 -1
  14. package/dist/commands/call.d.ts +2 -2
  15. package/dist/commands/call.js +2 -2
  16. package/dist/commands/call.js.map +1 -1
  17. package/dist/commands/check.js +2 -2
  18. package/dist/commands/check.js.map +1 -1
  19. package/dist/commands/claim.d.ts +1 -1
  20. package/dist/commands/claim.js +1 -1
  21. package/dist/commands/claim.js.map +1 -1
  22. package/dist/commands/cron.d.ts +1 -1
  23. package/dist/commands/cron.js +2 -2
  24. package/dist/commands/cron.js.map +1 -1
  25. package/dist/commands/db.js +1 -1
  26. package/dist/commands/db.js.map +1 -1
  27. package/dist/commands/deploy.d.ts +9 -9
  28. package/dist/commands/deploy.js +38 -38
  29. package/dist/commands/deploy.js.map +1 -1
  30. package/dist/commands/dev.d.ts +2 -2
  31. package/dist/commands/dev.js +2 -2
  32. package/dist/commands/docs.d.ts +2 -2
  33. package/dist/commands/docs.js +8 -8
  34. package/dist/commands/docs.js.map +1 -1
  35. package/dist/commands/env.js +1 -1
  36. package/dist/commands/env.js.map +1 -1
  37. package/dist/commands/init.js +2 -2
  38. package/dist/commands/init.js.map +1 -1
  39. package/dist/commands/logs.js +2 -2
  40. package/dist/commands/logs.js.map +1 -1
  41. package/dist/commands/mcp.js +1 -1
  42. package/dist/commands/mcp.js.map +1 -1
  43. package/dist/commands/promote.js +2 -2
  44. package/dist/commands/promote.js.map +1 -1
  45. package/dist/commands/rollback.d.ts +1 -1
  46. package/dist/commands/rollback.js +1 -1
  47. package/dist/commands/rollback.js.map +1 -1
  48. package/dist/commands/status.js +2 -2
  49. package/dist/commands/status.js.map +1 -1
  50. package/dist/commands/test.js +10 -8
  51. package/dist/commands/test.js.map +1 -1
  52. package/dist/commands/typecheck.js +1 -1
  53. package/dist/commands/typecheck.js.map +1 -1
  54. package/dist/commands/update.js +1 -1
  55. package/dist/commands/update.js.map +1 -1
  56. package/dist/commands/verify.js +5 -5
  57. package/dist/commands/verify.js.map +1 -1
  58. package/dist/index.js +4 -4
  59. package/dist/index.js.map +1 -1
  60. package/dist/lib/auth.js +1 -1
  61. package/dist/lib/auth.js.map +1 -1
  62. package/dist/lib/base-files.d.ts +1 -1
  63. package/dist/lib/browser-actions.js +1 -1
  64. package/dist/lib/browser-actions.js.map +1 -1
  65. package/dist/lib/browser-run.d.ts +1 -1
  66. package/dist/lib/browser-run.js +3 -3
  67. package/dist/lib/browser-run.js.map +1 -1
  68. package/dist/lib/build-errors.js +1 -1
  69. package/dist/lib/claim-handoff.js +1 -1
  70. package/dist/lib/claim-handoff.js.map +1 -1
  71. package/dist/lib/client.d.ts +5 -5
  72. package/dist/lib/client.js +10 -10
  73. package/dist/lib/client.js.map +1 -1
  74. package/dist/lib/config.d.ts +5 -5
  75. package/dist/lib/config.js +5 -5
  76. package/dist/lib/config.js.map +1 -1
  77. package/dist/lib/declared-data.js +1 -1
  78. package/dist/lib/declared-data.js.map +1 -1
  79. package/dist/lib/deploy-check.d.ts +1 -1
  80. package/dist/lib/deploy-check.js +2 -2
  81. package/dist/lib/deploy-check.js.map +1 -1
  82. package/dist/lib/files.d.ts +4 -4
  83. package/dist/lib/files.js +5 -5
  84. package/dist/lib/files.js.map +1 -1
  85. package/dist/lib/http.d.ts +1 -1
  86. package/dist/lib/http.js +1 -1
  87. package/dist/lib/init-agent-guide.d.ts +2 -2
  88. package/dist/lib/init-agent-guide.js +2 -2
  89. package/dist/lib/init-feature-template.js +1 -1
  90. package/dist/lib/init-feature-template.js.map +1 -1
  91. package/dist/lib/last-run.d.ts +2 -2
  92. package/dist/lib/last-run.js +1 -1
  93. package/dist/lib/link-hint.d.ts +1 -1
  94. package/dist/lib/link-hint.js +1 -1
  95. package/dist/lib/notify/providers/update.d.ts +1 -1
  96. package/dist/lib/notify/providers/update.js +1 -1
  97. package/dist/lib/notify/providers/update.js.map +1 -1
  98. package/dist/lib/output.d.ts +2 -2
  99. package/dist/lib/output.js +2 -2
  100. package/dist/lib/platform-contract.js +1 -1
  101. package/dist/lib/platform-tools.d.ts +1 -1
  102. package/dist/lib/platform-tools.js +2 -2
  103. package/dist/lib/platform-tools.js.map +1 -1
  104. package/dist/lib/playwright-fixtures.js +10 -11
  105. package/dist/lib/playwright-fixtures.js.map +1 -1
  106. package/dist/lib/post-live-render.d.ts +1 -1
  107. package/dist/lib/post-live-render.js +1 -1
  108. package/dist/lib/project-pin.d.ts +1 -1
  109. package/dist/lib/project-pin.js +1 -1
  110. package/dist/lib/promote-outcome.d.ts +2 -2
  111. package/dist/lib/promote-outcome.js +2 -2
  112. package/dist/lib/publish-surface.js +1 -1
  113. package/dist/lib/repro-packet.d.ts +1 -1
  114. package/dist/lib/repro-packet.js +2 -2
  115. package/dist/lib/scaffold.d.ts +1 -1
  116. package/dist/lib/scaffold.js +1 -1
  117. package/dist/lib/source-lint.d.ts +1 -1
  118. package/dist/lib/surface-counts.d.ts +1 -1
  119. package/dist/lib/temp-auth.d.ts +2 -2
  120. package/dist/lib/temp-auth.js +2 -2
  121. package/dist/lib/terminal-text.d.ts +1 -1
  122. package/dist/lib/terminal-text.js +2 -2
  123. package/dist/lib/test-connectivity.js +0 -2
  124. package/dist/lib/test-connectivity.js.map +1 -1
  125. package/dist/lib/test-diagnostics.js +2 -0
  126. package/dist/lib/test-diagnostics.js.map +1 -1
  127. package/dist/lib/test-reporter.js +1 -1
  128. package/dist/lib/test-reporter.js.map +1 -1
  129. package/dist/lib/test-target.d.ts +10 -0
  130. package/dist/lib/test-target.js +18 -0
  131. package/dist/lib/test-target.js.map +1 -0
  132. package/dist/lib/typecheck.d.ts +3 -3
  133. package/dist/lib/typecheck.js +2 -2
  134. package/dist/lib/vendor/deploy-paths.d.ts +0 -11
  135. package/dist/lib/vendor/deploy-paths.js +0 -27
  136. package/dist/lib/vendor/deploy-paths.js.map +1 -1
  137. package/dist/lib/vendor/repro-guidance.d.ts +0 -31
  138. package/dist/lib/vendor/repro-guidance.js +0 -37
  139. package/dist/lib/vendor/repro-guidance.js.map +1 -1
  140. package/dist/lib/version.js +1 -1
  141. package/dist/lib/version.js.map +1 -1
  142. package/dist/types.d.ts +4 -4
  143. package/npm-shrinkwrap.json +2 -2
  144. package/package.json +1 -1
  145. package/runtime/DECLARED-DATA-VENDOR.json +8 -7
  146. package/runtime/PLATFORM-SOURCE.json +1 -2
  147. package/runtime/SOURCE-LINT-VENDOR.json +10 -9
  148. package/runtime/VENDOR.json +1 -2
  149. package/runtime/browser-probes.mjs +2 -2
  150. package/runtime/declared-data.cjs +5047 -4568
  151. package/runtime/source-lint.cjs +12690 -12442
package/CHANGELOG.md CHANGED
@@ -13,8 +13,7 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
13
13
  ### Changed
14
14
 
15
15
  - Typecheck knows the typed browser specifier `somewhere:rooms` (joinRoom,
16
- watchLive), so a TypeScript page can import the rooms client without TS2307
17
- (tsk_5cc533ad). The absolute `/__sw/rooms/client.js` path still builds.
16
+ watchLive), so a TypeScript page can import the rooms client without TS2307. The absolute `/__sw/rooms/client.js` path still builds.
18
17
  - A leftover `sw.db.live` call is reported with the rename to
19
18
  `sw.rooms.live(name, sw.db.from(...))` instead of a bare missing-property
20
19
  error.
@@ -31,7 +30,7 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
31
30
  reported as an error, as the platform refuses it. The browser follows a list
32
31
  with `watchLive` from `/__sw/rooms/client.js`. The vendored platform
33
32
  parser, types, lint, deploy-path policy and repro guidance are re-synced
34
- with the platform at consumer contract 4 (tech 5145fd90, tsk_8b1197b2).
33
+ with the platform at consumer contract 4 (tech 5145fd90, ).
35
34
  - The bundled skills pack is re-synced with the platform: seven skills,
36
35
  including `design`, and live lists taught through `sw.rooms.live`.
37
36
 
@@ -43,9 +42,9 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
43
42
  lists the paths after the headline (20 or fewer), or points to the full
44
43
  list. `deploy --json` and `deploy --dry-run --json` add
45
44
  `uploaded: { static_files, functions }`, taken from the same selection as
46
- the request and the headline count (tsk_23f34679).
45
+ the request and the headline count.
47
46
  - `somewhere init --template minimal` puts the greeting-removal steps at the
48
- top of `db/schema.ts`, and `api/greeting.ts` points to them (tsk_a3dde3d6).
47
+ top of `db/schema.ts`, and `api/greeting.ts` points to them.
49
48
 
50
49
  ## 0.38.30
51
50
 
@@ -53,7 +52,7 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
53
52
 
54
53
  - Typecheck accepts the `rooms: { save, referee }` table option in
55
54
  `db/schema.ts` instead of reporting TS2353. The vendored platform types are
56
- re-synced at consumer contract 3 (tsk_4e67d49d).
55
+ re-synced at consumer contract 3.
57
56
 
58
57
  ## 0.38.29
59
58
 
@@ -62,7 +61,7 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
62
61
  - Typecheck and lint know `sw.rooms` (`act`, `set`, `send`, `get`,
63
62
  `sw.rooms.server.*` and `sw.rooms.event(req)`) and the `rooms` table
64
63
  option. The vendored platform parser, types and lint are re-synced with the
65
- platform at consumer contract 2 (tsk_4e67d49d).
64
+ platform at consumer contract 2.
66
65
 
67
66
  ## 0.38.28
68
67
 
@@ -70,7 +69,7 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
70
69
 
71
70
  - After a rollback or restore, a refused deploy no longer says "live is newer
72
71
  than this folder" (live is the older version then). It says live was moved to
73
- a different version than the one the folder came from (tsk_0dcd7530).
72
+ a different version than the one the folder came from.
74
73
 
75
74
  ## 0.38.27
76
75
 
@@ -78,7 +77,7 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
78
77
 
79
78
  - Every `somewhere deploy` sends `source: "cli"`, so the platform records that
80
79
  the CLI shipped the release. A later refused deploy says "deployed by the
81
- somewhere CLI" instead of leaving the tool unnamed (tsk_0dcd7530).
80
+ somewhere CLI" instead of leaving the tool unnamed.
82
81
 
83
82
  ## 0.38.26
84
83
 
@@ -87,8 +86,7 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
87
86
  - `somewhere restore <version>` makes an earlier deployed version live again
88
87
  through the platform's restore (the same route as MCP
89
88
  `project_restore_version`). Nothing is re-uploaded, so going back never needs
90
- `deploy --force`. `somewhere rollback` stays the previous-version shortcut
91
- (tsk_7fe22c5c).
89
+ `deploy --force`. `somewhere rollback` stays the previous-version shortcut.
92
90
 
93
91
  ### Changed
94
92
 
@@ -97,13 +95,12 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
97
95
  dashboard, GitHub, a rollback or restore, or this folder's own
98
96
  `somewhere rollback`/`restore` (no more blaming "another machine" after your
99
97
  own rollback). It lists the files that differ and gives one next step,
100
- `somewhere pull` (tsk_0dcd7530).
98
+ `somewhere pull`.
101
99
  - Plain `somewhere pull` is the safe update when live is newer. Files you have
102
100
  not edited since the folder last pulled or deployed move to live. Your local
103
101
  edits and local-only files stay. It stops without writing anything when a
104
102
  file changed both here and live. The folder records its base files in
105
- `.somewhere/base-files.json`. `--force` replaces local edits with live
106
- (tsk_a7b38bae).
103
+ `.somewhere/base-files.json`. `--force` replaces local edits with live.
107
104
 
108
105
  ## 0.38.25
109
106
 
@@ -115,7 +112,7 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
115
112
  terminal, an agent's sandboxed shell, an expired temporary workspace), the
116
113
  next `somewhere deploy` starts a new temporary project and replaces the link,
117
114
  saying so. The machine that holds the temporary credential still redeploys
118
- the same project (tsk_b9900dbb).
115
+ the same project.
119
116
  - Signed out with a deployed link and no credential here, the refusal now says
120
117
  the temporary credential lives in `~/.somewhere/config.json` of the terminal
121
118
  that deployed, so run the command there, and how to sign in without a
@@ -142,16 +139,16 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
142
139
  or absolute import names a file that does not exist. Only bare npm imports,
143
140
  which resolve on deploy, are left out of the verdict. Type errors exit 1,
144
141
  and the summary line says that `somewhere deploy` does not stop on type
145
- errors (tsk_8f8e4863).
142
+ errors.
146
143
  - `somewhere pull --force` no longer deletes local files a deploy would never
147
144
  upload (AGENTS.md, CLAUDE.md, README.md, tests, dotfiles, ignored files). It
148
145
  replaces deployed files and removes only files the publish rules would upload
149
146
  that are no longer deployed. Without `--force`, those local-only files are no
150
- longer listed as skipped, so pull records the source base again (tsk_10b73eac).
147
+ longer listed as skipped, so pull records the source base again.
151
148
  - A data `list()` call with a `limit` outside 1 to 100 used to show only
152
149
  `TS2769 No overload matches this call`. `somewhere typecheck` and
153
150
  `typecheck --deploy` now add the rule to that line: at most 100 rows per
154
- call, and read further pages with `after` (tsk_dd9cf0e4).
151
+ call, and read further pages with `after`.
155
152
 
156
153
  ## 0.38.23
157
154
 
@@ -162,7 +159,7 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
162
159
  the email, a `/reset-password` page that the emailed link opens, and the two
163
160
  functions behind them (`api/forgot-password.ts` calls `sw.auth.forgot`,
164
161
  `api/reset-password.ts` calls `sw.auth.reset`). A used or expired link says
165
- so in plain words and offers a new one (tsk_b15c7c79).
162
+ so in plain words and offers a new one.
166
163
 
167
164
  ## 0.38.22
168
165
 
@@ -665,7 +662,7 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
665
662
 
666
663
  - A refused `somewhere verify` names the invalid field and limit (`start_error_details`: code, status, path such as `actions[2].timeout_ms`, `limit_ms`) instead of echoing the platform message (#67).
667
664
  - Text-mode output for a platform failure adds one line with its code and request/trace ids (for example `code PROJECT_NOT_FOUND · request req_… · trace …`). The message stays the platform's own; `--json` is unchanged (#71).
668
- - `somewhere lint` vendors the platform's source lint at somewhere-tech#714: a file exempted from the request-ownership trace by a genuine verifier call reports `coverage.request_ownership` as `partial` instead of `checked`. Warning metadata only; findings and exit codes are unchanged (#72).
665
+ - `somewhere lint` vendors the platform's source lint at the canonical source: a file exempted from the request-ownership trace by a genuine verifier call reports `coverage.request_ownership` as `partial` instead of `checked`. Warning metadata only; findings and exit codes are unchanged (#72).
669
666
  - `somewhere test-users prepare --help` no longer promises "about 1 hour" sessions or 24-hour identities. It says the session starts with the expiry prepare prints, that a refresh with saved-back state can renew it, and not to rely on expiry: remove the identities with `somewhere test-users cleanup`. A state copied before cleanup may keep working until its access token (JWT) expires (#70).
670
667
 
671
668
  ## 0.37.64
@@ -1026,7 +1023,7 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
1026
1023
  every named step, page/console/network health, and desktop and mobile
1027
1024
  screenshots. `somewhere deploy --verify <flow.json>` can run the same check
1028
1025
  immediately after publishing.
1029
- During the platform #24 rollout, hosted action flows on an older serving
1026
+ During the platform rollout, hosted action flows on an older serving
1030
1027
  release fail honestly with a missing-screenshot or unfiltered expected-
1031
1028
  refusal health result; they do not crash or report a false pass. Re-run the
1032
1029
  same command after the rollout reaches the project.
@@ -1228,7 +1225,7 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
1228
1225
 
1229
1226
  ### Fixed
1230
1227
 
1231
- - `tsk_5504e045` — **`somewhere preview` can no longer publish to production on
1228
+ - `` — **`somewhere preview` can no longer publish to production on
1232
1229
  its own.** A preview builds on your app's live version, so a project that has
1233
1230
  never been published needs one published first — and that publish is a real
1234
1231
  production release, the one thing this command can do to your live site. It
@@ -1245,7 +1242,7 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
1245
1242
  running `somewhere preview --publish-first`. A run that cannot be asked — a
1246
1243
  script, an agent, a piped shell — is refused and told about the flag. Preview
1247
1244
  on a project that is already live never publishes anything, as before.
1248
- - `tsk_5504e045` — **the plan refusal stopped claiming your project is
1245
+ - `` — **the plan refusal stopped claiming your project is
1249
1246
  unpublished.** On a Free or Builder account, `somewhere preview` on a live
1250
1247
  project refused with "Nothing was created — this project has not been
1251
1248
  published", which was simply untrue and sent people to re-deploy an app that
@@ -1265,7 +1262,7 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
1265
1262
 
1266
1263
  ### Added
1267
1264
 
1268
- - `tsk_5cfcfe00` — **`somewhere preview` is a command.** There are two loops and
1265
+ - `` — **`somewhere preview` is a command.** There are two loops and
1269
1266
  they are now named after where the app runs: `somewhere dev` runs your app on
1270
1267
  your machine, `somewhere preview` runs it on the platform. Every save goes to
1271
1268
  a private URL reachable only by you; production keeps serving what you last
@@ -1276,7 +1273,7 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
1276
1273
 
1277
1274
  ### Fixed
1278
1275
 
1279
- - `tsk_33023348` — **`somewhere promote` never reports an outcome it does not
1276
+ - `` — **`somewhere promote` never reports an outcome it does not
1280
1277
  know.** It used to print "Promote failed / Unknown error" for a promote that
1281
1278
  had already shipped, and the obvious retry then said "Production was not
1282
1279
  changed" about production that the first command had changed. Promote is the
@@ -1287,16 +1284,16 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
1287
1284
  checked against the same evidence before it is allowed to stand. When neither
1288
1285
  side can be read it says the status is unknown and points at your production
1289
1286
  URL rather than guessing.
1290
- - `tsk_74375b3c` — **a promote ends the preview cleanly.** Promoting closed the
1287
+ - `` — **a promote ends the preview cleanly.** Promoting closed the
1291
1288
  preview, but the loop kept watching, and your next save came back with a
1292
1289
  refusal written for an API client — then failed the same way on every save
1293
1290
  after that. The loop now recognises the end of a preview and stops on it, in
1294
1291
  two lines: what happened, and the one command that starts the next preview.
1295
- - `tsk_5cfcfe00` — the preview copy no longer claims your preview has
1292
+ - `` — the preview copy no longer claims your preview has
1296
1293
  production's data. A preview runs against a separate copy of your schema with
1297
1294
  none of your production rows, which is exactly what makes it safe to try
1298
1295
  things in.
1299
- - `tsk_d63b3b6a` — **an unresolvable import is reported, not a crash.**
1296
+ - `` — **an unresolvable import is reported, not a crash.**
1300
1297
  `somewhere dev` died on any import that could not be resolved — a typo'd
1301
1298
  package, one you had not installed yet — with an internal error naming the
1302
1299
  CLI's own bundler and nothing about your code, and every rebuild after that
@@ -1308,7 +1305,7 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
1308
1305
  that it comes from the platform and should not be installed at all. The
1309
1306
  server survives, the last working page stays up, and a save that fixes it
1310
1307
  serves again.
1311
- - `tsk_14c5408c` — a burst of saves stays one preview update. Saves inside the
1308
+ - `` — a burst of saves stays one preview update. Saves inside the
1312
1309
  debounce window accumulate into a single update, and a save that lands while
1313
1310
  one is in flight re-arms instead of starting a second, so two previews are
1314
1311
  never building at once.
@@ -1324,7 +1321,7 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
1324
1321
 
1325
1322
  ### Fixed
1326
1323
 
1327
- - `tsk_a8cb3d23`, `tsk_f79d71ce` — `somewhere dev` and `somewhere deploy` now
1324
+ - ``, `` — `somewhere dev` and `somewhere deploy` now
1328
1325
  derive dependency versions from the SAME code, so a build on your machine and
1329
1326
  a build on deploy resolve the same libraries. The platform's compiler reads
1330
1327
  your lockfile as of today: a version your lockfile pins is the version that
@@ -1349,11 +1346,11 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
1349
1346
 
1350
1347
  ### Added
1351
1348
 
1352
- - `tsk_0e9e13b8` — `somewhere signup` exists. Someone who has never used the
1349
+ - `` — `somewhere signup` exists. Someone who has never used the
1353
1350
  platform ran `somewhere login`, and the CLI's answer assumed they already had
1354
1351
  an account. `signup` prints the page that creates one, and `login` names it
1355
1352
  too, so the front door is a door.
1356
- - `tsk_c166924f` — `somewhere deploy` publishes your **app**, not the folder it
1353
+ - `` — `somewhere deploy` publishes your **app**, not the folder it
1357
1354
  was built in. Notes, task lists, scratch files and agent instructions in your
1358
1355
  project root stay on your machine: the deploy prints `Not published (N): …`
1359
1356
  naming exactly what it held back, so the decision is visible rather than
@@ -1362,19 +1359,19 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
1362
1359
 
1363
1360
  ### Fixed
1364
1361
 
1365
- - `tsk_926fbf8e` — `somewhere docs <topic>` answers from the public corpus with
1362
+ - `` — `somewhere docs <topic>` answers from the public corpus with
1366
1363
  no login. Reading the documentation used to require an account, which is the
1367
1364
  wrong order: you read the docs to decide whether to make one.
1368
- - `tsk_f250e561` — `somewhere status` exits 0 when the platform answers a plan
1365
+ - `` — `somewhere status` exits 0 when the platform answers a plan
1369
1366
  question. A feature your plan does not include is an ANSWER, not a failure;
1370
1367
  exiting non-zero made every scripted `status` on a Free account look like a
1371
1368
  broken command.
1372
- - `tsk_a605ff7b`, `tsk_10be456b` — `somewhere browser` against a local URL now
1369
+ - ``, `` — `somewhere browser` against a local URL now
1373
1370
  fails inside a bound instead of hanging. Every wait on the local path has a
1374
1371
  deadline, a port with nothing listening is reported as such with the remedy
1375
1372
  named, and the browser's own favicon request — which the page never made — no
1376
1373
  longer counts as your app returning a 404.
1377
- - `tsk_9c5ed7f8` — a failed `somewhere deploy` now says something you can act
1374
+ - `` — a failed `somewhere deploy` now says something you can act
1378
1375
  on. When the platform answers `retry: true` — its own statement that the
1379
1376
  request changed nothing and the same one is safe to send again — the CLI
1380
1377
  retries once instead of stopping (it parsed that field and never read it).
@@ -1382,12 +1379,12 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
1382
1379
  of the bare words "Unknown error". And every deploy failure now prints the
1383
1380
  request id from the response, so a failure you can see is a failure we can
1384
1381
  find.
1385
- - `tsk_eef0a0ef` — `somewhere dev` prints your app's output, not the platform's
1382
+ - `` — `somewhere dev` prints your app's output, not the platform's
1386
1383
  telemetry. Database calls were emitting raw internal metrics JSON and a
1387
1384
  repeated "deferred flush failed: HTTP 403" from a background channel you did
1388
1385
  not ask for and cannot fix. Both are gone by default; set
1389
1386
  `SOMEWHERE_DEV_TELEMETRY=1` to see them.
1390
- - `tsk_a8cb3d23` — the local loop resolves a dependency at the version the build
1387
+ - `` — the local loop resolves a dependency at the version the build
1391
1388
  image serves, for every package the image carries. This already held for
1392
1389
  React; it now holds for the whole baked set (router, query, state, forms,
1393
1390
  validation, http, dates, utils, styling, animation, charts, icons), so a
@@ -1416,7 +1413,7 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
1416
1413
 
1417
1414
  ### Added
1418
1415
 
1419
- - `tsk_9ec50c84` — `somewhere browser` now drives a **localhost** target. The
1416
+ - `` — `somewhere browser` now drives a **localhost** target. The
1420
1417
  app `somewhere dev` is serving used to be the one address this CLI's own
1421
1418
  browser would not visit, so every visual and DOM check had to wait for a
1422
1419
  production deploy. A loopback URL is now driven by the browser already
@@ -1426,12 +1423,12 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
1426
1423
  environment variable to point at one. Flags only the hosted browser can honour
1427
1424
  (`--store`, `--session`, `--extract`, non-`dom` `--include`) are refused by
1428
1425
  name rather than silently dropped from a report that still looks complete.
1429
- - `tsk_70fd0f63` — `somewhere errors` gained a `kind` column and an
1426
+ - `` — `somewhere errors` gained a `kind` column and an
1430
1427
  `--exceptions` flag, so you can see only what actually broke.
1431
1428
 
1432
1429
  ### Fixed
1433
1430
 
1434
- - `tsk_bdd72f02` — `somewhere browser --snapshot` now asks for the map it
1431
+ - `` — `somewhere browser --snapshot` now asks for the map it
1435
1432
  prints. `--snapshot` renders the interactive-element outline, but it never
1436
1433
  requested that section, so it printed whatever the response happened to carry
1437
1434
  — usually nothing. `browser --wait button --snapshot` would match a button and
@@ -1440,35 +1437,35 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
1440
1437
  `--include` rather than replacing it. The local outline comes from the
1441
1438
  platform's own probe, so it is a preview of the hosted answer rather than a
1442
1439
  second opinion.
1443
- - `tsk_ea4274ca` — `somewhere errors` no longer calls a working auth gate an
1440
+ - `` — `somewhere errors` no longer calls a working auth gate an
1444
1441
  exception. If you probed your own endpoint signed out — deliberately, to prove
1445
1442
  the gate holds — your 401 was listed as the only exception in 24 hours. Rows
1446
1443
  now show their kind: **refused** for a 4xx your handler returned on purpose,
1447
1444
  **exception** for an uncaught throw or a 5xx, with the summary line splitting
1448
1445
  the counts. Nothing is hidden by default.
1449
- - `tsk_ea4274ca` — a stored screenshot printed as a storage path, which reads as
1446
+ - `` — a stored screenshot printed as a storage path, which reads as
1450
1447
  a URL and is not one, so the one value the command handed back for "here is
1451
1448
  your screenshot" could not be used to see it. The report now leads with the
1452
1449
  link that opens it and keeps the stored path on its own line, because that is
1453
1450
  the handle for reading or replacing the file later.
1454
- - `tsk_53badecf` — `somewhere dev --check` and `somewhere deploy` no longer
1451
+ - `` — `somewhere dev --check` and `somewhere deploy` no longer
1455
1452
  report the `somewhere/db` import from our own managed-schema documentation as
1456
1453
  a missing npm package whose remedy is installing an unrelated package. The
1457
1454
  specifiers the platform provides are now treated as provided. A genuinely
1458
1455
  missing package still warns, and still names every file that imports it.
1459
- - `tsk_a21bc829` — `somewhere dev` no longer asks you for a variable the
1456
+ - `` — `somewhere dev` no longer asks you for a variable the
1460
1457
  platform writes. It warned that `APP_URL` had no local value on projects whose
1461
1458
  source never mentions `APP_URL` — it never would, because deploy writes that
1462
1459
  key. The local loop now fills it with the local origin, or with the project's
1463
1460
  public URL when nothing is being served locally. Keys you genuinely own are
1464
1461
  still named, which is the point of that warning.
1465
- - `tsk_6a2a09bc` / `tsk_320a0bc6` — the local loop now declares tables the way
1462
+ - `` / `` — the local loop now declares tables the way
1466
1463
  deploy declares them. It kept only the owner column and dropped the intent, so
1467
1464
  `sw.db.from` on a `shared()` table answered "this table has no declared
1468
1465
  intent" locally while working fine on the same deployed project. Intents,
1469
1466
  owner scopes and the owner-identity mode now cross over exactly as the deploy
1470
1467
  bundle bakes them.
1471
- - `tsk_4df056ea` — when your plan does not include reaching the project database
1468
+ - `` — when your plan does not include reaching the project database
1472
1469
  from the local loop, `somewhere dev` now says so **once, at startup**, before
1473
1470
  you write a line of code. It previously started a clean serving loop and let
1474
1471
  you discover at the first request that every `sw.db` call was refused — with a
@@ -1478,7 +1475,7 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
1478
1475
  Deploying is unaffected on every plan, and the deployed app reads and writes
1479
1476
  its database normally. `somewhere status` reports the same answer, including a
1480
1477
  `local_dev_db` object in `--json`.
1481
- - `tsk_a21bc829` — `--check`'s help now says what the documentation says: it
1478
+ - `` — `--check`'s help now says what the documentation says: it
1482
1479
  needs a real `npm install`, because the typechecker reads package types out of
1483
1480
  `node_modules` and the CLI's dependency cache does not stand in for that.
1484
1481
 
@@ -1494,40 +1491,40 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
1494
1491
 
1495
1492
  ### Changed
1496
1493
 
1497
- - `tsk_0100d8e5` — the local loop now runs the CURRENT platform runtime. The
1494
+ - `` — the local loop now runs the CURRENT platform runtime. The
1498
1495
  copy the CLI carried had frozen several months behind, so `somewhere dev` was
1499
1496
  quietly running your `api/` functions against an older `sw.*` than your
1500
1497
  deployed ones. Re-synced deliberately, with a hash guard so it cannot drift
1501
1498
  silently again. What this changes for you is below.
1502
- - `tsk_0100d8e5` — the structured database API works locally: `sw.db.from`,
1499
+ - `` — the structured database API works locally: `sw.db.from`,
1503
1500
  `.insert`, `.update`, `.delete`, `.count`. Tables need a scope declaration for
1504
1501
  the platform to scope them to the signed-in user; an undeclared table returns
1505
1502
  a clear error naming the table.
1506
- - `tsk_0100d8e5` — also newly available in the local loop: sign-in with GitHub
1503
+ - `` — also newly available in the local loop: sign-in with GitHub
1507
1504
  and Discord, roles and moderation (`sw.auth.requireRole`,
1508
1505
  `sw.auth.moderation.*`), plans and entitlements (`sw.billing`), scheduling
1509
1506
  (`sw.calendar`), contacts, and durable agents (`sw.agent`). Email gains
1510
1507
  delivery `status` and `history`, payments gains `quote` and a per-user billing
1511
1508
  portal, and search gains `add`.
1512
- - `tsk_0312cf17` — `somewhere dev` now builds with the same React version the
1509
+ - `` — `somewhere dev` now builds with the same React version the
1513
1510
  deploy image builds with. It previously installed the lowest version your
1514
1511
  range allowed (`^19.2.0` became 19.2.0) while deploy used 19.2.7, so the loop
1515
1512
  and production could differ by a patch release you would only discover in
1516
1513
  production.
1517
- - `tsk_106f7ab1` — one vocabulary for previews across the CLI. Commands and
1514
+ - `` — one vocabulary for previews across the CLI. Commands and
1518
1515
  messages say **preview** and **production**; `somewhere promote` names its
1519
1516
  arguments `preview_session_id` and `preview_id`. `--draft` still works as an
1520
1517
  alias of `--preview`, so nothing you already type breaks.
1521
1518
 
1522
1519
  ### Fixed
1523
1520
 
1524
- - `tsk_8a9d2d1a` — `somewhere deploy` no longer tells you "Next.js apps don't
1521
+ - `` — `somewhere deploy` no longer tells you "Next.js apps don't
1525
1522
  run here" when your app is not a Next.js app. Any project with a `src/pages/`
1526
1523
  folder tripped it — including the app `somewhere init` creates, so this was
1527
1524
  often the first thing a new project printed. A Next.js app is now identified
1528
1525
  the way the platform identifies one: a `next` dependency or a `next.config`
1529
1526
  file.
1530
- - `tsk_cf48f4ab` — `somewhere dev --cloud` on a plan without private previews
1527
+ - `` — `somewhere dev --cloud` on a plan without private previews
1531
1528
  now refuses before doing anything, instead of publishing a first production
1532
1529
  version and only then telling you the command is unavailable. Nothing is
1533
1530
  created.
@@ -1549,7 +1546,7 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
1549
1546
 
1550
1547
  ### Added
1551
1548
 
1552
- - `tsk_95377909` — `somewhere dev` is now a LOCAL loop. It serves your app on
1549
+ - `` — `somewhere dev` is now a LOCAL loop. It serves your app on
1553
1550
  localhost and compiles it with the platform's own compiler — the same
1554
1551
  `compile-core` the deploy pipeline runs, vendored into the CLI at the exact
1555
1552
  esbuild version the compile container pins, with a hash manifest and a test
@@ -1562,31 +1559,31 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
1562
1559
  There is no dev version of your app — same app, same data, same build.
1563
1560
  Functions execute in your machine's Node during the loop rather than on the
1564
1561
  platform's runtime, so a deploy is still what proves a function in production.
1565
- - `tsk_737ff0d2` — the local server now answers on both `127.0.0.1` and `::1`,
1562
+ - `` — the local server now answers on both `127.0.0.1` and `::1`,
1566
1563
  so the `http://localhost:...` URL it prints opens in a browser that resolves
1567
1564
  `localhost` to IPv6 first. Non-loopback addresses are still refused.
1568
- - `tsk_3269026d` — `api/` functions resolve npm packages through the same
1565
+ - `` — `api/` functions resolve npm packages through the same
1569
1566
  search path the compiler used, so a fresh scaffold's routes work with no
1570
1567
  `npm install`. The project's own `node_modules` always wins.
1571
- - `tsk_8796c588` — the pre-start typecheck is skipped, with one line saying
1568
+ - `` — the pre-start typecheck is skipped, with one line saying
1572
1569
  why, when the project has no `node_modules` — instead of reporting dozens of
1573
1570
  unresolvable-type errors about code you did not write.
1574
1571
 
1575
1572
  ### Changed
1576
1573
 
1577
- - `tsk_95377909` — the cloud preview watcher, which used to be bare
1574
+ - `` — the cloud preview watcher, which used to be bare
1578
1575
  `somewhere dev`, is now `somewhere dev --cloud`. `--local` is still accepted
1579
1576
  and does what bare `somewhere dev` does. `somewhere dev <cmd...>` still runs
1580
1577
  your own command with the project's environment variables injected.
1581
1578
 
1582
1579
  ### Fixed
1583
1580
 
1584
- - `tsk_8a3f6540` — `somewhere dev --cloud` on a project that has never been
1581
+ - `` — `somewhere dev --cloud` on a project that has never been
1585
1582
  published now publishes the first version once, announced in plain words,
1586
1583
  instead of failing the initial sync. A private preview is a candidate built
1587
1584
  against your live version, so there was previously nothing for the first one
1588
1585
  to build on.
1589
- - `tsk_e929774b` — the `--json` contract test no longer deploys to the live
1586
+ - `` — the `--json` contract test no longer deploys to the live
1590
1587
  platform on every `npm test`. It ran logged out with no API URL, so
1591
1588
  `deploy`, `deploy-check` and `browser` reached production and minted a real
1592
1589
  temporary account and a real project per run — while asserting nothing about
@@ -1601,32 +1598,32 @@ Republish the platform contract 6 CLI after npm accepted earlier uploads without
1601
1598
 
1602
1599
  ### Security
1603
1600
 
1604
- - `tsk_f7ba3b57` — credential-at-rest hardening. Config is now written atomically at `0600` (a pre-existing world-readable `~/.somewhere/config.json` is tightened on every write, not just on create). `logout` now revokes the session server-side (best-effort) in addition to removing the local token.
1601
+ - `` — credential-at-rest hardening. Config is now written atomically at `0600` (a pre-existing world-readable `~/.somewhere/config.json` is tightened on every write, not just on create). `logout` now revokes the session server-side (best-effort) in addition to removing the local token.
1605
1602
 
1606
1603
  ### Breaking
1607
1604
 
1608
- - `tsk_f7ba3b57` — `auth set <token>` no longer accepts the token as a positional argument (it was visible in the process table to other local users). Provide the token via the `SOMEWHERE_TOKEN` environment variable or stdin: `printf %s "$TOKEN" | somewhere auth set`.
1605
+ - `` — `auth set <token>` no longer accepts the token as a positional argument (it was visible in the process table to other local users). Provide the token via the `SOMEWHERE_TOKEN` environment variable or stdin: `printf %s "$TOKEN" | somewhere auth set`.
1609
1606
 
1610
1607
  ## 0.23.1
1611
1608
 
1612
1609
  ### Fixed
1613
1610
 
1614
- - `tsk_e67bcc16` — made JSON mode a CLI-wide success/error contract, added JSON output to `docs`, `api`, and `init`, and covered every registered `--json` command with a parseability test.
1615
- - `tsk_c6035afa` — duplicate of `tsk_06c1f77a`; rollback failures now remain structured JSON in JSON mode.
1616
- - `tsk_41ee402b` — replaced the stale-era rollback snapshot wording with current recovery guidance; restoring the previous promoted release still requires the platform follow-up noted below.
1617
- - `tsk_971775dc` — `logs --follow` now keeps polling after an empty initial query and suppresses overlapping records.
1618
- - `tsk_8dc77749` — deploy requests now have an abortable long-call deadline, progress heartbeat, and one bounded retry instead of waiting without a terminal result.
1619
- - `tsk_05a3cf11` — fixed the no-`node_modules` typecheck fallback to run `npx -y -p typescript tsc`.
1620
- - `tsk_451eb155` — added non-interactive `init --link --project <ref>` with exact ID/name/slug/subdomain matching and JSON output.
1621
- - `tsk_1584392a` — duplicate of `tsk_43fe9ff0`; corrected direct-run documentation for the multi-bin npm package.
1622
- - `tsk_0160bfd4` — retained and regression-tested log-ID deduplication across follow polling cycles.
1623
- - `tsk_208f7583` — replaced the confusing fresh-project rollback snapshot wording; the snapshot-selection platform follow-up is noted below.
1624
- - `tsk_06c1f77a` — rollback API and network failures emit parseable JSON error envelopes.
1625
- - `tsk_e6293ee2` — deploy warnings already present in the build log are no longer printed a second time.
1626
- - `tsk_43fe9ff0` — documented the correct multi-bin invocation: `npx -y -p @somewhere-tech/cli@latest somewhere <command>` (or the equivalent `npm exec --package ... -- somewhere`).
1627
- - `tsk_b210d436` — bare `somewhere docs` now streams the full reference; the topic menu remains available at `somewhere docs --list`.
1628
- - `tsk_873f694c` — retained and regression-tested the real two-step project deletion confirmation flow and truthful server errors.
1611
+ - `` — made JSON mode a CLI-wide success/error contract, added JSON output to `docs`, `api`, and `init`, and covered every registered `--json` command with a parseability test.
1612
+ - `` — duplicate of ``; rollback failures now remain structured JSON in JSON mode.
1613
+ - `` — replaced the stale-era rollback snapshot wording with current recovery guidance; restoring the previous promoted release still requires the platform follow-up noted below.
1614
+ - `` — `logs --follow` now keeps polling after an empty initial query and suppresses overlapping records.
1615
+ - `` — deploy requests now have an abortable long-call deadline, progress heartbeat, and one bounded retry instead of waiting without a terminal result.
1616
+ - `` — fixed the no-`node_modules` typecheck fallback to run `npx -y -p typescript tsc`.
1617
+ - `` — added non-interactive `init --link --project <ref>` with exact ID/name/slug/subdomain matching and JSON output.
1618
+ - `` — duplicate of ``; corrected direct-run documentation for the multi-bin npm package.
1619
+ - `` — retained and regression-tested log-ID deduplication across follow polling cycles.
1620
+ - `` — replaced the confusing fresh-project rollback snapshot wording; the snapshot-selection platform follow-up is noted below.
1621
+ - `` — rollback API and network failures emit parseable JSON error envelopes.
1622
+ - `` — deploy warnings already present in the build log are no longer printed a second time.
1623
+ - `` — documented the correct multi-bin invocation: `npx -y -p @somewhere-tech/cli@latest somewhere <command>` (or the equivalent `npm exec --package ... -- somewhere`).
1624
+ - `` — bare `somewhere docs` now streams the full reference; the topic menu remains available at `somewhere docs --list`.
1625
+ - `` — retained and regression-tested the real two-step project deletion confirmation flow and truthful server errors.
1629
1626
 
1630
1627
  ### Platform follow-up
1631
1628
 
1632
- - `tsk_41ee402b`, `tsk_208f7583` — rollback must select and restore the previous live/promoted release snapshot, not an intermediate deploy version, and every fresh deploy/promote path must persist the restorable snapshot before changing the live pointer.
1629
+ - ``, `` — rollback must select and restore the previous live/promoted release snapshot, not an intermediate deploy version, and every fresh deploy/promote path must persist the restorable snapshot before changing the live pointer.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @somewhere-cloud/cli
2
2
 
3
- CLI for [Somewhere Cloud](https://somewhere.cloud). Like `gh` for GitHub, `vercel` for Vercel.
3
+ Deploy and manage apps on [Somewhere Cloud](https://somewhere.cloud) from your shell.
4
4
 
5
5
  ## Install
6
6
 
@@ -25,10 +25,10 @@ installs `cli`, the name `npx @somewhere-cloud/cli` resolves to; use
25
25
 
26
26
  ```bash
27
27
  somewhere login # Optional: OAuth in browser, stores API key (init/deploy work without it)
28
- somewhere init # Create project, write .somewhere.json
28
+ somewhere init # Write a starter; signed-in runs also create and link a project
29
29
  somewhere dev # Frontend hot reload on localhost; API calls go to your deployed project
30
30
  somewhere deploy # Deploy current directory
31
- somewhere logs # Stream logs
31
+ somewhere logs --follow # Stream logs
32
32
  somewhere open # Open in browser
33
33
  ```
34
34
 
@@ -40,12 +40,12 @@ For optional after-edit checking, explicitly run `somewhere hooks install --host
40
40
 
41
41
  | Command | What it does |
42
42
  |---|---|
43
- | `somewhere login` | Authenticate via browser (Google OAuth) |
43
+ | `somewhere login` | Authenticate using a device code |
44
44
  | `somewhere auth login` | Alias of `somewhere login` |
45
45
  | `somewhere auth roles grant <user> <role>` | Give an app user an app role declared in `db/schema.ts` `appRoles` (user = sign-up address or app user id); `revoke` and `list` alongside |
46
46
  | `somewhere logout` | Clear stored credentials |
47
- | `somewhere whoami` | Show current user, plan, project count |
48
- | `somewhere init` | Create project + write `.somewhere.json` |
47
+ | `somewhere whoami` | Show current user and project count |
48
+ | `somewhere init` | Write a starter; signed-in runs also create and link a project |
49
49
  | `somewhere init --link --project <id> --template auth` | Scaffold an empty directory and link an existing project; non-empty directories are link-only |
50
50
  | `somewhere projects` | List all projects with status |
51
51
  | `somewhere project create <name>` | Create a new project |
@@ -54,7 +54,7 @@ For optional after-edit checking, explicitly run `somewhere hooks install --host
54
54
  | `somewhere dev` | Frontend hot reload on localhost with your project's own Vite; API requests go to your deployed project |
55
55
  | `somewhere preview` | Run your whole app on the platform — every save goes to a private URL, and production is untouched until you promote |
56
56
  | `somewhere deploy` | Deploy current directory to linked project |
57
- | `somewhere deploy --dry-run` | Preview the deploy diff without shipping |
57
+ | `somewhere deploy --dry-run` | Upload source to compute the deploy diff without publishing |
58
58
  | `somewhere deploy --scope functions` | Deploy backend only (leave the site untouched) |
59
59
  | `somewhere deploy --force` | Intentionally overwrite remote changes made since this machine last deployed |
60
60
  | `somewhere git connect [owner/repo]` | Install/authorize the GitHub App if needed, deploy repository HEAD, then deploy every push |
@@ -69,7 +69,7 @@ For optional after-edit checking, explicitly run `somewhere hooks install --host
69
69
  | `somewhere errors` | Show the most recent exceptions (endpoint, status, error, time) — the curated error view |
70
70
  | `somewhere rollback` | Revert production to the previous deployed version |
71
71
  | `somewhere env list` | Show environment variables |
72
- | `somewhere env set KEY value` | Set an env var |
72
+ | `somewhere env set KEY --stdin` | Read an env value from stdin |
73
73
  | `somewhere env delete KEY` | Delete an env var |
74
74
  | `somewhere env pull` | Write a local `.env` listing the keys the project expects (values blank — secrets never leave the platform) |
75
75
  | `somewhere status` | Show project + workspace status |
@@ -87,9 +87,14 @@ Short alias: `sw` works everywhere `somewhere` does.
87
87
 
88
88
  ## Auth flow
89
89
 
90
- `somewhere login` opens your browser, you sign in with Google, the platform redirects back to a local server with your API key. The key is stored in `~/.somewhere/config.json` (mode 600).
90
+ `somewhere login` starts device-code sign-in: open the displayed page and
91
+ approve the code. Use `--browser-callback` for Google sign-in with a localhost
92
+ callback. Credentials are saved in `~/.somewhere/config.json` with mode 600.
91
93
 
92
- The CLI configures every MCP host (Claude Code, Cursor, Codex) to use the **stdio bridge** (`somewhere mcp`), not a baked-in token. The bridge re-reads `~/.somewhere/config.json` on every launch, so a later `somewhere login` (which rotates your key) never leaves a stale token behind — no manual config editing, ever. If your stored key is a refreshable cli-pair key, the CLI also swaps in a fresh access key automatically on expiry, so a long-running agent session never logs itself out.
94
+ MCP connections are optional: `somewhere mcp install <host>` configures the
95
+ stdio bridge (`somewhere mcp`). The bridge reads the saved credentials when it
96
+ starts. Refreshable credentials can renew automatically; if renewal fails,
97
+ follow the reported sign-in instructions.
93
98
 
94
99
  ## Init flow
95
100
 
@@ -139,7 +144,7 @@ deploys but does not undeploy the current site.
139
144
  |---|---|
140
145
  | `--scope functions` | Deploy only the backend functions; leave the site untouched |
141
146
  | `--scope static` | Deploy only the site; leave functions untouched |
142
- | `--dry-run` | Show what would change (added / modified / removed) without deploying |
147
+ | `--dry-run` | Upload source and show what would change without publishing |
143
148
  | `--replace-functions` | Drop deployed functions not present locally. A full deploy already does this and names each removed function; use it with `--scope functions`, which otherwise keeps them |
144
149
  | `--project <id>` | Deploy to a specific project instead of the linked one |
145
150
  | `--force` | Overwrite remote changes even when this machine has an older deployed version |
@@ -211,29 +216,49 @@ does not, the command says so and names the plans that do (see
211
216
  https://somewhere.cloud/pricing). `somewhere dev` and deploying work on every
212
217
  plan.
213
218
 
214
- ## Client-side code: use the SDK
219
+ ## Browser data and auth
215
220
 
216
- The CLI deploys and manages projects. For **client-side code** (browser / Node app talking to your backend), install the SDK — a familiar `{ data, error }` client:
221
+ The default starter includes cookie-based sign-in. Add private notes with
222
+ `somewhere init --features auth,private-data` in an empty directory. Its
223
+ `db/schema.ts` declares the note fields, permitted browser operations and
224
+ `owner()` access rule. The generated client applies that rule on the server;
225
+ browser code sends no developer key or user filter.
217
226
 
218
- ```bash
219
- npm i @somewhere-cloud/sdk
227
+ ```ts
228
+ import { data } from 'somewhere:data';
229
+
230
+ const page = await data.notes.list({ limit: 20 });
231
+ const created = await data.notes.create({ title: 'First note', body: '' });
232
+ if (created.data) {
233
+ await data.notes.update(created.data.id, { title: 'Updated note' });
234
+ await data.notes.delete(created.data.id);
235
+ }
220
236
  ```
221
237
 
222
- ```js
223
- import { createClient } from '@somewhere-cloud/sdk';
224
- const db = createClient(URL, KEY);
225
- const { data, error } = await db.from('todos').select('*');
226
- ```
238
+ `page.data` holds the rows and `page.has_more` indicates another page. Available
239
+ methods and fields come from your schema. Failed operations throw; handle errors
240
+ in your application's UI.
241
+
242
+ For auth, use the starter's shared client from `src/services/auth.ts`:
227
243
 
228
- Inside deployed functions you use the `sw` runtime directly (`sw.db.query(...)`, `sw.auth`, `sw.email`, …) — no SDK needed there.
244
+ ```ts
245
+ import { auth } from './services/auth';
246
+
247
+ await auth.signIn({ email: 'person@example.com', password: 'your password' });
248
+ // The starter handles sign-in errors and any required email-code step.
249
+ await auth.signOut();
250
+ ```
229
251
 
230
- ## What the CLI does NOT do
252
+ That service creates one `createSomewhereAuth()` instance from
253
+ `@somewhere-cloud/sdk/auth`. The starter mounts `somewhereAuth` from
254
+ `@somewhere-cloud/sdk/server` at `api/auth/[...path].ts`. Sessions use same-origin
255
+ httpOnly cookies; app code does not store a developer key. Keep the starter's
256
+ pending, error and email-code UI when building your own forms.
231
257
 
232
- - No hosting or running production code (the platform does that)
233
- - No build step before deploy — **deploy raw source; the platform compiles it.** `somewhere dev` serves the frontend with your project's Vite for hot reload only
234
- - No application AI calls (the `advisor` command only exposes the platform-help expert)
235
- - No workspace management (dashboard)
236
- - No billing (dashboard)
258
+ Use same-origin `fetch('/api/your-function')` for your application functions.
259
+ Server functions use the supplied `sw` runtime for trusted data access and must
260
+ check the caller's authority. The minimal starter demonstrates a public,
261
+ read-only `/api/greeting` function; it does not grant browser database access.
237
262
 
238
263
  ## Requirements
239
264