feat: NetBox insights, host tools and configurable TUI
Test / test (pull_request) Successful in 4m15s

- info/open/whois: NetBox details (site, nested locations, rack units,
  role, platform, tenant, IPs per interface), web page, reverse IP lookup
- cache status, site, role, platform, tenant, location chain and rack;
  ask before connecting to hosts in ssh.warn_status (--force skips)
- ssh rules and command restrictions match site/role/platform/tenant/status
- tui.columns selects what the TUI shows; optional TCP reachability column;
  detail view (Ctrl+L), NetBox page (Ctrl+G), status/location filters
- resolver.fallback tries other strategies' addresses when unreachable
- copy-id, known-hosts reset and address-change notices
- export ansible (YAML/INI) and export ssh-config
- token: keyring stores NetBox tokens in the system keyring
- fix stale menu number in testenv configure test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-18 12:33:59 +01:00
1 parent e5bde9c61f
commit 1660bb3098
39 files changed
+4868 -96

No files matched your search

+9 -1
View File
@@ -60,6 +60,12 @@ func doctorCmd() *cobra.Command {
report("program "+p, err)
}
report("cache", newCache(cfg).Load())
for _, instance := range instanceConfigs(cfg) {
if config.IsKeyringToken(instance.Token) {
_, err := resolveToken(*instance)
report("keyring token "+instance.KeyringAccount(), err)
}
}
if online {
sources := cfg.NetBoxes
if len(sources) == 0 && cfg.NetBox.URL != "" {
@@ -67,7 +73,8 @@ func doctorCmd() *cobra.Command {
}
for _, s := range sources {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
_, err := netbox.NewClient(s.URL, s.Token, s.TokenVersion).Search(ctx, "", netbox.SearchOptions{})
token, version := clientToken(s)
_, err := netbox.NewClient(s.URL, token, version).Search(ctx, "", netbox.SearchOptions{})
cancel()
report("NetBox "+s.Name, err)
}
@@ -109,6 +116,7 @@ func explainCmd() *cobra.Command {
}
return json.NewEncoder(cmd.OutOrStdout()).Encode(map[string]any{
"target": h.Name, "instance": selectors.Instance, "address": h.IP, "source": h.Origin, "cached_at": h.CachedAt,
"status": h.Status, "site": h.Site.Name, "role": h.Role.Name, "platform": h.Platform.Name, "tenant": h.Tenant.Name, "netbox_id": h.ID, "location": h.LocationPath(),
"resolver_order": cfg.Resolver.Strategies, "resolver_used": strategy, "matching_rules": rules, "user": user, "port": port, "ssh": opts,
})
}}