Skip to content

cli: adapter schema --type / sensors --key + api-key create --store-secret#301

Merged
maximelb merged 2 commits into
cli-v2from
cli-adapter-schema-sensors-store-secret
May 31, 2026
Merged

cli: adapter schema --type / sensors --key + api-key create --store-secret#301
maximelb merged 2 commits into
cli-v2from
cli-adapter-schema-sensors-store-secret

Conversation

@maximelb

Copy link
Copy Markdown
Contributor

Three CLI additions that remove friction in automated/agent build flows (split out of the merged #299; this is the remaining commit).

  • cloud-adapter/external-adapter schema --type <t> — resolve one adapter type's config sub-schema from the hive JSON-Schema $defs and render the flat field table (reusing hive's _flatten_schema). Shows where each field lives (e.g. hostname under client_options), preventing unknown field rejections from hand-built records. Unknown --type errors with the valid type list.
  • cloud-adapter/external-adapter sensors --key <adapter> — return the live sensor(s) an adapter produced by matching the record's installation_key (iid) against the sensor iid — the reliable way to get an adapter's SID without decoding the installation key. Falls back to hostname match; reports a clear "not registered yet" when the adapter hasn't delivered events.
  • api-key create --store-secret <name> (+ --store-secret-tag) — atomically mint the key and write its value into the secret hive, collapsing the mint → capture → store → reference chain into one call (the value never transits an intermediate file).

Unit-tested (986 passing; new coverage in test_cli_ergonomics.py, adapter-group subcommand list updated in the lazy-loading regression test) and smoke-tested live.

🤖 Generated with Claude Code

…tore-secret

Three FDE-acceleration additions found while profiling AI agent build runs:

- cloud-adapter/external-adapter `schema --type <t>`: resolve one adapter
  type's config sub-schema from the hive JSON-Schema $defs and render the flat
  field table (reusing hive's _flatten_schema). Shows where each field lives
  (e.g. hostname under client_options), preventing "unknown field" rejections
  from hand-built records. Unknown type errors with the valid type list.

- cloud-adapter/external-adapter `sensors --key <adapter>`: return the live
  sensor(s) an adapter produced by matching the record's installation_key (iid)
  against the sensor iid — the reliable way to get an adapter's SID without
  decoding the installation key. Falls back to hostname match; reports a clear
  "not registered yet" when the adapter hasn't delivered events.

- `api-key create --store-secret <name>` (+ --store-secret-tag): atomically mint
  the key and write its value into the secret hive, collapsing the
  mint -> capture -> store -> reference chain into one call (the value never
  has to transit an intermediate file).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…r selector, etag-safe store-secret

- adapter `schema --type` now respects --quiet (consistent with sensors/list-types)
  and its --output json carries the root $defs so nested $refs stay resolvable.
- adapter `sensors --key` filters server-side via a sensor selector
  (iid == "…" / hostname == "…") instead of paging and scanning every sensor.
- api-key create --store-secret reads any existing secret's etag and writes a
  conditional update (no silent lost-update; reports create vs overwrite), and on
  the no-value edge still surfaces the created key before failing.

Tests updated for the selector path and added: schema CLI table/unknown-type,
store-secret new-vs-existing(etag). 990 unit tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maximelb maximelb marked this pull request as ready for review May 31, 2026 03:00
@maximelb maximelb merged commit 7865be3 into cli-v2 May 31, 2026
6 of 7 checks passed
@maximelb maximelb deleted the cli-adapter-schema-sensors-store-secret branch May 31, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant