@somewhere-cloud/cli 0.38.145 → 0.38.147

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.38.147
4
+
5
+ - `somewhere git connect` returns the browser to https://somewhere.cloud/app.
6
+ - `somewhere git deploy` and `somewhere git status` print `Logs: somewhere logs <project>`. They used to link a dashboard logs tab, which is gone. In `--json`, `logs_command` replaces `logs_url`.
7
+
8
+ ## 0.38.146
9
+
10
+ - `somewhere init --link --project <app>` in an empty folder, for an app that already has a live release, now stops before writing any file and says to run `somewhere pull <app>` first. This keeps a later deploy from replacing a live app with the blank starter.
11
+ - `somewhere deploy` and `somewhere deploys` messages about an existing app now say `somewhere pull <app>` instead of `init --link`.
12
+
3
13
  ## 0.38.145
4
14
 
5
15
  - `somewhere tasks waiting` lists what is waiting for you across your projects: what agents have asked you to do, with the steps, the reason, who asked and when. `--project` reads one project; `--cursor` continues. It also lists what was answered and by which credential.
package/README.md CHANGED
@@ -94,7 +94,7 @@ For optional after-edit checking, explicitly run `somewhere hooks install --host
94
94
  | `somewhere logout` | Clear stored credentials |
95
95
  | `somewhere whoami` | Show current user and project count |
96
96
  | `somewhere init` | Write a starter; signed-in runs also create and link a project |
97
- | `somewhere init --link --project <id> --template auth` | Scaffold an empty directory and link an existing project; non-empty directories are link-only |
97
+ | `somewhere init --link --project <id>` | Link a folder that already holds the app’s source, or scaffold an unpublished project in an empty folder |
98
98
  | `somewhere projects` | List all projects with status |
99
99
  | `somewhere project create <name>` | Create a new project |
100
100
  | `somewhere project view [name]` | Show project details |
@@ -109,7 +109,7 @@ For optional after-edit checking, explicitly run `somewhere hooks install --host
109
109
  | `somewhere git connect [owner/repo]` | Install/authorize the GitHub App if needed, deploy repository HEAD, then deploy every push |
110
110
  | `somewhere git status` | Show connected repo, commit, deploy status, logs link, and live URL |
111
111
  | `somewhere git disconnect` | Stop push-to-deploy; the currently deployed site stays live |
112
- | `somewhere pull` | Download a project's live deployed source + scaffold tsconfig/package.json for local typechecking |
112
+ | `somewhere pull <app>` | Download the live source of an existing app and link the folder before editing |
113
113
  | `somewhere typecheck` | Checks the project with `tsc --noEmit` and reports advisory platform source warnings with a suggested fix. Install the project dependencies first. If TypeScript is absent, the CLI tells you before fetching it through npm. |
114
114
  | `somewhere logs` | Show recent logs |
115
115
  | `somewhere logs --follow` | Stream logs in real-time |
@@ -51844,7 +51844,7 @@ __export(init_exports, {
51844
51844
  import { basename, join as join8 } from "node:path";
51845
51845
  import { existsSync as existsSync8 } from "node:fs";
51846
51846
  function registerInit(program2) {
51847
- program2.command("init").description("Write a starter app with a generated AGENTS.md guide").option("--name <name>", "Project name (skip prompt); sign-in and invitation emails show it").option("--subdomain <slug>", "Subdomain for the new project; default: derived from --name").option("--link", "Scaffold an empty directory and link an existing project; non-empty directories are link-only").option("--project <ref>", "Existing project ID, name, slug, or subdomain (requires --link)").option("--bare", "Create and link only: no starter source or dependencies (AGENTS.md/CLAUDE.md are still added when absent)").option("--template <name>", "Starter to write: auth (default), minimal (auth route, no sign-in UI), or bare (link only)", "auth").option("--features <ids>", "Generate selected modules into an empty directory, comma-separated: auth, magic-link, private-data, agent (see --catalog)").option("--ui <mode>", "With --features: styled (default; src/ui + design tokens) or headless (hooks and plain markup)").option("--catalog", "Print the module catalog for --features and exit; no login, project or files").option("--dry-run", "With --features: validate the selection and print the file plan; nothing is created").option("--json", "Print the created or linked project as JSON").addHelpText("after", `
51847
+ program2.command("init").description("Write a starter app with a generated AGENTS.md guide").option("--name <name>", "Project name (skip prompt); sign-in and invitation emails show it").option("--subdomain <slug>", "Subdomain for the new project; default: derived from --name").option("--link", "Link local source or scaffold an unpublished project").option("--project <ref>", "Existing project ID, name, slug, or subdomain (requires --link)").option("--bare", "Create and link only: no starter source or dependencies (AGENTS.md/CLAUDE.md are still added when absent)").option("--template <name>", "Starter to write: auth (default), minimal (auth route, no sign-in UI), or bare (link only)", "auth").option("--features <ids>", "Generate selected modules into an empty directory, comma-separated: auth, magic-link, private-data, agent (see --catalog)").option("--ui <mode>", "With --features: styled (default; src/ui + design tokens) or headless (hooks and plain markup)").option("--catalog", "Print the module catalog for --features and exit; no login, project or files").option("--dry-run", "With --features: validate the selection and print the file plan; nothing is created").option("--json", "Print the created or linked project as JSON").addHelpText("after", `
51848
51848
  ${FIRST_CLI_PERMISSION}
51849
51849
 
51850
51850
  Recommended for a new app: run \`${cliInvocation()} init\` in an empty directory.
@@ -51859,6 +51859,8 @@ Init installs React, the SDK and editor types. The platform builds your source w
51859
51859
  TypeScript is fetched when first needed. Vite and Playwright are installed only if you choose to use them.
51860
51860
  New starters and --bare also install ${skillNames(BUNDLED_SKILLS_PACK).length} agent skills in .agents/skills, pinned by skills-lock.json.
51861
51861
 
51862
+ For a live app, run \`${cliInvocation()} pull <app>\` to get its source.
51863
+
51862
51864
  A directory that already holds an app (package.json, index.html, src/, \u2026) is
51863
51865
  linked and left untouched. A directory holding only other files (notes, a stray
51864
51866
  file) is refused before anything is created. Use --bare only to bring your own
@@ -52224,6 +52226,9 @@ async function linkExisting(client, dir, projectRef3, json = false, configureMcp
52224
52226
  if (!projectId)
52225
52227
  return;
52226
52228
  const project = result.projects.find((p2) => p2.id === projectId);
52229
+ if (scaffold && (project.has_promoted === true || (project.active_release_id ?? null) !== null)) {
52230
+ throw new Error(`Run \`${cliInvocation()} pull ${shellQuote(project.id)}\` to get this app\u2019s source before working on it.`);
52231
+ }
52227
52232
  const appUrl = await getAuthoritativeAppUrl(client, project.id).catch(() => null);
52228
52233
  await scaffold?.(project);
52229
52234
  const recordedCli = loadProjectConfig(dir)?.cli_version;
@@ -83981,7 +83986,7 @@ function formatSignedInUnlinkedExplanation() {
83981
83986
  "",
83982
83987
  "Next steps:",
83983
83988
  ` New project: run \`${cliInvocation()} init --bare --name <name>\` (creates it in your account and links this folder; adds .somewhere.json, AGENTS.md/CLAUDE.md and agent skills, no app source), then \`${cliInvocation()} deploy\`.`,
83984
- ` Existing project: run \`${cliInvocation()} init --link --project <name-or-id>\` (list yours with \`${cliInvocation()} projects\`), or deploy once with \`${cliInvocation()} deploy --project <name-or-id>\`.`
83989
+ ` Existing app: run \`${cliInvocation()} pull <app>\` in a fresh folder before editing (list yours with \`${cliInvocation()} projects\`).`
83985
83990
  ].join("\n");
83986
83991
  }
83987
83992
  function formatLinkedProjectAccessRefusal(signedIn2, dir) {
@@ -84024,7 +84029,7 @@ function formatLinkedProjectMismatchExplanation(linkedProjectId, ref, resolvedPr
84024
84029
  "",
84025
84030
  "Next steps:",
84026
84031
  ` Deploy this folder to its linked project: run \`${cliInvocation()} deploy\` (no --project).`,
84027
- ` Move this folder to ${ref} deliberately: delete this folder's .somewhere.json, then run \`${cliInvocation()} init --link --project ${ref}\`, \`${cliInvocation()} pull\`, re-apply your changes, and \`${cliInvocation()} deploy\`.`,
84032
+ ` Work on ${ref}: run \`${cliInvocation()} pull ${shellQuote(ref)} --out <fresh-folder>\`, re-apply your changes there, then run \`${cliInvocation()} deploy\`.`,
84028
84033
  ` Deploy a copy elsewhere: copy the files into an unlinked folder and run \`${cliInvocation()} deploy --project ${ref}\` there.`
84029
84034
  ].join("\n");
84030
84035
  }
@@ -84033,7 +84038,7 @@ function formatExplicitProjectBaseRequiredExplanation(ref) {
84033
84038
  `The live version of project ${ref} could not be read before deploying, and this folder has no record of which published version its files came from, so the deploy was NOT applied.`,
84034
84039
  "",
84035
84040
  "Next steps:",
84036
- ` Link and pull first: \`${cliInvocation()} init --link --project ${ref}\`, then \`${cliInvocation()} pull\`, re-apply your changes, then \`${cliInvocation()} deploy\`.`,
84041
+ ` Start with \`${cliInvocation()} pull ${shellQuote(ref)} --out <fresh-folder>\`, re-apply your changes there, then run \`${cliInvocation()} deploy\`.`,
84037
84042
  ` Or replace the live release deliberately: \`${cliInvocation()} deploy --project ${ref} --force --yes\`.`
84038
84043
  ].join("\n");
84039
84044
  }
@@ -84116,7 +84121,7 @@ No project yet? Signed out, deploy creates a temporary app and prints its claim
84116
84121
  Signed in, deploy never creates one on its own:
84117
84122
  ${cliInvocation()} init --bare --name <name> create a project in your account and link this folder
84118
84123
  ${cliInvocation()} deploy then deploy it
84119
- Existing project: \`${cliInvocation()} init --link --project <ref>\` (see \`${cliInvocation()} projects\`), or \`--project <ref>\` here.
84124
+ Existing app: \`${cliInvocation()} pull <app>\` downloads the live source and links your folder.
84120
84125
  `).option("--project <ref>", `Existing project to deploy to \u2014 accepts the project UUID, slug, or subdomain (all three resolve server-side). To create one, run \`${cliInvocation()} init --bare --name <name>\``).option("--scope <scope>", "Partial deploy: 'functions' (backend only, leaves the site untouched) or 'static' (site only, leaves functions untouched). Default deploys both.").option("--dry-run", "Show what would change (added / modified / removed files) in an already deployed project, without deploying. The files a deploy would publish are sent to Somewhere to compute the change; nothing is published. Never creates a project or a temporary workspace.").option("--replace-functions", "Delete deployed functions that are not in this directory. A full deploy already does; use it with --scope functions, which otherwise keeps them.").option("--prebuilt", "Deploy pre-built / bundled output (e.g. a dist/ folder) instead of raw source. Raw source is the default and recommended path: the platform compiles your TSX/JSX/TS on deploy, which keeps the app editable end-to-end. Choosing --prebuilt trades that away \u2014 pull/export round-trips, find/replace patches, and visual (source-map) editing are disabled for the bundled files. Use it only when you need full control of your own build.").option("--allow-bundled", "Alias for --prebuilt.").option("--new", "Publish to a new project and replace this folder\u2019s .somewhere.json link").option("--temporary", "Deploy to a temporary workspace and show when it expires (automatic when logged out)").option("--force", "Overwrite remote changes even when this machine last deployed an older version").option("--include <paths>", 'Publish a file or folder the deploy would otherwise hold back, e.g. --include NOTES.md or --include tests (comma-separate several, or repeat the flag). A "!NOTES.md" or "!tests/" line in .somewhereignore does the same thing permanently.', (value, previous = []) => previous.concat(value.split(",").map((v2) => v2.trim()).filter(Boolean))).option("--yes", "Skip confirmation prompts (for --force)").option("--verify [flow.json]", "After the deploy is live, run one browser verification flow at desktop and phone size. Omit the file for the default health check.").addOption(new Option("--test", "After a successful deploy, run somewhere test once against the new release").hideHelp()).option("-m, --message <text>", "Add a note for this version").option("--json", "Print the deploy result and its uploaded file list as JSON on stdout. Stderr reports files left out locally and the dotfile rule.").option("--list-unpublished", "List the local files deploy would keep on your machine, then exit").option("--allow-type-errors", "Upload even when the local TypeScript check fails").option("--timing", "Print deploy details and timings").action(async (dir, opts) => {
84121
84126
  const startupMs = performance.now();
84122
84127
  const targetDir = resolveTargetDir(dir);
@@ -84850,7 +84855,7 @@ ${dim("Build")}`);
84850
84855
  if (tempSession.handoffReady) {
84851
84856
  info(`Open ${link} and select "Save and connect agent" to work on the saved apps and create new ones. You can choose to include your other apps.`);
84852
84857
  } else if (besideRealLogin) {
84853
- info(`Open ${link} to save the app to your account, then run \`${cliInvocation()} init --link --project ${projectId}\` in an unlinked folder to work on it.`);
84858
+ info(`Open ${link} to save the app to your account, then run \`${cliInvocation()} pull ${shellQuote(projectId)}\` in a fresh folder to work on it.`);
84854
84859
  } else {
84855
84860
  info(`Open ${link} to save the app to your account, then run \`${cliInvocation()} login\` to connect this terminal.`);
84856
84861
  }
@@ -85432,7 +85437,8 @@ function registerDeploys(program2) {
85432
85437
  const note = entry.status === "success" && entry.message ? formatUserSuppliedNote(entry.message) : "";
85433
85438
  const restore = entry.restore?.body;
85434
85439
  const command = restore ? `${cliInvocation()} restore ${restore.version} --project ${shellQuote(restore.project_id)} --yes` : "";
85435
- console.log([version2, entry.promoted_at ?? entry.at ?? "\u2014", state, note, command].filter(Boolean).join(" "));
85440
+ const platform2 = entry.deployed_by?.kind === "platform" ? entry.deployed_by.name : void 0;
85441
+ console.log([version2, entry.promoted_at ?? entry.at ?? "\u2014", state, platform2, note, command].filter(Boolean).join(" "));
85436
85442
  }
85437
85443
  } catch (err) {
85438
85444
  historyError(err, options2.json);
@@ -132723,7 +132729,7 @@ async function waitForDeploy(client, projectId, commitSha) {
132723
132729
  function urls(projectId, servingUrl) {
132724
132730
  return {
132725
132731
  live_url: servingUrl,
132726
- logs_url: `${DASHBOARD}/projects/${encodeURIComponent(projectId)}?tab=logs`
132732
+ logs_command: `${cliInvocation()} logs ${projectId}`
132727
132733
  };
132728
132734
  }
132729
132735
  function registerGit(program2) {
@@ -132768,7 +132774,7 @@ function registerGit(program2) {
132768
132774
  } else {
132769
132775
  success(`Deployed ${connection.repo}@${commitSha.slice(0, 7)}`);
132770
132776
  info(`Status: ${connection.last_status}`);
132771
- info(`Logs: ${dim(links.logs_url)}`);
132777
+ info(`Logs: ${dim(links.logs_command)}`);
132772
132778
  if (links.live_url)
132773
132779
  info(`Live: ${teal(links.live_url)}`);
132774
132780
  }
@@ -132800,7 +132806,7 @@ function registerGit(program2) {
132800
132806
  info(`Status: ${connection.last_status || "waiting for first deploy"}`);
132801
132807
  if (connection.last_error)
132802
132808
  info(`Error: ${connection.last_error}`);
132803
- info(`Logs: ${dim(links.logs_url)}`);
132809
+ info(`Logs: ${dim(links.logs_command)}`);
132804
132810
  if (links.live_url)
132805
132811
  info(`Live: ${teal(links.live_url)}`);
132806
132812
  console.log("");
@@ -132849,7 +132855,7 @@ var init_git = __esm({
132849
132855
  init_output();
132850
132856
  init_project_urls();
132851
132857
  init_link_hint();
132852
- DASHBOARD = "https://somewhere.cloud/dashboard";
132858
+ DASHBOARD = "https://somewhere.cloud/app";
132853
132859
  INSTALL_TIMEOUT_MS = 5 * 6e4;
132854
132860
  DEPLOY_POLL_MS = 1500;
132855
132861
  __name(sleep2, "sleep");