Title: mcpx:
Open Graph Title: mcpx:
X Title: mcpx:
Description: Problem mcpx
Open Graph Description: Problem mcpx
X Description: Problem mcpx <command> --help does not print the command's help. Instead it dumps every global setting bound to the command's flag set. Reproduced on main 98da85ea with a locally buil...
Opengraph URL: https://github.com/developing-today/code/issues/274
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mcpx: \u003ccommand> --help prints every global flag instead of the command's help","articleBody":"## Problem\n\n`mcpx \u003ccommand> --help` does not print the command's help. Instead it dumps every global setting bound to the command's flag set.\n\nReproduced on main `98da85ea` with a locally built binary:\n\n- `mcpx call --help` → `Usage of call:` followed by **290 lines** of plumbing flags (`-artifacts-chunk-bytes`, `-autostart-*`, `-daemon-*`, …). Exit 0, but the command's own usage/summary is buried/not shown.\n- `mcpx help call` → the curated help (`mcpx call \u003cnamespace>.\u003ctool> [json]` + summary + relevant settings) — the only way to get it.\n- `mcpx daemons --help` → ignores the help flag entirely and lists daemons (`no daemons`), because that command never parses flags.\n\n## Root cause\n\n- `parseFlags` (`pkgs/mcpx/internal/cli/root.go`) leaves the Go flag package's default usage in place; the registry binds every setting to each command's flag set, so the default usage is the full settings dump.\n- Hand-written commands that never call `parseFlags` (daemons/refresh/completion) have no help handling at all in the dispatch layer (`pkgs/mcpx/internal/cli/dispatch.go`).\n\nSame defect as dezren39/nix#368, fixed there by PR #380. This repo's `pkgs/mcpx` copy predates that fix: verified `internal/cli/root.go`, `internal/cli/dispatch.go`, and `cmd/mcpx/main.go` are byte-identical to nix's pre-fix versions, and `internal/cli/help_test.go` does not exist here.\n\n## Why it matters\n\n`--help` is the first thing a new user (or an agent) tries. Getting a 290-line plumbing dump — or, for `daemons`, silently executing the command — makes the CLI effectively undiscoverable and can surprise-run a command the user only wanted help on.\n\n## Suggested fix (mirrors dezren39/nix PR #380, commit 32bb9ff)\n\n- `parseFlags` answers a help flag in flag position with the same text as `mcpx help \u003ccmd>` (new shared `helpText`), and installs that text as the flag set's usage so a parse error cannot resurrect the dump. Generated op commands keep their own tailored usage.\n- `Handlers()` wraps hand-written commands so a leading help flag is answered even when the command never parses flags, and `flag.ErrHelp` becomes success; `main` treats `flag.ErrHelp` the same way.\n- Port `internal/cli/help_test.go` (refs re-pointed to this issue).\n\n## Acceptance criteria\n\n- [ ] `mcpx call --help`, `mcpx call -h`, and `mcpx help call` print the same curated help; no `Usage of call:` settings dump.\n- [ ] `mcpx daemons --help` prints help and does not list/run daemons.\n- [ ] A help token consumed as a valued flag's value, after a positional, or after `--` is NOT treated as a help request.\n- [ ] New regression tests in `internal/cli/help_test.go` pass; full `internal/cli` suite green.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-18T11:00:21Z","url":"https://github.com/developing-today/code/issues/274"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e404ba1f-bba9-fa20-8ae3-59819dc686f0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A1D0:17E4EA:AF6422:E92D3B:6B0641A1 |
| html-safe-nonce | 0dd911043743e866fbf48fd6d7fb4b4c4914a148d67d3af3c7a356641e932584 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMUQwOjE3RTRFQTpBRjY0MjI6RTkyRDNCOjZCMDY0MUExIiwidmlzaXRvcl9pZCI6IjgwNzczMTM4MTg3NjgwNjQ5MjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3fedb1fec38f2119ba5b2957a1d5e1403f62df3bad5899ea1a115b4b96b5b639 |
| hovercard-subject-tag | issue:5908804587 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/274/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b0849e6129b1afc17de1a9e78af55f27db80e9978470c21d51a2ecc8cd242dc4/developing-today/code/issues/274 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b0849e6129b1afc17de1a9e78af55f27db80e9978470c21d51a2ecc8cd242dc4/developing-today/code/issues/274 |
| og:image:alt | Problem mcpx |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1bff4f6bfaa96dc9c42cacf315424c24ebb548b06142ced5e3aaccb2a42dd652 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ac613d3698d3d8565651455086e1f74da07bf277 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width