Skip to content

feat(cli): add jmp describe for exporters, leases, and clients - #1043

Merged
kirkbrauer merged 2 commits into
mainfrom
cli-describe
Sep 4, 2026
Merged

feat(cli): add jmp describe for exporters, leases, and clients#1043
kirkbrauer merged 2 commits into
mainfrom
cli-describe

Conversation

@kirkbrauer

@kirkbrauer kirkbrauer commented Aug 30, 2026

Copy link
Copy Markdown
Member

jmp get answers what exists; there was no way to ask about one of them in detail short of reading the raw object.

Adds jmp describe exporter|lease|client <name>, following kubectl describe: a readable summary by default, -o json|yaml for a machine. Describing an exporter reports the lease holding it, describing a lease reports its conditions, and describing a client reads the local config — so it works without a connection and says whether the token is still valid. The client description never emits token material.

Documented in the distributed mode guide, where a user first needs to know which exporters exist and what to select on, and from the lease troubleshooting entry in the testing guide. The man page picks the commands up from click.

@kirkbrauer kirkbrauer added enhancement New feature or request python Pull requests that update python code labels Aug 30, 2026
@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 49 minutes.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: da37d0f9-74a1-49a4-b9c3-eb4630940977

📥 Commits

Reviewing files that changed from the base of the PR and between e25ef45 and 8022fa3.

📒 Files selected for processing (6)
  • docs/source/getting-started/guides/examples/testing.md
  • docs/source/getting-started/guides/setup/distributed-mode.md
  • python/packages/jumpstarter-cli-common/jumpstarter_cli_common/alias.py
  • python/packages/jumpstarter-cli/jumpstarter_cli/describe.py
  • python/packages/jumpstarter-cli/jumpstarter_cli/describe_test.py
  • python/packages/jumpstarter-cli/jumpstarter_cli/jmp.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kirkbrauer
kirkbrauer requested review from bennyz and mangelajo August 31, 2026 05:15

@mangelajo mangelajo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice. can we add it to documentation? :)

Add a kubectl-style 'jmp describe' command group (alias: desc) with
exporter, lease, and client subcommands. Default output is aligned
plain-text key/value sections; -o json|yaml routes through model_print.
'describe client' reports token expiry and validity without ever
printing token values, using a dedicated ClientDescription model for
structured output.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Kirk Brauer <kirkebrauer@gmail.com>
…exporter

The Lease block in `jmp describe exporter` could never render: GetExporter
answers with the exporter alone, so `exporter.lease` was always None and a
busy exporter reported "Lease: <none>". The tests hung a lease on the
exporter themselves, which the server never does, so they covered it. Look
the holding lease up through ListLeases instead, and pin it with a test that
builds the exporter the way the server returns it.

Documents the command in the distributed mode guide, where a user first needs
to know which exporters exist and what to select on, and points the lease
troubleshooting entry at it.

Assisted-by: Claude
Signed-off-by: Kirk Brauer <kirkebrauer@gmail.com>
@kirkbrauer kirkbrauer added the documentation Improvements or additions to documentation label Aug 31, 2026
@kirkbrauer

Copy link
Copy Markdown
Member Author

@mangelajo Added some docs and fixed a few additional issues I noticed from review.

@kirkbrauer
kirkbrauer requested a review from mangelajo August 31, 2026 14:12
@kirkbrauer
kirkbrauer added this pull request to the merge queue Sep 4, 2026
Merged via the queue into main with commit ca3b483 Sep 4, 2026
31 checks passed
@kirkbrauer
kirkbrauer deleted the cli-describe branch September 4, 2026 14:57
kirkbrauer added a commit that referenced this pull request Sep 5, 2026
Preserve the exporter holding-lease fix from #1043 while retaining the opt-in lease device description. Document the CLI contract and cover YAML, unchanged metadata-only JSON, and device connection failures.

Assisted-by: Pi:gpt-6-astra
Signed-off-by: Kirk Brauer <kirkebrauer@gmail.com>
bennyz pushed a commit to bennyz/jumpstarter that referenced this pull request Sep 8, 2026
## Summary

Add `--drivers` to `jmp describe lease` so users and IDE integrations
can discover a leased exporter's software driver clients and runnable
`j` commands without opening an interactive shell.

```sh
jmp describe lease <lease-name> --client <client-alias> --drivers
jmp describe lease <lease-name> --client <client-alias> --drivers -o json
```

- Human-readable output appends **Drivers** and **Commands** tables.
- JSON/YAML output with `--drivers` is `{lease, driver_tree}`. The
subtree contains a `drivers` list and recursive `cli_tree` with command
help and parameters.
- Without the flag, existing metadata-only behavior and output shape
remain unchanged.
- Introspection attaches to the existing lease using the selected
client's driver-access settings. It does not execute the listed driver
commands, create a lease, or release the existing lease.
- Includes usage documentation and regression coverage for JSON/YAML,
absent root CLI trees, unchanged metadata-only output, connection
failures, and compatibility aliases.

This supplies the missing CLI API for the VS Code extension's lease
driver tree. It does not add driver configuration schemas or
exporter-set administration.

## Terminology and compatibility

This was originally developed as `--devices` on an integration branch.
Before proposing it upstream, use **drivers**: the report describes
software driver instances, not an inventory of physical devices attached
to the exporter. There is deliberately no new `--devices` alias on this
command.

The shared library exposes `describe_drivers` /
`describe_drivers_async`, retaining the initial `describe_devices`
helper names as compatibility aliases. The existing `jmp admin get
exporter --devices`, Kubernetes `Exporter.status.devices`, and protobuf
report semantics are unchanged.

The terminology is historically mixed: `status.devices` dates to July
2024, while the protobuf was renamed from `DeviceReport` to
`DriverInstanceReport` that same month. The controller also uses
nil/non-nil `status.devices` for exporter registration state. A future
physical-device inventory or deprecation of that report needs a separate
compatibility design, not a silent reinterpretation here.

## Dependency / review scope

**Depends on jumpstarter-dev#1042; merge that first.** This branch includes its shared
introspection library and MCP refactor, so those prerequisite changes
are currently visible in the diff. After jumpstarter-dev#1042 lands, update this branch
to reduce the diff to the follow-on changes.

Review the CLI implementation/tests, distributed-mode guide, and
driver-named library helpers with their legacy aliases. The branch
includes current `main` (`ca3b4831`) and preserves the exporter
holding-lease fix from merged jumpstarter-dev#1043.

## Validation

- `make pkg-test-jumpstarter-cli` — 265 passed
- `make pkg-test-jumpstarter` — 827 passed (18 warnings)
- `make pkg-test-jumpstarter-mcp` — 33 passed
- `make lint-fix` — passed
- `make pkg-ty-jumpstarter-cli` — passed

Companion VS Code extension changes use the new driver-tree contract,
with a narrowly scoped fallback for older integration-branch CLIs; 227
unit and 72 integration tests pass there.

No live-cluster/hardware smoke test was performed.

---------

Signed-off-by: Kirk Brauer <kirkebrauer@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants