UNPKG

@phren/cli

Version:

Knowledge layer for AI agents - CLI, MCP server, and data layer

42 lines (41 loc) • 1.58 kB
import { type IssueRef, type RepoRef } from "../forge/issues.js"; /** A bad command line: the caller fixes its arguments and retries (exit 1). */ export declare class UsageError extends Error { constructor(message: string); } interface ParsedArgs { positionals: string[]; flags: Map<string, string[]>; } /** * Flags take a value (`--repo r` or `--repo=r`), except the booleans above. * `--` ends flag parsing so a comment that starts with `--` still works. */ export declare function parseIssueArgs(argv: string[]): ParsedArgs; /** * Split `repo#N` (repo may be a URL or a bare owner/name), a full issue URL ending * `/issues/N`, or `#N`. The repository part is not normalized here. */ export declare function splitIssueRef(text: string): { repo?: string; number: number; }; interface RefOptions { repo?: string; project?: string; store: string; } /** Resolve a `<ref>` argument to a forge repository and issue number. */ export declare function resolveIssueRef(text: string, options: RefOptions): Promise<IssueRef>; /** The repositories `list` reads: the flags, else the project around the * working directory, else every project with a resolvable repository. */ export declare function listRepos(options: { repo: string[]; project?: string; store: string; cwd?: string; profile?: string; }): Promise<RepoRef[]>; /** `phren issue`: 0 on success, 1 on a usage error, 2 when the forge refuses. */ export declare function handleIssueCommand(args: string[], store: string, profile?: string): Promise<number>; export {};