UNPKG

aicm

Version:

A TypeScript CLI tool for managing AI IDE rules across different projects and teams

111 lines (110 loc) 3.48 kB
import { ResolvedConfig, CommandFile, AssetFile, SkillFile, AgentFile, MCPServers, SupportedTarget } from "../utils/config"; export interface InstallOptions { /** * Base directory to use instead of process.cwd() */ cwd?: string; /** * Custom config object to use instead of loading from file */ config?: ResolvedConfig; /** * allow installation on CI environments */ installOnCI?: boolean; /** * Show verbose output during installation */ verbose?: boolean; /** * Perform a dry run without writing any files */ dryRun?: boolean; } /** * Result of the install operation */ export interface InstallResult { /** * Whether the operation was successful */ success: boolean; /** * Error object if the operation failed */ error?: Error; /** * Number of rules installed */ installedRuleCount: number; /** * Number of commands installed */ installedCommandCount: number; /** * Number of assets installed */ installedAssetCount: number; /** * Number of hooks installed */ installedHookCount: number; /** * Number of skills installed */ installedSkillCount: number; /** * Number of agents installed */ installedAgentCount: number; /** * Number of packages installed */ packagesCount: number; } export declare function writeAssetsToTargets(assets: AssetFile[], targets: SupportedTarget[]): void; export declare function writeCommandsToTargets(commands: CommandFile[], targets: SupportedTarget[]): void; /** * Write skills to all supported target directories */ export declare function writeSkillsToTargets(skills: SkillFile[], targets: SupportedTarget[]): void; /** * Warn about skill name collisions from different presets */ export declare function warnPresetSkillCollisions(skills: SkillFile[]): void; /** * Dedupe skills by name (last one wins) */ export declare function dedupeSkillsForInstall(skills: SkillFile[]): SkillFile[]; /** * Write agents to all supported target directories * Similar to skills, agents are written directly to the agents directory * with a .aicm.json metadata file tracking which agents are managed */ export declare function writeAgentsToTargets(agents: AgentFile[], targets: SupportedTarget[]): void; /** * Warn about agent name collisions from different presets */ export declare function warnPresetAgentCollisions(agents: AgentFile[]): void; /** * Dedupe agents by name (last one wins) */ export declare function dedupeAgentsForInstall(agents: AgentFile[]): AgentFile[]; export declare function warnPresetCommandCollisions(commands: CommandFile[]): void; export declare function dedupeCommandsForInstall(commands: CommandFile[]): CommandFile[]; /** * Write MCP servers configuration to a specific file */ export declare function writeMcpServersToFile(mcpServers: MCPServers, mcpPath: string): void; /** * Install rules for a single package (used within workspaces and standalone installs) */ export declare function installPackage(options?: InstallOptions): Promise<InstallResult>; /** * Core implementation of the rule installation logic */ export declare function install(options?: InstallOptions): Promise<InstallResult>; /** * CLI command wrapper for install */ export declare function installCommand(installOnCI?: boolean, verbose?: boolean, dryRun?: boolean): Promise<void>;