mirror of
https://github.com/openclaw/lobster.git
synced 2026-08-14 08:52:48 +00:00
15 lines
371 B
TypeScript
15 lines
371 B
TypeScript
export const jsonCommand = {
|
|
name: 'json',
|
|
help() {
|
|
return `json — render pipeline output as JSON\n\nUsage:\n ... | json\n`;
|
|
},
|
|
async run({ input, ctx }) {
|
|
const items = [];
|
|
for await (const item of input) items.push(item);
|
|
ctx.render.json(items);
|
|
return { output: emptyStream(), rendered: true };
|
|
},
|
|
};
|
|
|
|
async function* emptyStream() {}
|