---
source: lib/src/sdk/python/mod.rs
expression: "get_file(&output, \"client.py\")"
---
# @generated by usage-cli from test.usage.kdl. Do not edit manually.
from __future__ import annotations
from typing import Optional
from .runtime import CliResult, CliRunner
from .types import AddRemoteArgs, RemoveRemoteArgs

class Cli:
    def __init__(self, bin_path: str = "cli") -> None:
        self._runner = CliRunner(bin_path)
        self.add_remote = AddRemote(self._runner)
        self.remove_remote = RemoveRemote(self._runner)

    def exec(self) -> CliResult:
        """<SUBCOMMAND>"""
        cmd_args: list[str] = []
        return self._runner.run(cmd_args)

class AddRemote:
    """Add a remote"""
    def __init__(self, runner: CliRunner) -> None:
        self._runner = runner

    def exec(self, args: AddRemoteArgs) -> CliResult:
        """add-remote <name> <url>"""
        cmd_args: list[str] = ["add-remote"]
        if args.name is not None: cmd_args.append(str(args.name))
        if args.url is not None: cmd_args.append(str(args.url))
        return self._runner.run(cmd_args)

class RemoveRemote:
    """Remove a remote"""
    def __init__(self, runner: CliRunner) -> None:
        self._runner = runner

    def exec(self, args: RemoveRemoteArgs) -> CliResult:
        """remove-remote <name>"""
        cmd_args: list[str] = ["remove-remote"]
        if args.name is not None: cmd_args.append(str(args.name))
        return self._runner.run(cmd_args)
