add example back
Signed-off-by: Kai Xia <kaix+github@fastmail.com>
This commit is contained in:
parent
446b4eca23
commit
6b95596c4a
2 changed files with 21 additions and 1 deletions
|
|
@ -24,6 +24,16 @@ func newAuthCmd() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "auth",
|
Use: "auth",
|
||||||
Short: "Manage authentication (login, logout, status)",
|
Short: "Manage authentication (login, logout, status)",
|
||||||
|
Long: `Manage authentication (login, logout, status)
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
picoclaw auth login --provider openai
|
||||||
|
picoclaw auth login --provider openai --device-code
|
||||||
|
picoclaw auth login --provider anthropic
|
||||||
|
picoclaw auth login --provider google-antigravity
|
||||||
|
picoclaw auth logout --provider openai
|
||||||
|
picoclaw auth status
|
||||||
|
picoclaw auth models`,
|
||||||
}
|
}
|
||||||
cmd.AddCommand(
|
cmd.AddCommand(
|
||||||
newAuthLoginCmd(),
|
newAuthLoginCmd(),
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,17 @@ func init() {
|
||||||
newSkillsCmd(),
|
newSkillsCmd(),
|
||||||
newVersionCmd(),
|
newVersionCmd(),
|
||||||
)
|
)
|
||||||
rootCmd.Version = formatVersion()
|
// Override cobra's default --version/-v to use printVersion() for full output
|
||||||
|
rootCmd.Flags().BoolP("version", "v", false, "Show version information")
|
||||||
|
rootCmd.PersistentPreRun = func(cmd *cobra.Command, args []string) {}
|
||||||
|
rootCmd.RunE = func(cmd *cobra.Command, args []string) error {
|
||||||
|
v, _ := cmd.Flags().GetBool("version")
|
||||||
|
if v {
|
||||||
|
printVersion()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return cmd.Help()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue