fix: add git cli command #111
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant enhancements to the CLI, primarily by adding a new
gitopscommand group for manifest diffing, improving the flexibility of claim operation commands (plan,apply,destroy) with new flags for following execution and storing output files, and refactoring the execution-following logic for broader use. The changes improve automation support (e.g., for CI/CD and GitHub Actions), user experience, and code maintainability.Major new features and improvements:
GitOps support and manifest diffing:
gitopscommand group with adiffsubcommand, enabling detection and structured reporting of manifest changes between two git references. This supports both local workflows and CI/CD (e.g., GitHub Actions) by outputting JSON describing the required actions (plan, apply, destroy, rename) for each manifest. (cli/src/commands/gitops.rs,cli/src/main.rs,cli/Cargo.toml)Enhanced claim command flexibility:
plan,apply, anddestroycommands to support new flags:--store-files(to save output files),--follow(to follow operation progress), and--destroy(for planning destroy operations). These flags improve automation and user feedback. (cli/src/main.rs,cli/src/commands/claim.rs)Execution following refactor and improvements:
follow_executionfunction, now supportingplan,apply, anddestroyoperations, and providing output suitable for file storage. (cli/src/plan.rs,cli/src/lib.rs,cli/src/commands/claim.rs)Improved branch detection for automation:
gitops diffcommand in automated pipelines. (cli/src/commands/gitops.rs,cli/src/main.rs)User experience and error handling:
--followwhen storing files), and clarified command usage for end users. (cli/src/commands/claim.rs)