Repository navigation
feat(gfsctl): add a read-only CLI for the HTTP API - #56
Merged
Merged
Conversation
snapshot and admin change the filesystem through endpoints the server does not have yet; they come back with those endpoints. cluster called /api/v1/cluster/*, which is not on main. The client keeps GET only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Settings resolve per field from a flag that was set, then GFSCTL_*, then the config file, then the default. GFSCTL_PORT and GFSCTL_TIMEOUT were checked but never read, and the config file loaded at package init. - Bad GFSCTL_PORT, GFSCTL_TIMEOUT, output format or config file are errors, not silently ignored. - Every error prints once. Some paths exited 1 with no message, and watch mode printed errors twice. - Output goes to the command's writer, not os.Stdout, and is colored only on a terminal without NO_COLOR. - An IPv6 --host gave http://::1:8080; the URL now uses JoinHostPort. - version reads internal/version, like the other binaries. - New: gfsctl metrics, and gfsctl stats cluster (/api/v1/stats/cluster). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fake API answers with JSON built from internal/api's response types, and each command's -o json output must decode back to the same value. This found that stats overview dropped the server's io section; the client now has IOStatsResponse. Also tests settings precedence, bad settings, error output, metrics and the base URL for IPv6 hosts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dist.sh also collects gfsctl's dependency licenses, and the release workflow checks that gfsctl reports the build commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The gfsctl tests import it to reset flags between runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # tests/test-manifest.yaml
mattmattox
added a commit
that referenced
this pull request
Nov 10, 2026
From the review of #56: - config show printed the token's first and last 4 characters, most of a short token. It now prints "set (N chars)". - The client read whole responses into memory; it now stops at 16 MB. - The README says to tunnel over SSH or use a TLS proxy for a remote mount. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First of the three PRs that replace draft #52:
gfsctl, read-only, as the user decided. It readsstatus,health,stats(overview, cache, journal, trim, lock, sfb, cluster, all) andmetrics, with watch mode and JSON output.The first commit is the user's gfsctl exactly as they wrote it (5eb160f). The commits after it are the changes, so the diff of each one is easy to review:
snapshot,adminandcluster. The first two write;clustercalled/api/v1/cluster/*, which main doesn't have. The client is GET-only.GFSCTL_*, then the config file, then defaults.GFSCTL_PORTandGFSCTL_TIMEOUTwere never read, and the config file loaded at package init.--hostbuilt a broken URL.gfsctl metricsandstats cluster.internal/api's own types, and each command's-o jsonmust decode back to the same value. It found thatstatsdropped the server'siosection.make build,dist.sh(binary plus its dependency licenses) and the release workflow now include gfsctl. The release job checks that it reports the build commit.Stats answer 503 until api-stats wires the provider, and gfsctl prints that error.
Results: .68 at 8471696: lint 0 issues, parity, race unit tests for all 22 packages, and integration
-shortwith 100 pass, 18 skip, 0 fail (including the new live-mount test). A testdist.shrun put gfsctl and the cobra, pflag and yaml.v2 licenses into the archive, andgfsctl versionreported the commit. The last commit (e326409) only reclassifies pflag in go.mod, for the tidy check. GitHub CI is the gate for integration.🤖 Generated with Claude Code