Nightshift Idea Generator β Microck/tailstick
Analysis of the tailstick codebase for enhancement ideas, feature opportunities, and quality improvements.
π‘ High-Value Ideas
1. Lease Status Dashboard / Web UI
Severity: P2 (Enhancement) | Effort: Medium
tailstick already has a gui subcommand with internal/gui/server.go for browser-based enrollment. Extend this to show a live lease dashboard β current leases, their status, expiration countdowns, and quick cleanup actions. The existing model.LocalState and state.Load() provide all the data needed.
Files: internal/gui/server.go, internal/gui/index.html
2. Lease History & Expiry Notifications
Severity: P2 (Enhancement) | Effort: Low
The agent (AgentRun) reconciles every minute but has no notification mechanism. Add optional desktop notifications (via notify-send on Linux, toast on Windows) when a lease is about to expire (e.g., 1 hour before) or when cleanup completes. This gives operators visibility without checking the CLI.
Files: internal/app/workflow.go (in AgentOnce)
3. Multi-Config Support / Named Profiles
Severity: P2 (Enhancement) | Effort: Medium
Currently a single tailstick.config.json is loaded. For operators managing multiple tailnets or environments (staging vs production), support named config profiles: --config-profile=production that resolves to a named config path. This avoids manual --config flag management.
Files: internal/config/config.go, internal/app/cli.go
4. tailstick status Command
Severity: P2 (Enhancement) | Effort: Low
Add a top-level status subcommand that shows active leases, their modes, expiration times, and the agent's last reconciliation result β without requiring elevated privileges. Currently, operators need to parse the state JSON file manually.
Files: internal/app/cli.go (add runStatus)
5. Lease Annotations / Tags
Severity: P3 (Nice-to-have) | Effort: Low
Add optional --tags and --note flags to enrollment. Store these in LeaseRecord and include them in audit entries. Useful for operators to annotate why a lease was created (e.g., --tags=incident-1234 --note="emergency remote access for vendor").
Files: internal/model/types.go (extend LeaseRecord and RuntimeOptions)
π§ Quality & DX Improvements
6. Structured Logging Migration
Severity: P3 (Nice-to-have) | Effort: Low
The internal/logging/logger.go appears to use a custom format. Consider emitting structured JSON logs (or offering a --log-format=json flag) to integrate with log aggregation tools (Grafana Loki, Datadog).
Files: internal/logging/logger.go
7. Shell Completions
Severity: P3 (Nice-to-have) | Effort: Low
Generate bash/zsh/fish shell completions for the CLI. The flag package makes this straightforward, and it significantly improves operator experience for the many flags on run (preset, mode, channel, days, etc.).
Files: internal/app/cli.go (add completion subcommand)
8. Configuration Validation Command
Severity: P2 (Enhancement) | Effort: Low
Add tailstick validate-config that checks the config file for common errors: missing required fields, unresolved secret references, orphaned preset IDs, invalid lease durations. Catch misconfiguration before enrollment attempts.
Files: internal/config/config.go (add Validate function)
9. Retry Logic for Tailscale API Calls
Severity: P2 (Reliability) | Effort: Low
In cleanupRecord, tailscale.DeleteDevice is called once with a 10-second timeout. Network blips could cause permanent cleanup_failed status. Add simple retry logic (2-3 attempts with backoff) for the device deletion API call.
Files: internal/app/workflow.go:344-348, internal/tailscale/client.go
10. State File Locking
Severity: P2 (Reliability) | Effort: Medium
Multiple tailstick processes could race on the state file (e.g., operator runs enrollment while agent is reconciling). Add file-level locking (flock on Linux, LockFileEx on Windows) to prevent corruption.
Files: internal/state/store.go
π Advanced / Strategic
11. Export Lease Metrics (Prometheus/OpenMetrics)
Severity: P3 (Nice-to-have) | Effort: Medium
Expose a /metrics endpoint (or write to a .prom textfile) with counters for active leases, cleanup successes/failures, and enrollment counts. Integrates with existing monitoring stacks.
Files: New internal/metrics/ package
12. Config Hot-Reload
Severity: P3 (Nice-to-have) | Effort: Medium
The agent reloads config on every reconciliation pass via resolveCleanupFromConfig/resolvePresetFromConfig. Make this explicit with fsnotify-based hot-reload β reload config when the file changes rather than on every tick. Reduces unnecessary disk I/O.
Files: internal/app/workflow.go (in AgentRun)
13. macOS Support
Severity: P3 (Nice-to-have) | Effort: High
tailstick currently supports Linux (systemd) and Windows (scheduled tasks). macOS is the obvious gap β use launchd for the agent and osascript for elevation prompts. The Go code already uses runtime.GOOS switches, making this architecturally clean to add.
Files: internal/platform/platform.go, internal/app/workflow.go (add macOS agent install/uninstall)
Summary
| # |
Idea |
Impact |
Effort |
Priority |
| 1 |
Lease Status Dashboard |
High |
Medium |
P2 |
| 2 |
Expiry Notifications |
Medium |
Low |
P2 |
| 3 |
Multi-Config Profiles |
Medium |
Medium |
P2 |
| 4 |
tailstick status Command |
High |
Low |
P2 |
| 5 |
Lease Annotations/Tags |
Low |
Low |
P3 |
| 6 |
Structured Logging |
Low |
Low |
P3 |
| 7 |
Shell Completions |
Low |
Low |
P3 |
| 8 |
Config Validation |
Medium |
Low |
P2 |
| 9 |
API Retry Logic |
Medium |
Low |
P2 |
| 10 |
State File Locking |
Medium |
Medium |
P2 |
| 11 |
Prometheus Metrics |
Medium |
Medium |
P3 |
| 12 |
Config Hot-Reload |
Low |
Medium |
P3 |
| 13 |
macOS Support |
High |
High |
P3 |
Top 3 recommended next steps: tailstick status command (#4), API retry logic (#9), config validation (#8) β all low effort, high value, and directly improve operator reliability.
Generated by Nightshift v3 (GLM 5.1) β idea-generator task
Nightshift Idea Generator β Microck/tailstick
Analysis of the tailstick codebase for enhancement ideas, feature opportunities, and quality improvements.
π‘ High-Value Ideas
1. Lease Status Dashboard / Web UI
Severity: P2 (Enhancement) | Effort: Medium
tailstick already has a
guisubcommand withinternal/gui/server.gofor browser-based enrollment. Extend this to show a live lease dashboard β current leases, their status, expiration countdowns, and quick cleanup actions. The existingmodel.LocalStateandstate.Load()provide all the data needed.Files:
internal/gui/server.go,internal/gui/index.html2. Lease History & Expiry Notifications
Severity: P2 (Enhancement) | Effort: Low
The agent (
AgentRun) reconciles every minute but has no notification mechanism. Add optional desktop notifications (vianotify-sendon Linux, toast on Windows) when a lease is about to expire (e.g., 1 hour before) or when cleanup completes. This gives operators visibility without checking the CLI.Files:
internal/app/workflow.go(inAgentOnce)3. Multi-Config Support / Named Profiles
Severity: P2 (Enhancement) | Effort: Medium
Currently a single
tailstick.config.jsonis loaded. For operators managing multiple tailnets or environments (staging vs production), support named config profiles:--config-profile=productionthat resolves to a named config path. This avoids manual--configflag management.Files:
internal/config/config.go,internal/app/cli.go4.
tailstick statusCommandSeverity: P2 (Enhancement) | Effort: Low
Add a top-level
statussubcommand that shows active leases, their modes, expiration times, and the agent's last reconciliation result β without requiring elevated privileges. Currently, operators need to parse the state JSON file manually.Files:
internal/app/cli.go(addrunStatus)5. Lease Annotations / Tags
Severity: P3 (Nice-to-have) | Effort: Low
Add optional
--tagsand--noteflags to enrollment. Store these inLeaseRecordand include them in audit entries. Useful for operators to annotate why a lease was created (e.g.,--tags=incident-1234 --note="emergency remote access for vendor").Files:
internal/model/types.go(extendLeaseRecordandRuntimeOptions)π§ Quality & DX Improvements
6. Structured Logging Migration
Severity: P3 (Nice-to-have) | Effort: Low
The
internal/logging/logger.goappears to use a custom format. Consider emitting structured JSON logs (or offering a--log-format=jsonflag) to integrate with log aggregation tools (Grafana Loki, Datadog).Files:
internal/logging/logger.go7. Shell Completions
Severity: P3 (Nice-to-have) | Effort: Low
Generate bash/zsh/fish shell completions for the CLI. The
flagpackage makes this straightforward, and it significantly improves operator experience for the many flags onrun(preset, mode, channel, days, etc.).Files:
internal/app/cli.go(addcompletionsubcommand)8. Configuration Validation Command
Severity: P2 (Enhancement) | Effort: Low
Add
tailstick validate-configthat checks the config file for common errors: missing required fields, unresolved secret references, orphaned preset IDs, invalid lease durations. Catch misconfiguration before enrollment attempts.Files:
internal/config/config.go(addValidatefunction)9. Retry Logic for Tailscale API Calls
Severity: P2 (Reliability) | Effort: Low
In
cleanupRecord,tailscale.DeleteDeviceis called once with a 10-second timeout. Network blips could cause permanentcleanup_failedstatus. Add simple retry logic (2-3 attempts with backoff) for the device deletion API call.Files:
internal/app/workflow.go:344-348,internal/tailscale/client.go10. State File Locking
Severity: P2 (Reliability) | Effort: Medium
Multiple
tailstickprocesses could race on the state file (e.g., operator runs enrollment while agent is reconciling). Add file-level locking (flockon Linux,LockFileExon Windows) to prevent corruption.Files:
internal/state/store.goπ Advanced / Strategic
11. Export Lease Metrics (Prometheus/OpenMetrics)
Severity: P3 (Nice-to-have) | Effort: Medium
Expose a
/metricsendpoint (or write to a.promtextfile) with counters for active leases, cleanup successes/failures, and enrollment counts. Integrates with existing monitoring stacks.Files: New
internal/metrics/package12. Config Hot-Reload
Severity: P3 (Nice-to-have) | Effort: Medium
The agent reloads config on every reconciliation pass via
resolveCleanupFromConfig/resolvePresetFromConfig. Make this explicit withfsnotify-based hot-reload β reload config when the file changes rather than on every tick. Reduces unnecessary disk I/O.Files:
internal/app/workflow.go(inAgentRun)13. macOS Support
Severity: P3 (Nice-to-have) | Effort: High
tailstick currently supports Linux (systemd) and Windows (scheduled tasks). macOS is the obvious gap β use
launchdfor the agent andosascriptfor elevation prompts. The Go code already usesruntime.GOOSswitches, making this architecturally clean to add.Files:
internal/platform/platform.go,internal/app/workflow.go(add macOS agent install/uninstall)Summary
tailstick statusCommandTop 3 recommended next steps:
tailstick statuscommand (#4), API retry logic (#9), config validation (#8) β all low effort, high value, and directly improve operator reliability.Generated by Nightshift v3 (GLM 5.1) β idea-generator task