8000 cmd/headscale: migrate CLI from Cobra to command by kradalby · Pull Request #2647 · juanfont/headscale · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

cmd/headscale: migrate CLI from Cobra to command #2647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kradalby
Copy link
Collaborator
@kradalby 8000 kradalby commented Jun 17, 2025

This is currently just some playing around, lets see how it turns out.

Migrate the CLI implementation from Cobra to creachadair/command and creachadair/flax for improved maintainability and performance.

  • Replace Cobra command structure with command framework
  • Implement struct-based flag binding using flax
  • Add enhanced table formatting and output handling
  • Update integration tests for new CLI syntax
  • Replace --identifier with --node flag in node commands
  • Update command structure for consistency
  • Add backward compatibility aliases

The new CLI maintains feature parity while providing better error handling, interactive confirmations, and consistent patterns.

Copy link
review-ai-agent bot commented Jun 17, 2025

Pull Request Revisions

RevisionDescription
r3
Removed migration and example usage filesDeleted two markdown files in cmd/headscale directory: MIGRATION.md (a detailed CLI migration guide) and example_usage.md (showing CLI command examples)
r2
Updated Nix vendorHash for dependencyModified vendorHash in flake.nix to a new SHA256 value, likely due to dependency changes
r1
Headscale CLI framework modernizedReplaced Cobra CLI with a new command framework using creachadair/command and creachadair/flax libraries, providing improved flag handling, validation, and command structure with backward compatibility

☑️ AI review skipped for r3
Help React with emojis to give feedback on AI-generated reviews:
  • 👍 means the feedback was helpful and actionable
  • 👎 means the feedback was incorrect or unhelpful
💬 Replying to feedback with a comment helps us improve the system. Your input also contributes to shaping future interactions with the AI reviewer.

We'd love to hear from you—reach out anytime at team@review.ai.

@kradalby kradalby force-pushed the kradalby/cli-experiment2 branch from 6c326de to b8340ca Compare June 17, 2025 18:59
Migrate the CLI implementation from Cobra to creachadair/command
and creachadair/flax for improved maintainability and performance.

- Replace Cobra command structure with command framework
- Implement struct-based flag binding using flax
- Add enhanced table formatting and output handling
- Update integration tests for new CLI syntax
- Replace --identifier with --node flag in node commands
- Update command structure for consistency
- Add backward compatibility aliases
- Update flake.nix vendorHash for new Go dependencies

The new CLI maintains feature parity while providing better error
handling, interactive confirmations, and consistent patterns.
@kradalby kradalby force-pushed the kradalby/cli-experiment2 branch from b8340ca to 3f01944 Compare June 17, 2025 19:24
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
0