---
source: lib/src/sdk/typescript/types.rs
expression: client
---
// @generated by usage-cli from test.usage.kdl. Do not edit manually.
import { CliRunner, CliResult } from "./runtime";
import { StatusFlags } from "./types";

export class App {
  private runner: CliRunner;
  /** Show status */
  readonly status: Status;

  constructor(binPath?: string) {
    this.runner = new CliRunner(binPath ?? "app");
    this.status = new Status(this.runner);
  }
  /** <SUBCOMMAND> */
  async exec(): Promise<CliResult> {
    return this.runner.run([]);
  }
}

/** Show status */
export class Status {
  private runner: CliRunner;

  constructor(runner: CliRunner) {
    this.runner = runner;
  }
  /** status [--verbose] [--json] */
  async exec(flags?: StatusFlags): Promise<CliResult> {
    const cmdArgs: string[] = ["status"];
    const flagArgs = this.buildFlagArgs(flags);
    return this.runner.run([...cmdArgs, ...flagArgs]);
  }

  private buildFlagArgs(flags?: StatusFlags): string[] {
    const result: string[] = [];
    if (!flags) return result;
    if (flags.verbose) { result.push("--verbose"); }
    if (flags.json) { result.push("--json"); }
    return result;
  }
}
