Skip to content

feat(host): add prune and rename subcommands#10

Merged
ntwrknrd merged 1 commit intomainfrom
feat/host-prune-rename
Feb 22, 2026
Merged

feat(host): add prune and rename subcommands#10
ntwrknrd merged 1 commit intomainfrom
feat/host-prune-rename

Conversation

@ntwrknrd
Copy link
Copy Markdown
Owner

Summary

  • host prune: DNS-resolve all configured hosts, detect NXDOMAIN/timeout entries and in-file duplicates, present interactive multi-select for removal with backup before writes
  • host rename: Detect CNAME changes across hosts, update Host alias and HostName to match the new canonical name while keeping the old alias; merges into existing entries when the target host already exists
  • Shared concurrent DNS resolution (20-worker pool with retry) in dns.go

Test plan

  • make build succeeds
  • nssh host prune resolves all hosts and presents stale/duplicate candidates
  • nssh host rename detects CNAME changes and updates config correctly
  • Merge path works when renamed host collides with an existing entry
  • Backup files created before config writes
  • Help snapshots match: go test ./cmd/nssh -args -update-snapshots

host prune: DNS-resolve all configured hosts, detect NXDOMAIN/timeout
entries and in-file duplicates, present interactive multi-select for
removal with backup before writes.

host rename: detect CNAME changes across hosts, update Host alias and
HostName to match the new canonical name while keeping the old alias.
Merges into existing entries when the target host already exists.

Shared DNS resolution in dns.go uses a 20-worker concurrent pool with
retry on timeout. Includes deduplication and duplicate-detection helpers.
@ntwrknrd ntwrknrd merged commit bfdfc37 into main Feb 22, 2026
12 of 13 checks passed
@ntwrknrd ntwrknrd deleted the feat/host-prune-rename branch February 22, 2026 03:16
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.

1 participant