Skip to content

feat(dns): promote dns to the main menu, make zones add record scan opt-in - #114

Merged
jamie-at-bunny merged 3 commits into
mainfrom
dns-command
Jul 9, 2026
Merged

feat(dns): promote dns to the main menu, make zones add record scan opt-in#114
jamie-at-bunny merged 3 commits into
mainfrom
dns-command

Conversation

@jamie-at-bunny

Copy link
Copy Markdown
Member

No description provided.

@bogdan-at-bunny

Copy link
Copy Markdown

@codex review

@changeset-bot

changeset-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b4d070c

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

This PR includes changesets to release 6 packages
Name Type
@bunny.net/cli Minor
@bunny.net/cli-linux-x64 Minor
@bunny.net/cli-linux-arm64 Minor
@bunny.net/cli-darwin-x64 Minor
@bunny.net/cli-darwin-arm64 Minor
@bunny.net/cli-windows-x64 Minor

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

@greptile-apps

greptile-apps Bot commented Jul 9, 2026

Copy link
Copy Markdown

Greptile Summary

This PR graduates DNS from experimental to the main command menu and refines the dns zones add UX: the domain argument becomes optional (interactive prompt on TTY), and the record-import scan is no longer automatic — users now choose it from a menu alongside "upload zone file" and "add manually".

  • DNS promoted to main menu: dnsNamespace moves from experimentalCommands to commands in cli.ts, and the namespace now passes a visible description string instead of false.
  • Optional domain with interactive prompt: add [domain] prompts when omitted on a TTY (output !== "json" && isTTY); non-interactive/JSON mode requires the argument and throws a UserError without prompting.
  • Scan made opt-in: scanAndImport is extracted as a helper called from the "Scan" menu choice (or --import); it re-fetches the zone before discovering records to avoid re-importing records added earlier in the same menu session.

Confidence Score: 5/5

Safe to merge — the changes are additive UX improvements with no regressions on the existing scriptable paths.

The DNS graduation to the main menu is a one-line move in cli.ts. The zone add changes are straightforward: the domain prompt is correctly TTY-gated (including the output !== json guard), and the extracted scanAndImport helper re-fetches the zone before each scan to prevent duplicate imports. All existing --import and --no-import behaviours are preserved, and non-interactive/JSON callers are unaffected.

No files require special attention.

Important Files Changed

Filename Overview
packages/cli/src/commands/dns/zone/add.ts Domain argument made optional with interactive TTY prompt; auto-scan extracted into scanAndImport helper and moved behind a menu choice; interactive flag now also gates the domain prompt by combining TTY check with output !== "json"
packages/cli/src/cli.ts dnsNamespace moved from experimentalCommands to commands, promoting DNS to the main menu
packages/cli/src/commands/dns/index.ts dnsNamespace now passes a description string instead of false, making it visible in help output
AGENTS.md Documentation updated to remove 'experimental' label from dns/ and revise add.ts comment to reflect new opt-in scan behavior
packages/cli/README.md Removed 'Experimental — hidden from --help' warning; added example for domain-less zone add
README.md Updated dns zones add example to reflect the new interactive record-selection menu instead of auto-scan

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[bunny dns zones add] --> B{domain arg provided?}
    B -- yes --> D{interactive TTY?}
    B -- no --> C{interactive TTY\noutput != json?}
    C -- yes --> P[Prompt: Domain to manage DNS for]
    C -- no --> E[UserError: domain is required]
    P --> D
    D --> F[POST /dnszone — create zone]
    F --> G{output === json?}
    G -- yes --> H{--import flag?}
    H -- yes --> I[discoverImportableRecords + writeRecords]
    I --> J[Log JSON + return]
    H -- no --> J
    G -- no --> K[logger.success]
    K --> L{--import flag?}
    L -- yes --> M[scanAndImport assumesYes=true]
    M --> N[offerNextSteps menu?]
    L -- no --> N
    N -- doImport undefined & interactive --> O{menu loop}
    O --> Q[Scan existing records]
    O --> R[Upload BIND zone file]
    O --> S[Add records manually]
    O --> T[Continue]
    Q --> V[scanAndImport re-fetches zone assumesYes=false]
    V --> O
    R --> O
    S --> O
    T --> U[Check nameserver delegation Print NS instructions]
    N -- doImport !== undefined or !interactive --> U
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[bunny dns zones add] --> B{domain arg provided?}
    B -- yes --> D{interactive TTY?}
    B -- no --> C{interactive TTY\noutput != json?}
    C -- yes --> P[Prompt: Domain to manage DNS for]
    C -- no --> E[UserError: domain is required]
    P --> D
    D --> F[POST /dnszone — create zone]
    F --> G{output === json?}
    G -- yes --> H{--import flag?}
    H -- yes --> I[discoverImportableRecords + writeRecords]
    I --> J[Log JSON + return]
    H -- no --> J
    G -- no --> K[logger.success]
    K --> L{--import flag?}
    L -- yes --> M[scanAndImport assumesYes=true]
    M --> N[offerNextSteps menu?]
    L -- no --> N
    N -- doImport undefined & interactive --> O{menu loop}
    O --> Q[Scan existing records]
    O --> R[Upload BIND zone file]
    O --> S[Add records manually]
    O --> T[Continue]
    Q --> V[scanAndImport re-fetches zone assumesYes=false]
    V --> O
    R --> O
    S --> O
    T --> U[Check nameserver delegation Print NS instructions]
    N -- doImport !== undefined or !interactive --> U
Loading

Reviews (3): Last reviewed commit: "fix(dns): refetch zone before menu resca..." | Re-trigger Greptile

@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: 656ebe69e3

ℹ️ 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/zone/add.ts
Comment thread packages/cli/src/commands/dns/zone/add.ts Outdated
@jamie-at-bunny
jamie-at-bunny merged commit 11fbadd into main Jul 9, 2026
2 checks passed
@jamie-at-bunny
jamie-at-bunny deleted the dns-command branch July 9, 2026 11:49
@github-actions github-actions Bot mentioned this pull request Jul 9, 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