Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/source/cli/clients.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ self-signed certificates.

3. Those details can be installed as a secret on CI, or passed down to the final user.

Then the user can create the client using the [jmp client](./reference/jmp-client.md#jmp-client-create-config) CLI:
Then the user can create the client using the [jmp client](./reference/jmp-client.md#jmp-client-config-create) CLI:

```bash
$ jmp client create-config my-client
$ jmp client config create my-client
Enter a valid Jumpstarter service endpoint: devl.jumpstarter.dev
Enter a Jumpstarter auth token (hidden): ***
Enter a comma-separated list of allowed driver packages (optional):
Expand Down
26 changes: 13 additions & 13 deletions docs/source/config/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,30 +90,30 @@ please follow the instructions in the [Jumpstarter service CLI](../cli/clients.m

Importing a new client is as simple as copying the administrator provided yaml
file to `~/.config/jumpstarter/clients/`, alternatively if we have the token
and endpoint the `jmp client create <name>` command can be used to create
and endpoint the `jmp client config create <name>` command can be used to create
the config file.

To switch between different client configs, use the `jmp client use-config <name>` command:
To switch between different client configs, use the `jmp client config use <name>` command:

```bash
$ jmp client use-config another
$ jmp client config use another
Using client config '/home/jdoe/.config/jumpstarter/clients/another.yaml'
```

All client configurations can be listed with `jmp client list-configs`:
All client configurations can be listed with `jmp client config list`:

```bash
$ jmp client list-configs
$ jmp client config list
CURRENT NAME ENDPOINT PATH
* default jumpstarter1.my-lab.com:1443 /home/jdoe/.config/jumpstarter/clients/default.yaml
myclient jumpstarter2.my-lab.com:1443 /home/jdoe/.config/jumpstarter/clients/myclient.yaml
another jumpstarter3.my-lab.com:1443 /home/jdoe/.config/jumpstarter/clients/another.yaml
```

Clients can also be removed using `jmp client delete-config <name>`:
Clients can also be removed using `jmp client config delete <name>`:

```bash
$ jmp client delete-config myclient
$ jmp client config delete myclient
Deleted client config '/home/jdoe/.config/jumpstarter/clients/myclient.yaml'
```

Expand Down Expand Up @@ -201,10 +201,10 @@ please follow the instructions in the [Jumpstarter service CLI](../cli/exporters

### Creating a exporter configuration file
To create a new exporter configuration file from a know endpoint and
token the `jmp exporter create <name>` command can be used.
token the `jmp exporter config create <name>` command can be used.

```bash
$ jmp exporter create myexporter
$ jmp exporter config create myexporter
Endpoint: grpc.jumpstarter.my.domain.com
Token: <<token>>
```
Expand All @@ -222,19 +222,19 @@ The path to a config can also be provided:
jmp exporter run -c /etc/jumpstarter/exporters/another/exporter.yaml
```

All exporter configurations can be listed with `jmp exporter list`:
All exporter configurations can be listed with `jmp exporter config list`:

```bash
$ jmp exporter list
$ jmp exporter config list
ALIAS PATH
test-exporter-2 /etc/jumpstarter/exporters/test-exporter-2.yaml
my-exporter /etc/jumpstarter/exporters/my-exporter.yaml
```

Exporers can also be removed using `jmp exporter delete <name>`:
Exporers can also be removed using `jmp exporter config delete <name>`:

```bash
$ jmp exporter delete myexporter
$ jmp exporter config delete myexporter
Deleted exporter config '/etc/jumpstarter/exporters/myexporter.yaml'
```

Expand Down
2 changes: 1 addition & 1 deletion docs/source/getting-started/setup-exporter-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ To edit the config file with your default text editor, run the following command

```bash
# Opens the config for "testing" in your default editor
$ jmp exporter edit-config testing
$ jmp exporter config edit testing
```

Add the `storage` and `power` drivers under the `export` field in the config file.
Expand Down
4 changes: 2 additions & 2 deletions docs/source/installation/python-package.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ $ alias jmp-client='podman run --rm -it -w /home \
Then you can try:

```bash
$ jmp-client list-configs
$ jmp-client config list
CURRENT NAME ENDPOINT PATH
* default grpc.devel.jumpstarter.dev:443 /root/.config/jumpstarter/clients/default.yaml
test grpc.devel.jumpstarter.dev:443 /root/.config/jumpstarter/clients/test.yaml
Expand Down Expand Up @@ -129,4 +129,4 @@ The Jumpstarter packages which can be installed are:
| [`jumpstarter-driver-*`](https://github.com/jumpstarter-dev/jumpstarter/tree/main/packages) | All community and official driver packages that are distributed as part of Jumpstarter are prefixed with `jumpstarter-driver-*`. This includes drivers for PySerial, SD Wire, HTTP, CAN, and more. Driver packages only need to be installed on the exporter/client if they are used by your testing environment. All drivers are optional. |
| [`jumpstarter-adapter-*`](https://github.com/jumpstarter-dev/jumpstarter/tree/main/packages) | All community and official adapter packages that are distributed as part of Jumpstarter are prefixed with `jumpstarter-adapter-*`. This includes adapters to redirect streams to local ports, unix sockets, perform ssh connections, etc. |
| [`jumpstarter-imagehash`](https://github.com/jumpstarter-dev/jumpstarter/tree/main/packages/jumpstarter-imagehash) | A library to perform image checking from video inputs using the simple python imagehash library |
| [`jumpstarter-testing`](https://github.com/jumpstarter-dev/jumpstarter/tree/main/packages/jumpstarter-testing) | Testing tools for writing Jumpstarter-powered tests with `pytest`.|
| [`jumpstarter-testing`](https://github.com/jumpstarter-dev/jumpstarter/tree/main/packages/jumpstarter-testing) | Testing tools for writing Jumpstarter-powered tests with `pytest`.|
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
from jumpstarter_cli_common import AliasedGroup, opt_log_level, version
from jumpstarter_cli_common.exceptions import handle_exceptions

from .client_config import create_client_config, delete_client_config, list_client_configs, use_client_config
from .client_exporter import list_client_exporters
from .client_lease import client_lease
from .client_login import client_login
from .client_shell import client_shell
from .config import config
from jumpstarter.common.utils import env


Expand Down Expand Up @@ -38,11 +38,8 @@ def cli():
sys.exit(1)


client.add_command(create_client_config)
client.add_command(delete_client_config)
client.add_command(list_client_configs)
client.add_command(list_client_exporters)
client.add_command(use_client_config)
client.add_command(config)
client.add_command(client_lease)
client.add_command(client_login)
client.add_command(client_shell)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def list_client_exporters(name: str | None, labels: list[(str, str)], output: Ou
config = UserConfigV1Alpha1.load_or_create().config.current_client
if not config:
raise click.BadParameter(
"no client specified, and no default client set: specify a client name, or use jmp client use-config ",
"no client specified, and no default client set: specify a client name, or use jmp client config use",
param_hint="name",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def lease_release(name, lease, all_leases):
config = UserConfigV1Alpha1.load_or_create().config.current_client
if not config:
raise click.BadParameter(
"no client specified, and no default client set: specify a client name, or use jmp client use-config ",
"no client specified, and no default client set: specify a client name, or use jmp client config use",
param_hint="name",
)

Expand Down Expand Up @@ -89,7 +89,7 @@ def lease_request(name, labels):
config = UserConfigV1Alpha1.load_or_create().config.current_client
if not config:
raise click.BadParameter(
"no client specified, and no default client set: specify a client name, or use jmp client use-config ",
"no client specified, and no default client set: specify a client name, or use jmp client config use",
param_hint="name",
)
lease = config.request_lease(metadata_filter=MetadataFilter(labels=dict(labels)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def client_shell(name: str, labels, lease_name):
config = UserConfigV1Alpha1.load_or_create().config.current_client
if not config:
raise click.BadParameter(
"no client specified, and no default client set: specify a client name, or use jmp client use-config ",
"no client specified, and no default client set: specify a client name, or use jmp client config use",
param_hint="name",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ async def test_client():
result = await runner.invoke(
client,
[
"create-config",
"config",
"create",
"test1",
"--namespace",
"default",
Expand All @@ -32,7 +33,8 @@ async def test_client():
result = await runner.invoke(
client,
[
"create-config",
"config",
"create",
"test1",
"--namespace",
"default",
Expand All @@ -51,33 +53,33 @@ async def test_client():
# create client interactively
result = await runner.invoke(
client,
["create-config", "test2"],
["config", "create", "test2"],
input="default\ntest2\nexample.org:443\ndummytoken\njumpstarter.*,com.example.*\n",
)
assert result.exit_code == 0

# list clients
result = await runner.invoke(client, ["list-configs"])
result = await runner.invoke(client, ["config", "list"])
assert result.exit_code == 0
assert "* test1 example.com:443" in result.output
assert " test2 example.org:443" in result.output

# set default client
result = await runner.invoke(client, ["use-config", "test2"])
result = await runner.invoke(client, ["config", "use", "test2"])
assert result.exit_code == 0

# list clients
result = await runner.invoke(client, ["list-configs"])
result = await runner.invoke(client, ["config", "list"])
assert result.exit_code == 0
assert " test1 example.com:443" in result.output
assert "* test2 example.org:443" in result.output

# delete default client
result = await runner.invoke(client, ["delete-config", "test2"])
result = await runner.invoke(client, ["config", "delete", "test2"])
assert result.exit_code == 0

# list clients
result = await runner.invoke(client, ["list-configs"])
result = await runner.invoke(client, ["config", "list"])
assert result.exit_code == 0
assert "* test1 example.com:443" in result.output
assert "* test2 example.org:443" not in result.output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@
)


@click.command("create-config", short_help="Create a client config.")
@click.group()
def config():
"""
Modify jumpstarter client config files
"""


@config.command("create", short_help="Create a client config.")
@click.argument("alias")
@click.option(
"--out",
Expand Down Expand Up @@ -115,7 +122,7 @@ def set_next_client(name: str):
user_config.use_client(None)


@click.command("delete-config", short_help="Delete a client config.")
@config.command("delete", short_help="Delete a client config.")
@click.argument("name", type=str)
@opt_output_path_only
@handle_exceptions
Expand All @@ -127,7 +134,7 @@ def delete_client_config(name: str, output: PathOutputType):
click.echo(path)


@click.command("list-configs", short_help="List available client configurations.")
@config.command("list", short_help="List available client configurations.")
@opt_output_all
@handle_exceptions
def list_client_configs(output: OutputType):
Expand Down Expand Up @@ -161,7 +168,7 @@ def make_row(c: ClientConfigV1Alpha1):
click.echo(make_table(columns, rows))


@click.command("use-config", short_help="Select the current client config.")
@config.command("use", short_help="Select the current client config.")
@click.argument("name", type=str)
@opt_output_path_only
@handle_exceptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import asyncclick as click
from jumpstarter_cli_common import AliasedGroup, opt_log_level, version

from .config import config
from .exporter import exporter_shell, run_exporter
from .exporter_config import create_exporter_config, delete_exporter_config, edit_exporter_config, list_exporter_configs
from .exporter_login import exporter_login


Expand All @@ -19,10 +19,7 @@ def exporter(log_level: Optional[str]):
logging.basicConfig(level=logging.INFO)


exporter.add_command(create_exporter_config)
exporter.add_command(delete_exporter_config)
exporter.add_command(edit_exporter_config)
exporter.add_command(list_exporter_configs)
exporter.add_command(config)
exporter.add_command(run_exporter)
exporter.add_command(exporter_login)
exporter.add_command(exporter_shell)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@
arg_alias = click.argument("alias", default="default")


@click.command("create-config")
@click.group()
def config():
"""
Modify jumpstarter exporter config files
"""


@config.command("create")
@click.option("--namespace", prompt=True)
@click.option("--name", prompt=True)
@click.option("--endpoint", prompt=True)
Expand Down Expand Up @@ -41,7 +48,7 @@ def create_exporter_config(alias, namespace, name, endpoint, token, output: Path
click.echo(path)


@click.command("delete-config")
@config.command("delete")
@arg_alias
@opt_output_path_only
def delete_exporter_config(alias, output: PathOutputType):
Expand All @@ -55,7 +62,7 @@ def delete_exporter_config(alias, output: PathOutputType):
click.echo(path)


@click.command("edit-config")
@config.command("edit")
@arg_alias
def edit_exporter_config(alias):
"""Edit an exporter config."""
Expand All @@ -66,7 +73,7 @@ def edit_exporter_config(alias):
click.edit(filename=config.path)


@click.command("list-configs")
@config.command("list")
@opt_output_all
def list_exporter_configs(output: OutputType):
"""List exporter configs."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ async def test_exporter():
result = await runner.invoke(
exporter,
[
"create-config",
"config",
"create",
"test1",
"--namespace",
"default",
Expand All @@ -30,7 +31,8 @@ async def test_exporter():
result = await runner.invoke(
exporter,
[
"create-config",
"config",
"create",
"test1",
"--namespace",
"default",
Expand All @@ -46,22 +48,22 @@ async def test_exporter():

# create exporter interactively
result = await runner.invoke(
exporter, ["create-config", "test2"], input="default\ntest2\nexample.org:443\ndummytoken\n"
exporter, ["config", "create", "test2"], input="default\ntest2\nexample.org:443\ndummytoken\n"
)
assert result.exit_code == 0

# list exporters
result = await runner.invoke(exporter, ["list-configs"])
result = await runner.invoke(exporter, ["config", "list"])
assert result.exit_code == 0
assert "test1" in result.output
assert "test2" in result.output

# delete exporter
result = await runner.invoke(exporter, ["delete-config", "test2"])
result = await runner.invoke(exporter, ["config", "delete", "test2"])
assert result.exit_code == 0

## list exporters
result = await runner.invoke(exporter, ["list-configs"])
result = await runner.invoke(exporter, ["config", "list"])
assert result.exit_code == 0
assert "test1" in result.output
assert "test2" not in result.output
Expand Down