Skip to content

Implement device claim, list, rename, and release - #14

Merged
siliconwitch merged 1 commit into
mainfrom
dev
Aug 17, 2026
Merged

Implement device claim, list, rename, and release#14
siliconwitch merged 1 commit into
mainfrom
dev

Conversation

@siliconwitch

Copy link
Copy Markdown
Member

Implements the four planned device commands against the new server routes
(superstack-server dev-devices branch, opened as its own PR):

  • device claim <imei> <fleet_id> [name] validates the IMEI and fleet id
    locally, resolves the fleet name, and POSTs to /fleets/{id}/devices.
  • device list [fleet_id] renders IMEI, name, fleet, and a coarse
    last-seen age (never, just now, N min ago, N h ago, N d ago),
    with --json accepted anywhere for machine output.
  • device rename <imei> <new_name> PATCHes the trimmed name.
  • device release <imei> confirms on stdin before DELETE; declining
    prints Nothing released.

The four names leave the planned map in main_test.go; help output is
unchanged. No new dependencies, const version untouched.

Evidence: full suite green (CGO_ENABLED=0 go build/vet/test, gofmt
clean), and the whole surface exercised end to end against the local
server with the physical dev device: claim of a bogus IMEI refused with
the server's wording, real claim, rename, decline-then-confirm release,
re-claim, and LAST SEEN moving from never to just now after the
device's DTLS-PSK handshake stamped it.

Two command summaries in the table promise more than the tree delivers
yet: claim's "press its button" and release's "factory reset it" both
need the device frame layer, so today claim binds without the button
gate and release only unbinds. Flagged in the server PR as well.

Claim validates the IMEI and fleet locally, then binds the device over
POST /fleets/{id}/devices. List shows IMEI, name, fleet, and a coarse
last-seen age, with an optional fleet filter and --json for machine
output. Rename sends the trimmed name. Release confirms on stdin before
unbinding. A shared devices.go holds the device fetch and IMEI check.
@siliconwitch
siliconwitch merged commit 13a4a69 into main Aug 17, 2026
1 check passed
@siliconwitch
siliconwitch deleted the dev branch August 17, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant