Conversation
deploy now takes either a prebuilt --image (unchanged) or a source directory (positional <dir>). Source mode: mint a short-lived app-scoped Fly deploy token from the platform (POST /deploy-token), build+push <dir> with flyctl's remote builder (`flyctl deploy --build-only --push`, token via FLY_API_TOKEN env), pin the pushed image to its digest, then deploy it through the normal path. Requires a Dockerfile; writes a throwaway fly.toml stub only if the dir has none. Adds flyctl-build.ts (build/push helper + ensureFlyctl) + tests. The CLI never holds a standing Fly credential — the platform mints a scoped, expiring one. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`insta compute set-domain <host>` attaches a bring-your-own domain to a branch's compute service and prints the DNS records to set in your own registrar; `check-domain` re-checks cert status, `remove-domain` detaches. Fly issues the cert + routes — the CLI just relays the platform's records/status. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found across 5 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/commands/deploy.ts">
<violation number="1" location="src/commands/deploy.ts:39">
P2: Approval-gated source deploys now emit an extra error line and fail the command after the standard approval prompt, which diverges from the existing governance flow. This comes from calling `die(...)` after `handleApproval(tok)` instead of stopping cleanly once the approval message is printed.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| const port = opts.port ? Number(opts.port) : 8080 | ||
|
|
||
| const tok = await api.rawRequest('POST', `/projects/${projectId}/deploy-token`, { branch, group: opts.group }) | ||
| if (handleApproval(tok)) die('deploy requires approval — get it approved, then re-run') |
There was a problem hiding this comment.
P2: Approval-gated source deploys now emit an extra error line and fail the command after the standard approval prompt, which diverges from the existing governance flow. This comes from calling die(...) after handleApproval(tok) instead of stopping cleanly once the approval message is printed.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/commands/deploy.ts, line 39:
<comment>Approval-gated source deploys now emit an extra error line and fail the command after the standard approval prompt, which diverges from the existing governance flow. This comes from calling `die(...)` after `handleApproval(tok)` instead of stopping cleanly once the approval message is printed.</comment>
<file context>
@@ -1,16 +1,46 @@
+ const port = opts.port ? Number(opts.port) : 8080
+
+ const tok = await api.rawRequest('POST', `/projects/${projectId}/deploy-token`, { branch, group: opts.group })
+ if (handleApproval(tok)) die('deploy requires approval — get it approved, then re-run')
+ const { token, flyApp } = tok.body
+
</file context>
| if (handleApproval(tok)) die('deploy requires approval — get it approved, then re-run') | |
| if (handleApproval(tok)) process.exit(0) |
Render the customer-facing dimensions (cpu/memory/volume/egress/storage) the
platform now returns, with ram labelled 'memory'. Follows the platform
/projects/:id/usage change to a { dimensions, totalCostUsd } response.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The usage window now defaults to the current billing cycle; show it as 'billing cycle <start> → <end-1d>' (to is the exclusive next-cycle start). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Default `insta usage` to whole-org usage (org of the linked project) with a per-project cost breakdown; `--proj [id]` shows one project — the linked one, or a given project id. Both over the current billing cycle. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/commands/metrics.ts">
<violation number="1" location="src/commands/metrics.ts:50">
P2: `insta usage --proj <id>` still requires a linked project and exits before using the provided id. This happens because `requireProject()` runs unconditionally at function start; resolving the linked project only when `--proj` is omitted (or used without an id) would preserve the new explicit-id workflow.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
| // [id] for a single project (the linked one, or a given id). Billed dimensions, not raw fly/neon meters. | ||
| export async function usage(opts: { from?: string; to?: string; json?: boolean; proj?: string | boolean }): Promise<void> { | ||
| const api = await ApiClient.load() | ||
| const p = await requireProject() |
There was a problem hiding this comment.
P2: insta usage --proj <id> still requires a linked project and exits before using the provided id. This happens because requireProject() runs unconditionally at function start; resolving the linked project only when --proj is omitted (or used without an id) would preserve the new explicit-id workflow.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/commands/metrics.ts, line 50:
<comment>`insta usage --proj <id>` still requires a linked project and exits before using the provided id. This happens because `requireProject()` runs unconditionally at function start; resolving the linked project only when `--proj` is omitted (or used without an id) would preserve the new explicit-id workflow.</comment>
<file context>
@@ -25,24 +25,51 @@ export async function metrics(component: string, group: string | undefined, opts
+// [id] for a single project (the linked one, or a given id). Billed dimensions, not raw fly/neon meters.
+export async function usage(opts: { from?: string; to?: string; json?: boolean; proj?: string | boolean }): Promise<void> {
+ const api = await ApiClient.load()
+ const p = await requireProject()
+
+ if (opts.proj !== undefined && opts.proj !== false) {
</file context>
- name insta-cli → insta; drop private:true (was blocking publish) - files → dist/**/*.js so the ~440MB bun binaries in dist/bin are not shipped - add engines(node>=18), prepublishOnly build, repo/homepage/bugs/keywords, publishConfig.access=public, license - --version now reads the installed package.json (npm/node) instead of reporting 0.0.0; standalone binary still uses INSTA_CLI_VERSION Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Translate README fully to English (public-facing package) - Bump version 0.0.2 -> 0.0.3 - Switch license MIT -> Apache-2.0, add LICENSE file Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="README.md">
<violation number="1" location="README.md:73">
P2: The README command reference is out of sync with the new CLI features introduced in this PR. The `deploy` command now supports a source directory (`insta deploy <dir>` for remote Fly builds), but the table still lists only `insta deploy --image <url>`. The new `insta compute set-domain/check-domain/remove-domain` commands are entirely absent. Additionally, the closing note says `"image building will come later"`, which is now stale because source-directory deploy is implemented. Updating the README keeps the CLI contract discoverable for users and avoids contradiction between docs and code.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
| | `insta branch list [--json]` / `switch <name>` / `delete <name>` | Branch management | | ||
| | `insta secrets [--branch -o --print --json]` | Secret seam: write credentials to `.env` | | ||
| | `insta secrets list [--branch]` | List secret names only | | ||
| | `insta deploy --image <url> [--branch --group --port]` | Deploy an image | |
There was a problem hiding this comment.
P2: The README command reference is out of sync with the new CLI features introduced in this PR. The deploy command now supports a source directory (insta deploy <dir> for remote Fly builds), but the table still lists only insta deploy --image <url>. The new insta compute set-domain/check-domain/remove-domain commands are entirely absent. Additionally, the closing note says "image building will come later", which is now stale because source-directory deploy is implemented. Updating the README keeps the CLI contract discoverable for users and avoids contradiction between docs and code.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At README.md, line 73:
<comment>The README command reference is out of sync with the new CLI features introduced in this PR. The `deploy` command now supports a source directory (`insta deploy <dir>` for remote Fly builds), but the table still lists only `insta deploy --image <url>`. The new `insta compute set-domain/check-domain/remove-domain` commands are entirely absent. Additionally, the closing note says `"image building will come later"`, which is now stale because source-directory deploy is implemented. Updating the README keeps the CLI contract discoverable for users and avoids contradiction between docs and code.</comment>
<file context>
@@ -1,117 +1,118 @@
+| `insta branch list [--json]` / `switch <name>` / `delete <name>` | Branch management |
+| `insta secrets [--branch -o --print --json]` | Secret seam: write credentials to `.env` |
+| `insta secrets list [--branch]` | List secret names only |
+| `insta deploy --image <url> [--branch --group --port]` | Deploy an image |
+| `insta manifest [--json]` | Agent-readable environment manifest |
+| `insta metrics <db\|compute> [group] [--branch --from --to --step --json]` | Resource metrics (compute=Fly; db limited) |
</file context>
insta deploy <dir>— source-directory deployDeploy a source directory (needs a
Dockerfile) built remotely on Fly's builder, in addition to the existing--image <url>. The platform mints a short-lived, app-scoped Fly deploy token, so the CLI never holds a standing Fly credential; the pushed image is pinned to its digest.insta compute set-domain— developer custom domainsinsta compute set-domain / check-domain / remove-domain <host>: attach a bring-your-own domain to a branch's compute service. Fly issues the cert + routes; the CLI prints the DNS records to set in your own registrar.Auto-install agent skills on link
insta project create/linknow install the related agent skills (insta, neon-postgres, tigris, better-auth) vianpx skills add, fully non-interactively.Tests: flyctl build/push helper + skills-install. All green.
🤖 Generated with Claude Code
Summary by cubic
Adds source-directory deploys, compute custom domains, and auto-install of agent skills, plus clearer usage reporting. Preps for public release and publishes the CLI as the
instanpm package; keeps--imagedeploys with digest pinning and no long‑lived Fly creds.New Features
insta deploy <dir>builds remotely withflyctl, pushes with a short‑lived app token, and pins by digest. Requires aDockerfile. Exactly one of<dir>or--image. Respects--branch|--group|--port. Auto‑installsflyctlon macOS if missing (best‑effort).insta compute set-domain|check-domain|remove-domain <host>attaches BYO domains to a branch service. Prints DNS records and cert status.insta project create|linkrunsnpx skills addforinsta,neon-postgres,tigris, andbetter-authnon‑interactively.ram→memory; labels the window asbilling cycle <start> → <end-1d>. Defaults to org usage with a per‑project breakdown; use--proj [id]for a single project.Dependencies
instaon npm: rename package,enginesnode>=18, public publish, and narrowfilestodist/**/*.js.--versionnow reads the installedpackage.jsonfor npm builds; the standalone binary still usesINSTA_CLI_VERSION. License switched to Apache‑2.0 (adds LICENSE). README fully translated to English. Version bumped to0.0.3.Written for commit 5681a64. Summary will update on new commits.