Files
oh-my-pi/packages/coding-agent/src/commands/read.ts
T
can1357 fdc3fe1196 refactor(coding-agent): removed configurable read timeout and standardized URL fetch timeout
- Removed the read CLI argument and tool schema field so read requests no longer accept custom timeouts.
- Updated URL read handling to stop forwarding timeout values and execute URL reads without a timeout parameter.
- Standardized URL read fetching to a fixed 30-second timeout and dropped timeout metadata from URL call rendering.
2026-05-07 05:39:22 +02:00

36 lines
967 B
TypeScript

/**
* Show what the read tool will return for a given path.
*/
import { Args, Command } from "@oh-my-pi/pi-utils/cli";
import { type ReadCommandArgs, runReadCommand } from "../cli/read-cli";
import { initTheme } from "../modes/theme/theme";
export default class Read extends Command {
static description = "Show what the read tool will return for a path or URL";
static args = {
path: Args.string({
description: "Path or URL to read (append :sel for line ranges or raw mode, e.g. src/foo.ts:50-100)",
required: true,
}),
};
static examples = [
"omp read src/foo.ts",
"omp read src/foo.ts:50-100",
"omp read src/foo.ts:raw",
"omp read https://example.com",
"omp read path/to/archive.zip:dir/file.ts",
"omp read path/to/db.sqlite:users:42",
];
async run(): Promise<void> {
const { args } = await this.parse(Read);
const cmd: ReadCommandArgs = {
path: args.path ?? "",
};
await initTheme();
await runReadCommand(cmd);
}
}