Skip to content

feat(dns): manage Scriptable DNS scripts with ambient runtime types#104

Merged
jamie-at-bunny merged 7 commits into
mainfrom
feat/dns-scriptable-scripts
Jun 29, 2026
Merged

feat(dns): manage Scriptable DNS scripts with ambient runtime types#104
jamie-at-bunny merged 7 commits into
mainfrom
feat/dns-scriptable-scripts

Conversation

@jamie-at-bunny

Copy link
Copy Markdown
Member

No description provided.

@changeset-bot

changeset-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d775ff3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@bunny.net/cli Patch
@bunny.net/scriptable-dns-types Patch
@bunny.net/cli-linux-x64 Patch
@bunny.net/cli-linux-arm64 Patch
@bunny.net/cli-darwin-x64 Patch
@bunny.net/cli-darwin-arm64 Patch
@bunny.net/cli-windows-x64 Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jamie-at-bunny jamie-at-bunny marked this pull request as ready for review June 25, 2026 14:15
@bogdan-at-bunny

Copy link
Copy Markdown

@codex review

@greptile-apps

greptile-apps Bot commented Jun 25, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds Scriptable DNS script management to the CLI. The main changes are:

  • New bunny dns scripts commands for init, create, deploy, attach, link, and list.
  • Interactive DNS record creation can choose static or script-computed answers.
  • A new ambient types package for Scriptable DNS runtime globals.
  • Updated docs, workspace metadata, and DNS command registration.

Confidence Score: 4/5

This is close, but the manifest validation gap should be fixed before merging.

  • Explicit DNS script IDs are checked before use.
  • Linked DNS script IDs can still bypass that check.
  • That can make deploy or attach operate on a non-DNS script when a stale or edited manifest is present.

packages/cli/src/commands/dns/scripts/interactive.ts

Important Files Changed

Filename Overview
packages/cli/src/commands/dns/scripts/interactive.ts Adds DNS script selection helpers, but the linked manifest path skips remote script-type validation.
packages/cli/src/commands/dns/scripts/api.ts Adds compute API helpers for DNS script fetch, list, create, upload, and publish.
packages/cli/src/commands/dns/record/add.ts Adds interactive support for creating SCRIPT records from script-computed DNS answers.
packages/scriptable-dns-types/index.d.ts Adds ambient Scriptable DNS runtime declarations for scaffolded projects and editor typechecking.

Fix All in Claude Code

Reviews (6): Last reviewed commit: "add comment about publish script" | Re-trigger Greptile

Comment thread packages/cli/src/commands/dns/scripts/interactive.ts Outdated
Comment thread packages/cli/src/commands/dns/scripts/api.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9171b922fd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/cli/src/commands/dns/scripts/deploy.ts Outdated
Comment thread packages/scriptable-dns-types/index.d.ts Outdated
Comment thread packages/cli/src/commands/dns/scripts/init.ts
Comment thread packages/cli/src/commands/dns/scripts/api.ts Outdated
Comment thread packages/cli/src/commands/dns/scripts/interactive.ts Outdated
Comment thread packages/cli/src/commands/dns/scripts/api.ts
Comment thread packages/scriptable-dns-types/index.d.ts
Comment thread packages/cli/src/commands/dns/scripts/api.ts
@jamie-at-bunny jamie-at-bunny merged commit 1aa67e0 into main Jun 29, 2026
2 checks passed
Comment on lines +43 to +46
if (manifest.id) {
logger.dim(`Using linked DNS script ${manifest.name ?? manifest.id}.`);
return manifest.id;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Validate Manifest Script

The linked-manifest path returns manifest.id without checking that the remote script is still a Scriptable DNS script. deploy and attach commonly omit the ID and rely on this branch, so an older or hand-edited .bunny/dns-script.json can still point at a regular Edge Script and cause DNS code to be uploaded or a SCRIPT record to be attached to the wrong script type. Validate the manifest ID through fetchDnsScript before returning it, matching the explicit-ID path above.

Suggested change
if (manifest.id) {
logger.dim(`Using linked DNS script ${manifest.name ?? manifest.id}.`);
return manifest.id;
}
if (manifest.id) {
await fetchDnsScript(client, manifest.id);
logger.dim(`Using linked DNS script ${manifest.name ?? manifest.id}.`);
return manifest.id;
}

Fix in Claude Code

@jamie-at-bunny jamie-at-bunny deleted the feat/dns-scriptable-scripts branch June 29, 2026 13:49
@github-actions github-actions Bot mentioned this pull request Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants