-
Notifications
You must be signed in to change notification settings - Fork 4.2k
refactor(cli): migrate to Cobra-based command structure #429
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
Merged
Merged
Changes from 11 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
6d529b8
refactor(cli): migrate to Cobra-based command structure
pixel365 0d2202e
Merge remote-tracking branch 'origin/main' into refactor/cmd
pixel365 a2db707
chore(cli): remove version2 alias and make cobra a direct dependency
pixel365 f2e5d6c
test(cli): add basic command tests
pixel365 db29d09
Merge remote-tracking branch 'origin/main' into refactor/cmd
pixel365 e7716cc
Merge remote-tracking branch 'origin/main' into refactor/cmd
pixel365 c857dcb
test: migrate command tests to testify assertions
pixel365 abce553
Merge remote-tracking branch 'origin/main' into refactor/cmd
pixel365 6f6bc7f
fix(cli): make linter happy
pixel365 7a0a9ac
Merge remote-tracking branch 'origin/main' into refactor/cmd
pixel365 0d63e18
test: avoid duplication in windows config path test
pixel365 c45811f
test: simplify allowed command checks using slices.Contains
pixel365 e62b4e0
fix(skills): register subcommands during command construction
pixel365 9a65c70
refactor(cli): address review feedback and improve command clarity
pixel365 209054f
Merge remote-tracking branch 'origin/main' into refactor/cmd
pixel365 4989d1a
fix(authLogoutCmd): rm os.Exit
pixel365 693bdf5
Merge remote-tracking branch 'origin/main' into refactor/cmd
pixel365 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,7 @@ build/ | |
| *.out | ||
| /picoclaw | ||
| /picoclaw-test | ||
| cmd/picoclaw/workspace | ||
| cmd/**/workspace | ||
|
|
||
| # Picoclaw specific | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| package agent | ||
|
|
||
| import ( | ||
| "github.com/spf13/cobra" | ||
| ) | ||
|
|
||
| func NewAgentCommand() *cobra.Command { | ||
| var ( | ||
| message string | ||
| sessionKey string | ||
| model string | ||
| debug bool | ||
| ) | ||
|
|
||
| cmd := &cobra.Command{ | ||
| Use: "agent", | ||
| Short: "Interact with the agent directly", | ||
| Args: cobra.NoArgs, | ||
| RunE: func(cmd *cobra.Command, _ []string) error { | ||
| debug, _ = cmd.Flags().GetBool("debug") | ||
| message, _ = cmd.Flags().GetString("message") | ||
| sessionKey, _ = cmd.Flags().GetString("session") | ||
| model, _ = cmd.Flags().GetString("model") | ||
|
|
||
| return agentCmd(message, sessionKey, model, debug) | ||
| }, | ||
| } | ||
|
|
||
| cmd.Flags().BoolVarP(&debug, "debug", "d", false, "Enable debug logging") | ||
| cmd.Flags().StringVarP(&message, "message", "m", "", "Send a single message (non-interactive mode)") | ||
| cmd.Flags().StringVarP(&sessionKey, "session", "s", "cli:default", "Session key") | ||
| cmd.Flags().StringVarP(&model, "model", "", "", "Model to use") | ||
|
|
||
| return cmd | ||
| } | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.