CoAgent8 - Source API
    Preparing search index...

    Function runCommand

    • Executes a CLI executable or shim with robust streaming line decoders, buffer bounding, deadline enforcement, and layered termination.

      Parameters

      • command: string

        Command binary or shim name to resolve and execute.

      • args: string[]

        CLI arguments array.

      • options: RunCommandOptions = {}

        Execution constraints, standard input or protocol session, signal, and line callbacks.

      Returns Promise<RunCommandResult>

      Resolves with terminal stdout, stderr, exit code, and error envelopes.

      Without a session, stdin receives stdinInput and is closed, and a stop forces termination immediately. With a session, a stop first calls session.interrupt and keeps delivering output so the session can observe the terminal event; the root is stopped only when it has not exited within interruptGraceMs.