/** * CLI Execution Entry Point * * Implements main(), parseArgs(), and executeScript() for rill-exec and rill-eval binaries. * Handles file execution, stdin input, and module loading. */ import type { ExecutionResult } from '@rcrsr/rill'; /** * Parsed command-line arguments */ export type ParsedArgs = { mode: 'exec'; file: string; args: string[]; format: 'human' | 'json' | 'compact'; verbose: boolean; maxStackDepth: number; } | { mode: 'eval'; expression: string; } | { mode: 'help'; } | { mode: 'explain'; errorId: string; }; /** * Parse command-line arguments into structured command * * @param argv - Raw command-line arguments (typically process.argv.slice(2)) * @returns Parsed command object */ export declare function parseArgs(argv: string[]): ParsedArgs; /** * Execute a Rill script file with arguments and module support * * @param file - File path or '-' for stdin * @param args - Command-line arguments to pass as $ pipe value * @param options - Execution options * @returns Execution result with value, variables, and source text * @throws Error if file not found or execution fails */ export declare function executeScript(file: string, args: string[], options?: { stdin?: boolean; source?: string; }): Promise; /** * Entry point for rill-exec and rill-eval binaries * * Parses command-line arguments, executes scripts, and handles errors. * Writes results to stdout and errors to stderr. * Returns a numeric exit code. */ export declare function main(argv: string[]): Promise;