Skip to content

feat: add version subcommand to display build metadata #119

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 5 commits into from
Apr 15, 2025
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cmd/github-mcp-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
Use: "server",
Short: "GitHub MCP Server",
Long: `A GitHub MCP server that handles various tools and resources.`,
Version: fmt.Sprintf("%s (%s) %s", version, commit, date),
Version: fmt.Sprintf("Version: %s\nCommit: %s\nBuild Date: %s", version, commit, date),
}

stdioCmd = &cobra.Command{
Expand Down Expand Up @@ -64,6 +64,8 @@
func init() {
cobra.OnInitialize(initConfig)

rootCmd.SetVersionTemplate("{{.Short}}\n{{.Version}}\n")

Check failure on line 68 in cmd/github-mcp-server/main.go

View workflow job for this annotation

GitHub Actions / lint

File is not properly formatted (gofmt)
// Add global flags that will be shared by all commands
rootCmd.PersistentFlags().Bool("read-only", false, "Restrict the server to read-only operations")
rootCmd.PersistentFlags().String("log-file", "", "Path to log file")
Expand Down
Loading