File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,21 @@ func main() {
3333 }
3434}
3535
36+ var version = "dev"
37+
38+ var versionCmd = & cobra.Command {
39+ Use : "version" ,
40+ Short : "Print version information" ,
41+ Run : func (cmd * cobra.Command , args []string ) {
42+ fmt .Printf ("GPTCode version %s\n " , version )
43+ },
44+ }
45+
46+ func init () {
47+ rootCmd .Version = version
48+ rootCmd .SetVersionTemplate ("GPTCode version {{.Version}}\n " )
49+ }
50+
3651var rootCmd = & cobra.Command {
3752 Use : "gptcode" ,
3853 Short : "GPTCode – AI Coding Assistant with Specialized Agents" ,
@@ -152,6 +167,7 @@ func init() {
152167 }
153168
154169 rootCmd .AddCommand (setupCmd )
170+ rootCmd .AddCommand (versionCmd )
155171 setupCmd .Flags ().BoolP ("yes" , "y" , false , "Use Quick Start (non-interactive)" )
156172 rootCmd .AddCommand (keyCmd )
157173 rootCmd .AddCommand (releaseCmd )
You can’t perform that action at this time.
0 commit comments