This commit is contained in:
Josh at WLTechBlog
2025-08-18 13:01:03 -05:00
parent 4ea5615ef8
commit 1216210150
7 changed files with 84 additions and 0 deletions

16
main.go
View File

@@ -9,6 +9,8 @@ import (
"git.teamworkapps.com/shortcut/cremote/client"
)
const Version = "2.0.0"
var (
// Global flags
daemonHost = flag.String("host", "localhost", "Daemon host")
@@ -149,6 +151,19 @@ func main() {
// Parse the appropriate subcommand
switch os.Args[1] {
case "version":
fmt.Printf("cremote CLI version %s\n", Version)
// Also get daemon version if possible
c := client.NewClient("localhost", 8989)
daemonVersion, err := c.GetVersion()
if err != nil {
fmt.Printf("Daemon: Unable to connect (%v)\n", err)
} else {
fmt.Printf("Daemon version %s\n", daemonVersion)
}
return
case "open-tab":
openTabCmd.Parse(os.Args[2:])
@@ -487,6 +502,7 @@ func main() {
func printUsage() {
fmt.Println("Usage: cremote <command> [options]")
fmt.Println("Commands:")
fmt.Println(" version Show version information for CLI and daemon")
fmt.Println(" open-tab Open a new tab and return its ID")
fmt.Println(" load-url Load a URL in a tab")
fmt.Println(" fill-form Fill a form field with a value")