@lotics/cli 0.30.1 → 0.30.2

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.
@@ -78,6 +78,14 @@ export declare function appCreate(client: LoticsClient, args: {
78
78
  * 6. (TODO) Generate `.lotics/types.ts` with workspace tables augmentation —
79
79
  * pending a `client.getWorkspaceSchema()` endpoint.
80
80
  */
81
+ /**
82
+ * `lotics app subdomain <new>` — rename the current app's public address.
83
+ * The app_id comes from the local `package.json` manifest. The old
84
+ * `<slug>.lotics.app` stops resolving once the change lands.
85
+ */
86
+ export declare function appSetSubdomain(client: LoticsClient, args: {
87
+ subdomain: string;
88
+ }): Promise<void>;
81
89
  export declare function appPull(client: LoticsClient, args: {
82
90
  app_id: string;
83
91
  targetPath?: string;
@@ -189,6 +189,16 @@ export async function appCreate(client, args) {
189
189
  * 6. (TODO) Generate `.lotics/types.ts` with workspace tables augmentation —
190
190
  * pending a `client.getWorkspaceSchema()` endpoint.
191
191
  */
192
+ /**
193
+ * `lotics app subdomain <new>` — rename the current app's public address.
194
+ * The app_id comes from the local `package.json` manifest. The old
195
+ * `<slug>.lotics.app` stops resolving once the change lands.
196
+ */
197
+ export async function appSetSubdomain(client, args) {
198
+ const meta = readAppMeta(process.cwd());
199
+ const result = await client.setAppSubdomain(meta.app_id, args.subdomain);
200
+ console.error(`Public address set: https://${result.public_subdomain}.lotics.app`);
201
+ }
192
202
  export async function appPull(client, args) {
193
203
  const app = await client.getApp(args.app_id);
194
204
  if (!app.current_version_id) {
package/dist/src/cli.js CHANGED
@@ -5,7 +5,7 @@ import readline from "node:readline";
5
5
  import { LoticsClient, API_BASE_URL } from "./client.js";
6
6
  import { resolveAuth, loadConfig, saveConfig, deleteConfig, getConfigPath, checkForUpdate } from "./config.js";
7
7
  import { VERSION } from "./version.js";
8
- import { appCreate, appPull, appDeploy, appDev } from "./app_commands.js";
8
+ import { appCreate, appPull, appDeploy, appDev, appSetSubdomain } from "./app_commands.js";
9
9
  import { parseArgs } from "./args.js";
10
10
  function printHelp() {
11
11
  console.log(`Lotics CLI v${VERSION} — AI agent interface for Lotics
@@ -51,6 +51,7 @@ COMMANDS
51
51
  Build + upload current dir as a new version
52
52
  (--force-workflow-sync wipes server-only
53
53
  workflow aliases; default refuses)
54
+ lotics app subdomain <new-subdomain> Rename the app's public <slug>.lotics.app address
54
55
  lotics app dev [path] Run the app locally with HMR (RPC forwarded to prod)
55
56
 
56
57
  FLAGS
@@ -359,6 +360,7 @@ async function main() {
359
360
  console.error(" lotics app pull <app_id> [path] Pull an existing app for local editing");
360
361
  console.error(" lotics app deploy [-m <message>] [--force-workflow-sync]");
361
362
  console.error(" Build + upload the current directory");
363
+ console.error(" lotics app subdomain <new-subdomain> Rename the app's public <slug>.lotics.app address");
362
364
  console.error(" lotics app dev [path] Run the app locally with HMR + RPC forwarding");
363
365
  process.exit(1);
364
366
  }
@@ -481,6 +483,16 @@ async function main() {
481
483
  await appDeploy(client, { message, forceWorkflowSync: flags.forceWorkflowSync });
482
484
  return;
483
485
  }
486
+ if (subcommand === "subdomain") {
487
+ const newSubdomain = toolArgs;
488
+ if (!newSubdomain) {
489
+ console.error("Usage: lotics app subdomain <new-subdomain>");
490
+ console.error("Renames the app's public address — https://<slug>.lotics.app");
491
+ process.exit(1);
492
+ }
493
+ await appSetSubdomain(client, { subdomain: newSubdomain });
494
+ return;
495
+ }
484
496
  if (subcommand === "dev") {
485
497
  // First positional is an optional project path (defaults to cwd).
486
498
  // --port and --vite-port can override the wrapper / Vite ports.
@@ -105,6 +105,15 @@ export declare class LoticsClient {
105
105
  workspace_id: string;
106
106
  current_version_id: string | null;
107
107
  }>;
108
+ /**
109
+ * Rename an app's public subdomain — its `<slug>.lotics.app` address.
110
+ * Mirrors PUT /v1/apps/{app_id}/subdomain. The old subdomain stops
111
+ * resolving once the change lands.
112
+ */
113
+ setAppSubdomain(app_id: string, public_subdomain: string): Promise<{
114
+ app_id: string;
115
+ public_subdomain: string;
116
+ }>;
108
117
  getAppVersion(app_id: string, version_id: string): Promise<{
109
118
  id: string;
110
119
  app_id: string;
@@ -149,6 +149,14 @@ export class LoticsClient {
149
149
  async createApp(body) {
150
150
  return this.request("POST", "/v1/apps", { ...body, ui: { type: "custom_code" } });
151
151
  }
152
+ /**
153
+ * Rename an app's public subdomain — its `<slug>.lotics.app` address.
154
+ * Mirrors PUT /v1/apps/{app_id}/subdomain. The old subdomain stops
155
+ * resolving once the change lands.
156
+ */
157
+ async setAppSubdomain(app_id, public_subdomain) {
158
+ return this.request("PUT", `/v1/apps/${encodeURIComponent(app_id)}/subdomain`, { public_subdomain });
159
+ }
152
160
  async getAppVersion(app_id, version_id) {
153
161
  return this.request("GET", `/v1/apps/${encodeURIComponent(app_id)}/versions/${encodeURIComponent(version_id)}`);
154
162
  }
@@ -31,10 +31,19 @@ export async function startDevServer(args) {
31
31
  });
32
32
  // ── Vite child ──────────────────────────────────────────────────────────
33
33
  // `npx vite` resolves to the project's installed Vite (devDependency in
34
- // the starter). Inherit stdio so the dev sees Vite's own banner + HMR logs.
34
+ // the starter). stdout/stderr are inherited so the dev sees Vite's banner
35
+ // + HMR logs.
36
+ //
37
+ // stdin is inherited ONLY under a TTY. Vite's dev server quits when a
38
+ // non-interactive stdin (a backgrounded launch, `</dev/null`, a closing
39
+ // pipe) reaches EOF — so inheriting it would kill the dev server the moment
40
+ // `lotics app dev` runs under an agent, CI, or `nohup`. A non-TTY launch
41
+ // gets `/dev/null` (`"ignore"`) instead, decoupling Vite's lifetime from
42
+ // however the wrapper was started. Vite's CLI shortcuts (`r`/`q`/`u`) are
43
+ // only meaningful under a TTY anyway.
35
44
  const viteChild = spawn("npx", ["vite", "--port", String(vitePort), "--strictPort"], {
36
45
  cwd: args.projectDir,
37
- stdio: "inherit",
46
+ stdio: [process.stdin.isTTY ? "inherit" : "ignore", "inherit", "inherit"],
38
47
  env: { ...process.env, FORCE_COLOR: "1" },
39
48
  });
40
49
  let stopped = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotics/cli",
3
- "version": "0.30.1",
3
+ "version": "0.30.2",
4
4
  "description": "Lotics SDK and CLI for AI agents",
5
5
  "type": "module",
6
6
  "bin": {