/** * Package manager detection and installation utilities * Uses cross-runtime platform abstractions. * @module cli/utils/package-manager */ import { type PackageClient } from "../../src/utils/package-client.js"; /** * The client this CLI installs with. * * Shared with `src/extensions/install-command.ts`, which prints install hints: * the client Veryfront tells a reader to run must be the client it ran itself. */ export type PackageManager = PackageClient; /** * Detect package manager from npm_config_user_agent environment variable * This is set when running via `pnpm create`, `npm create`, etc. * * Format examples: * - pnpm/8.15.1 npm/? node/v20.11.0 darwin arm64 * - npm/10.2.4 node/v20.11.0 darwin arm64 * - yarn/1.22.21 npm/? node/v20.11.0 darwin arm64 * - bun/1.0.0 node/v20.11.0 darwin arm64 * - deno/2.0.4 npm/? deno/2.0.4 macos aarch64 */ export declare function detectFromUserAgent(): PackageManager | undefined; /** * Detect the package manager to use based on various signals * * Priority: * 1. Explicit preference (if provided) * 2. npm_config_user_agent env var (set when running via create-*) * 3. Existing lockfile in project directory * 4. Parent directory lockfile (for monorepos) * 5. Default to npm */ export declare function detectPackageManager(projectDir: string, preference?: PackageManager): Promise; /** * Get the install command for a package manager */ export declare function getInstallCommand(pm: PackageManager): string; /** * Get the run script command for a package manager * e.g., "pnpm dev" vs "npm run dev" */ export declare function getRunCommand(pm: PackageManager, script: string): string; /** * Get the dlx/npx command for a package manager * Used for running one-off packages */ export declare function getDlxCommand(pm: PackageManager): string; /** * Install dependencies using the detected package manager * * @param projectDir - Directory to install dependencies in * @param options - Installation options * @returns true if installation succeeded, false otherwise */ export declare function installDependencies(projectDir: string, options?: { packageManager?: PackageManager; silent?: boolean; }): Promise; //# sourceMappingURL=package-manager.d.ts.map