{"id":21056499,"url":"https://github.com/bradydouthit/switchboard","last_synced_at":"2026-05-17T12:43:20.422Z","repository":{"id":263345457,"uuid":"890084348","full_name":"BradyDouthit/switchboard","owner":"BradyDouthit","description":"Framework for creating CLI tools in Go","archived":false,"fork":false,"pushed_at":"2024-11-25T16:59:30.000Z","size":37,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T19:24:26.020Z","etag":null,"topics":["cli","cli-builder","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BradyDouthit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-18T00:27:45.000Z","updated_at":"2024-11-25T16:59:45.000Z","dependencies_parsed_at":"2024-11-25T17:24:38.812Z","dependency_job_id":null,"html_url":"https://github.com/BradyDouthit/switchboard","commit_stats":null,"previous_names":["bradydouthit/switchboard"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BradyDouthit%2Fswitchboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BradyDouthit%2Fswitchboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BradyDouthit%2Fswitchboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BradyDouthit%2Fswitchboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BradyDouthit","download_url":"https://codeload.github.com/BradyDouthit/switchboard/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243500787,"owners_count":20300775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","cli-builder","go","golang"],"created_at":"2024-11-19T16:51:19.133Z","updated_at":"2025-12-29T12:22:20.694Z","avatar_url":"https://github.com/BradyDouthit.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Switchboard\n\nA lightweight CLI framework for Go that makes building command-line applications simple and intuitive. \n\n## Features\n- Simple, intuitive API\n- Closure-based state management\n- Support for short and long flag names\n- Boolean flags\n- Required flags\n- Subcommands\n- Error handling\n- Command descriptions\n\n## Installation\n\n```bash\ngo get github.com/BradyDouthit/switchboard\n```\n\n## Basic Usage\n\nHere's a simple example showing basic command creation:\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/BradyDouthit/switchboard\"\n)\n\nfunc main() {\n    app := switchboard.New()\n    \n    // Simplest possible command\n    app.Command(\"hello\", \"Say hello to the world\", func(c *switchboard.Command) {\n        c.Run(func() {\n            fmt.Println(\"Hello, World!\")\n        })\n    })\n\n    app.Run()\n}\n```\n\n### Usage with flags\nFlags can be added to commands with short names, long names, whether or not they are required, and descriptions:\n\n```go\napp.Command(\"greet\", \"Greet someone\", func(c *switchboard.Command) {\n    var name string\n    var greeting string\n    c.Flag(\"n\", \"name\", \"Name to greet\", true, func(value string) error {\n        name = value\n        return nil\n    })\n    c.Flag(\"g\", \"greeting\", \"Custom greeting\", false, func(value string) error {\n        greeting = value\n        if greeting == \"\" {\n            greeting = \"Hello\"\n        }\n        return nil\n    })\n    c.Run(func() {\n        fmt.Printf(\"%s, %s!\\n\", greeting, name)\n    })\n})\n```\n\n### Subcommands\nYou can create nested command structures using subcommands:\n\n```go\napp.Command(\"config\", \"Manage configuration\", func(c *switchboard.Command) {\n    c.SubCommand(\"set\", \"Set a configuration value\", func(sc *switchboard.Command) {\n        var key, value string\n        sc.Flag(\"k\", \"key\", \"Configuration key\", true, func(v string) error {\n            key = v\n            return nil\n        })\n        sc.Flag(\"v\", \"value\", \"Configuration value\", true, func(v string) error {\n            value = v\n            return nil\n        })\n        sc.Run(func() {\n            fmt.Printf(\"Setting %s to %s\\n\", key, value)\n        })\n    })\n    \n    c.SubCommand(\"get\", \"Get a configuration value\", func(sc *switchboard.Command) {\n        var key string\n        sc.Flag(\"k\", \"key\", \"Configuration key\", true, func(v string) error {\n            key = v\n            return nil\n        })\n        sc.Run(func() {\n            fmt.Printf(\"Getting value for %s\\n\", key)\n        })\n    })\n})\n```\n\nThis creates a command structure that can be used like:\n```bash\nmyapp config set --key theme --value dark\nmyapp config get --key theme\n```\n\n### Advanced Usage\nFor more advanced usage see `/advanced/main.go`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradydouthit%2Fswitchboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbradydouthit%2Fswitchboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradydouthit%2Fswitchboard/lists"}