7 8 9 10 11 12 13 14 15 16 17 18 const hello = defineCommand("hello", async (args, ctx) => { const name = args[0] || "world"; return { stdout: `Hello, ${name}!\n`, stderr: "", exitCode: 0 }; }); const upper = defineCommand("upper", async (args, ctx) => { // ctx.stdin is a ByteString — decode to text before string ops. return { stdout: decodeBytesToUtf8(ctx.stdin).toUpperCase(), stderr: "", exitCode: 0, }; }); const bash = new Bash({ customCommands: [hello, upper] }); await bash.exec("hello Alice"); // "Hello, Alice!\n" await bash.exec("echo 'test' | upper"); // "TEST\n" https://justbash.dev/