---
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 { GreetArgs } from "./types";

export class App {
  private runner: CliRunner;
  /** Greet someone */
  readonly greet: Greet;

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

/** Greet someone */
export class Greet {
  private runner: CliRunner;

  constructor(runner: CliRunner) {
    this.runner = runner;
  }
  /**
   * greet <name>
   * @example Example
   * ```
   * app greet hello
   * ```
   */
  async exec(args: GreetArgs): Promise<CliResult> {
    const cmdArgs: string[] = ["greet"];
    if (args.name !== undefined) { cmdArgs.push(String(args.name)); }
    return this.runner.run(cmdArgs);
  }
}
