Updated the read tool's provider-visible path schema, prompt docs, CLI help, and internal URL docs so URL and internal URI targets are advertised consistently. Added schema coverage for the read path description.\n\nFixes #2215
39 lines
1.0 KiB
TypeScript
39 lines
1.0 KiB
TypeScript
/**
|
|
* Show what the read tool will return for a path, URL, or internal URI.
|
|
*/
|
|
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, URL, or internal URI";
|
|
|
|
static args = {
|
|
path: Args.string({
|
|
description:
|
|
"Path, URL, or internal URI 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 omp://",
|
|
"omp read issue://123",
|
|
"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);
|
|
}
|
|
}
|