@vigilbase/cli
Version:
Vigilbase CLI — security scanners, agent tools, and Vigilbase One from the terminal.
44 lines (43 loc) • 1.79 kB
TypeScript
export type LocateFs = {
stat(target: string): Promise<{
isFile(): boolean;
isDirectory(): boolean;
}>;
realpath(target: string): Promise<string>;
readFile(target: string): Promise<string>;
readdir(target: string): Promise<string[]>;
};
export type CfLocation = {
packageDir: string;
/** Absolute path of the `bin.cf` entry script. */
entry: string;
packageVersion: string;
source: 'cf-bin' | 'managed' | 'path' | 'pnpm' | 'volta';
/**
* The package lies inside the current working directory (warned about), which
* may be a project's own cf. Never set for the managed install, which the CLI
* installed and verified itself, nor when the working directory is the home
* directory, where every global install (nvm, Volta, pnpm) lives.
*/
insideCwd: boolean;
};
export declare function isNodeSupported(version?: string): boolean;
/** cf runs under this Node via process.execPath; workerd ships no win32-arm64 build. */
export declare function assertLocalRuntimeSupported(version?: string, platform?: NodeJS.Platform, arch?: string): void;
export declare function locateCf(options: {
cfBin?: string;
/** The verified managed cf package directory (`findManagedCf`), tried after `--cf-bin`. */
managedDir?: string;
env: NodeJS.ProcessEnv;
platform?: NodeJS.Platform;
cwd?: string;
/** Defaults to HOME (USERPROFILE on Windows) from `env`, else the OS home directory. */
home?: string;
fs?: LocateFs;
}): Promise<CfLocation>;
export type CfVersionInfo = {
version: string;
tested: boolean;
};
/** Gate the version cf prints against its package.json and `CF_SUPPORTED`. */
export declare function checkCfVersion(printed: string, packageVersion: string): CfVersionInfo;