Skip to content

Index

cli

derive_client CLI package.

Classes

Functions

cli

cli(
    ctx,
    session_key_path: Path | None,
    env_file: Path | None,
)

Derive client command line interface.

Source code in derive_client/cli/__init__.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
@click.group("Derive Client")
@click.option(
    "--session-key-path",
    "-k",
    type=click.Path(exists=True, dir_okay=False, readable=True, path_type=Path),
    default=None,
    help="Path to the file containing the session key to be used as signer.",
)
@click.option(
    "--env-file",
    "-e",
    type=click.Path(exists=True, dir_okay=False, readable=True, path_type=Path),
    default=None,
    help="Path to a .env file. Defaults to .env in the current working directory.",
)
@click.pass_context
def cli(ctx, session_key_path: Path | None, env_file: Path | None):
    """Derive client command line interface."""

    ctx.ensure_object(dict)
    client = HTTPClient.from_env(session_key_path=session_key_path, env_file=env_file)
    ctx.obj["client"] = client

tree

tree(verbose: bool)

Print the command tree structure.

Source code in derive_client/cli/__init__.py
58
59
60
61
62
@cli.command()
@click.option('--verbose', '-v', is_flag=True, help='Show command descriptions')
def tree(verbose: bool):
    '''Print the command tree structure.'''
    print_tree(cli, verbose=verbose)