@inquir/compute-cli 0.1.3 → 0.2.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 (40) hide show
  1. package/README.md +64 -5
  2. package/dist/commands/apps.d.ts +21 -0
  3. package/dist/commands/apps.d.ts.map +1 -0
  4. package/dist/commands/apps.js +857 -0
  5. package/dist/commands/apps.js.map +1 -0
  6. package/dist/commands/deploy.d.ts.map +1 -1
  7. package/dist/commands/deploy.js +207 -93
  8. package/dist/commands/deploy.js.map +1 -1
  9. package/dist/commands/init.d.ts.map +1 -1
  10. package/dist/commands/init.js +4 -2
  11. package/dist/commands/init.js.map +1 -1
  12. package/dist/commands/mcp.d.ts +15 -0
  13. package/dist/commands/mcp.d.ts.map +1 -0
  14. package/dist/commands/mcp.js +269 -0
  15. package/dist/commands/mcp.js.map +1 -0
  16. package/dist/index.js +11 -1
  17. package/dist/index.js.map +1 -1
  18. package/dist/utils/api.d.ts +52 -2
  19. package/dist/utils/api.d.ts.map +1 -1
  20. package/dist/utils/api.js +95 -2
  21. package/dist/utils/api.js.map +1 -1
  22. package/dist/utils/apps-presentation.d.ts +25 -0
  23. package/dist/utils/apps-presentation.d.ts.map +1 -0
  24. package/dist/utils/apps-presentation.js +71 -0
  25. package/dist/utils/apps-presentation.js.map +1 -0
  26. package/dist/utils/auth.d.ts.map +1 -1
  27. package/dist/utils/auth.js +13 -5
  28. package/dist/utils/auth.js.map +1 -1
  29. package/dist/utils/context.d.ts.map +1 -1
  30. package/dist/utils/context.js +3 -1
  31. package/dist/utils/context.js.map +1 -1
  32. package/dist/utils/detect.d.ts +45 -0
  33. package/dist/utils/detect.d.ts.map +1 -0
  34. package/dist/utils/detect.js +358 -0
  35. package/dist/utils/detect.js.map +1 -0
  36. package/dist/utils/ensure-auth.d.ts.map +1 -1
  37. package/dist/utils/ensure-auth.js +7 -1
  38. package/dist/utils/ensure-auth.js.map +1 -1
  39. package/package.json +5 -4
  40. package/skill/SKILL.md +60 -0
package/README.md CHANGED
@@ -4,18 +4,30 @@ CLI for workspace-first Inquir Compute development.
4
4
 
5
5
  ## Install
6
6
 
7
- Global:
7
+ Global (recommended). `@latest` also upgrades an existing install to the newest
8
+ published version:
8
9
 
9
10
  ```bash
10
- npm install -g @inquir/compute-cli
11
+ npm install -g @inquir/compute-cli@latest
11
12
  ```
12
13
 
13
- Or run with `npx`:
14
+ Verify it's on your `PATH`:
14
15
 
15
16
  ```bash
16
- npx @inquir/compute-cli --help
17
+ inquir --version
18
+ inquir --help
19
+ ```
20
+
21
+ Or run without installing:
22
+
23
+ ```bash
24
+ npx @inquir/compute-cli@latest --help
17
25
  ```
18
26
 
27
+ > Requires **Node.js 22+**. To upgrade later, re-run the install command above. On
28
+ > macOS/Linux you may need `sudo` for a global install, or use a Node version
29
+ > manager (nvm/fnm) to avoid it. To remove: `npm uninstall -g @inquir/compute-cli`.
30
+
19
31
  ## Concepts
20
32
 
21
33
  - **Function**: a single compute unit with typed input/output (Zod schemas). Defined with `defineFunction()`. Run locally with `inquir run`, deployed and invoked remotely with `inquir deploy` / `inquir invoke`.
@@ -134,6 +146,53 @@ OIDC auth), or run `inquir deploy --ci`.
134
146
  - `inquir rollback <function> [deployId]` - roll back to a previous successful deploy.
135
147
  - `inquir delete <function>` - delete a remote function (asks for confirmation; `--yes` to skip).
136
148
 
149
+ **Container services (apps)**
150
+
151
+ Long-lived containers from any OCI image — the counterpart to functions. HTTP
152
+ ports are served over a hostname; TCP ports are published and dialled directly,
153
+ so a database, SMTP relay or SSH endpoint is a first-class service with no
154
+ runtime adapter involved.
155
+
156
+ - `inquir apps list` - list applications.
157
+ - `inquir apps create <name> [--port <n>] [--tcp …] [--set K=V]` - create an application.
158
+ - `inquir apps deploy <app> [--image <ref>]` - start a release and wait until it is healthy. Without `--image` the current directory (or `--dir`) is built from its Dockerfile first; `--build <id>` releases an existing build.
159
+ - `inquir apps build <app> [--dir <path>] [--dockerfile <f>] [--context <dir>] [--build-arg K=V]` - build an image from source without releasing it.
160
+ - `inquir apps builds <app>` - build history (`--cancel <buildId>` drops a queued build).
161
+ - `inquir apps status <app>` - endpoints, hostnames and recent releases.
162
+ - `inquir apps logs <app|release|build> [--tail <n>]` - stream container (or build) logs.
163
+ - `inquir apps promote <release>` - send production traffic to a release (needs a login, not an API key).
164
+ - `inquir apps rollback <app>` - return production to the previous release.
165
+ - `inquir apps stop <release>` - stop any release that is not serving production.
166
+ - `inquir apps exec <app> -- <command>` - run a command inside the container (owner/admin login only — it can read every secret).
167
+ - `inquir apps update <app> [--set K=V] [--port …] [--egress none|full] …` - change settings; applies to the next release.
168
+ - `inquir apps domain <app> [hostname] [--verify|--remove]` - bind a custom hostname; publish the printed TXT record and point DNS at the platform, then `--verify`.
169
+ - `inquir apps delete <app> --yes` - archive an application (stops every release, unbinds every hostname).
170
+
171
+ ```bash
172
+ # an HTTP service built from the Dockerfile in the current directory
173
+ inquir apps create web --port 3000
174
+ inquir apps deploy web
175
+ inquir apps promote <releaseId>
176
+
177
+ # ...or from a prebuilt image
178
+ inquir apps deploy web --image nginx:alpine
179
+
180
+ # a database: no HTTP port at all, published on a pinned port,
181
+ # health-checked by asking the service itself
182
+ inquir apps create db \
183
+ --tcp postgres:5432:public:25432 \
184
+ --health-command "pg_isready -h 127.0.0.1" \
185
+ --set POSTGRES_PASSWORD=secret
186
+ inquir apps deploy db --image postgres:16-alpine
187
+ ```
188
+
189
+ `--tcp name:port[:public][:hostPort]` — `public` publishes beyond loopback,
190
+ and a pinned `hostPort` keeps a connection string valid across restarts (an
191
+ unpinned port is reassigned every time the container is recreated). A public
192
+ TCP port is reachable by anyone who can reach the host: the platform
193
+ terminates no TLS and checks no credentials on raw TCP, so the service must
194
+ authenticate its own clients.
195
+
137
196
  **Diagnostics & config**
138
197
 
139
198
  - `inquir doctor` - diagnose environment, credentials, and API connectivity (`--json` for a report).
@@ -333,6 +392,6 @@ Tips:
333
392
  - After publishing, anyone can install and deploy:
334
393
 
335
394
  ```bash
336
- npm install -g @inquir/compute-cli
395
+ npm install -g @inquir/compute-cli@latest
337
396
  inquir --help
338
397
  ```
@@ -0,0 +1,21 @@
1
+ import { type AppPortSpec, type AppRuntimeSpec, type Release } from '../utils/api.js';
2
+ export declare function appsCommand(args: string[]): Promise<void>;
3
+ /**
4
+ * `--tcp name:port[:public][:hostPort]` — the shorthand people actually want
5
+ * to type for a database or SSH endpoint.
6
+ */
7
+ export declare function parseTcpPortFlag(value: string): AppPortSpec;
8
+ export declare function parseSetFlags(values: string[]): Record<string, string>;
9
+ /** Runtime spec assembled from flags; undefined when nothing was specified. */
10
+ export declare function buildRuntimeFromFlags(args: string[]): AppRuntimeSpec | undefined;
11
+ /**
12
+ * Where a client can actually connect. Public endpoints first; a host-local
13
+ * port is still printed (marked as such) because on an installation with no
14
+ * public hostname it is the only way in.
15
+ */
16
+ export declare function releaseEndpointLines(release: Release, previewUrl?: string, options?: {
17
+ includeHostLocal?: boolean;
18
+ }): string[];
19
+ /** A build-sourced release is best named by its build; a pulled one by its ref. */
20
+ export declare function describeImage(release: Pick<Release, 'imageSource' | 'buildId' | 'imageRef' | 'imageDigest'>): string;
21
+ //# sourceMappingURL=apps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/commands/apps.ts"],"names":[],"mappings":"AAEA,OAAO,EAyBL,KAAK,WAAW,EAChB,KAAK,cAAc,EAGnB,KAAK,OAAO,EAEb,MAAM,iBAAiB,CAAC;AAgCzB,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA8C/D;AAqDD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CA6B3D;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUtE;AAED,+EAA+E;AAC/E,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,cAAc,GAAG,SAAS,CAuChF;AA+PD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,GAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAO,GAC3C,MAAM,EAAE,CAwBV;AAED,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC,GAAG,MAAM,CAGpH"}