mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Enhance ShellTool with &&, ||, |, etc
This commit is contained in:
29 files changed
+539
-151
No files matched your search
@@ -4,20 +4,21 @@
|
||||
export interface ShellCommand {
|
||||
/** The name of the command (e.g., 'cat', 'ls', 'cd') */
|
||||
name: string;
|
||||
|
||||
|
||||
/** Brief description of what the command does */
|
||||
description: string;
|
||||
|
||||
|
||||
/** Usage syntax for the command */
|
||||
usage: string;
|
||||
|
||||
|
||||
/**
|
||||
* Execute the command with the given arguments
|
||||
* @param args Array of command arguments (excluding the command name itself)
|
||||
* @param cwd Current working directory
|
||||
* @param input Optional input for pipe operations
|
||||
* @returns Promise resolving to the command output or error message
|
||||
*/
|
||||
execute(args: string[], cwd: string): Promise<ShellCommandResult>;
|
||||
execute(args: string[], cwd: string, input?: string): Promise<ShellCommandResult>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -26,13 +27,13 @@ export interface ShellCommand {
|
||||
export interface ShellCommandResult {
|
||||
/** Exit code (0 for success, non-zero for error) */
|
||||
exitCode: number;
|
||||
|
||||
|
||||
/** Standard output content */
|
||||
stdout: string;
|
||||
|
||||
|
||||
/** Standard error content */
|
||||
stderr: string;
|
||||
|
||||
|
||||
/** New working directory (for commands like 'cd' that change directory) */
|
||||
newCwd?: string;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user