Repository navigation
One connection, one wiring profile, one name - #24
Merged
Merged
Conversation
- --connection embeddedci:<name> (flag, BENCHPOD_CONNECTION or the saved
default) now works for the single-reply JSON commands: status, ping,
la voltage, la pullup/status/step, generate, cloud ca show/clear and
cloud proxy. They go through POST /api/benchpod/devices/{id}/command
(internal/cloudpod, same Command method as tcpclient), signed in with
BENCHPOD_API_KEY or the benchpod login session; BENCHPOD_API_BASE picks
the server like the SDK. Lease, offline and role failures map to exit
codes 4, 5 and 3. set-connection accepts embeddedci:<name>.
- Commands that need a stream, the pod's own port or USB (capture, stream,
measure, test, flash, spi-flash, register, cloud ca set, discover and the
USB-only commands) refuse a cloud connection and say what to use instead.
- flash (--swclk, --swdio, --nreset, --target) and spi-flash (--sck, --mosi,
--miso, --cs) default the flags left out from the pod's wiring profile on
embeddedci.com when signed in and the pod is on the account; flags win,
the log names the source, a failed lookup is one warning line.
- Rename the "wifi" connection kind to "network" (connNetwork,
RequireNetwork, networkClient); "serial" stays a hidden alias of "usb";
user-visible text says "pod".
- config.json gets a "version": 1 field and is documented as shared with
the SDK and MCP. lan-policy, sig-policy and deregister also take
BENCHPOD_API_KEY.
- gofmt internal/fwrefusals/fwrefusals.go.
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.
UX plan tier 4 for the CLI.
One connection:
embeddedci:<name>everywhere it can work--connection embeddedci:<name>(alsoBENCHPOD_CONNECTIONand the saved default, whichset-connectionnow accepts) runs the single-reply JSON commands through embeddedci.com viaPOST /api/benchpod/devices/{id}/command:status,ping,la voltage,la pullup,la status,la step,generate,cloud ca show,cloud ca clear,cloud proxy(show/set/clear), plus the existinglan-policy,sig-policy,deregister.internal/cloudpod.Clienthas the sameCommand(ctx, req)method astcpclient.Client; commands take apodCommander, so they do not branch per transport.BENCHPOD_API_KEY(Authorization: ApiKey eci_...) else thebenchpod loginsession.BENCHPOD_API_BASEpicks the server, as in the SDK.lease_held/device_busyexit 4,device_offline/device_reconnectingexit 5,forbidden_tierexit 3, each with a plain message.capture,stream,measure,test,flash,spi-flash,register,cloud ca set,discoverand the USB-only commands (set-wifi,show-network,clear-wifi,install-blobs,bootsel,dfu,flash-self) refuse a cloud connection and name what to use instead (web app, SDK/pytest overembeddedci:, or a LAN/USB connection). A savedembeddedci:default still lets the USB-only commands auto-detect USB.One wiring profile
Over a network connection,
flash(--swclk,--swdio,--nreset,--target) andspi-flash(--sck,--mosi,--miso,--cs) take the values you leave out from the pod's effective wiring profile (GET .../wiring/profile, falling back to.../wiring). This happens when you are signed in and the pod'scloud_statusdevice id is on the account. Flags always win, the log names the source, and the lookup is bounded at 6 s with one warning line on failure.One name
connWifi->connNetwork,RequireWifi->RequireNetwork,wifiClient->networkClient(plus the newpodClient).serialstays a hidden alias ofusb.--device-name,--device-id) stay.Shared config
config.jsongets a compatible"version": 1(written on save; missing means 1). The README documents it as shared with the SDK and MCP (location, keys, who reads it).Other
gofmt -l .is clean (internal/fwrefusals/fwrefusals.go).lan-policy,sig-policyandderegisteralso acceptBENCHPOD_API_KEY(an explicit--token-filestill wins).webapp/src/docs/coverage/cli.json) needs a refresh: only text changed (shorts, usages, theset-connectionuse line). No flags were added or removed.Tests
go vet ./...andgo test ./...pass. The new httptest coverage isinternal/cloudpod/cloudpod_test.goandcmd/benchpod-cli/podclient_test.go. ATestMainisolatesXDG_CONFIG_HOMEand the API env vars.status,la voltageandpingworked over bothembeddedci:benchpod-baea06and LAN 192.168.1.220.captureover cloud refused as intended. Aflashdry run over LAN took SWCLK LA11 / SWDIO LA12 / nreset from the profile and stopped at the OpenOCD check.🤖 Generated with Claude Code