Feature Request: add version flag #73

Closed
opened 2026-02-13 11:50:27 +00:00 by malik · 2 comments
malik commented 2026-02-13 11:50:27 +00:00 (Migrated from codeberg.org)

Current behaviour

at the moment we have the following behaviour:

forgejo-mcp --version
flag provided but not defined: -version
Usage of forgejo-mcp:
  -d    debug mode (default true)
  -debug
        debug mode (default true)
  -sse-port int
        Port for SSE transport mode (default 8080)
  -t string
        Transport type (stdio or sse) (default "stdio")
  -token string
        Your personal access token
  -transport string
        Transport type (stdio or sse) (default "stdio")
  -url string
        Forgejo instance URL (required, must start with http:// or https://)

Overview

Version flag is a typical way of checking the installation and the version of a program.

Downstream in Nixpkgs we use the versionCheckHook as validation check.

  nativeInstallCheckInputs = [
    versionCheckHook
  ];
  doInstallCheck = true;

For it to work we would appreciate this feature.

References

## Current behaviour at the moment we have the following behaviour: ```sh forgejo-mcp --version flag provided but not defined: -version Usage of forgejo-mcp: -d debug mode (default true) -debug debug mode (default true) -sse-port int Port for SSE transport mode (default 8080) -t string Transport type (stdio or sse) (default "stdio") -token string Your personal access token -transport string Transport type (stdio or sse) (default "stdio") -url string Forgejo instance URL (required, must start with http:// or https://) ``` ## Overview Version flag is a typical way of checking the installation and the version of a program. Downstream in Nixpkgs we use the `versionCheckHook` as validation check. ```nix nativeInstallCheckInputs = [ versionCheckHook ]; doInstallCheck = true; ``` For it to work we would appreciate this feature. ## References - [GNU Coding Standards](https://www.gnu.org/prep/standards/standards.html#g_t_002d_002dversion) - [POSIX Standards](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html) - [downstream Nixpkgs discussion](https://github.com/NixOS/nixpkgs/pull/486589#discussion_r2776313965)
goern commented 2026-02-13 12:15:36 +00:00 (Migrated from codeberg.org)

Hey, what about codeberg.org/goern/forgejo-mcp@433446bfb6

Is that good enough?

Hey, what about https://codeberg.org/goern/forgejo-mcp/commit/433446bfb61d95c57602341189aaf878cccaa74f Is that good enough?
malik commented 2026-02-13 17:20:48 +00:00 (Migrated from codeberg.org)

@goern wrote in https://codeberg.org/goern/forgejo-mcp/issues/73#issuecomment-10559440:

Hey, what about 433446bfb6

Is that good enough?

I think this is not really it as you were implementing a subcomand instead of a flag.
Should propably be more similiar to the other flags here in cmd/cmd.go:

func init() {
	// Subcommands that don't need full initialization
	if len(os.Args) > 1 && os.Args[1] == "version" {
		return
	}

	flag.StringVar(
		&transport,
		"t",
		"stdio",
		"Transport type (stdio or sse)",
	)
	flag.StringVar(
		&transport,
		"transport",
		"stdio",
		"Transport type (stdio or sse)",
	)
	flag.StringVar(
		&urlFlag,
		"url",
		"",
		"Forgejo instance URL (required, must start with http:// or https://)",
	)
	flag.IntVar(
		&ssePort,
		"sse-port",
		8080,
		"Port for SSE transport mode",
@goern wrote in https://codeberg.org/goern/forgejo-mcp/issues/73#issuecomment-10559440: > Hey, what about [`433446bfb6`](https://codeberg.org/goern/forgejo-mcp/commit/433446bfb61d95c57602341189aaf878cccaa74f) > > Is that good enough? I think this is not really it as you were implementing a subcomand instead of a flag. Should propably be more similiar to the other flags here in `cmd/cmd.go`: ```go func init() { // Subcommands that don't need full initialization if len(os.Args) > 1 && os.Args[1] == "version" { return } flag.StringVar( &transport, "t", "stdio", "Transport type (stdio or sse)", ) flag.StringVar( &transport, "transport", "stdio", "Transport type (stdio or sse)", ) flag.StringVar( &urlFlag, "url", "", "Forgejo instance URL (required, must start with http:// or https://)", ) flag.IntVar( &ssePort, "sse-port", 8080, "Port for SSE transport mode", ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
agentic-forges/forgejo-mcp#73
No description provided.