/** * .coolify.json state loader for CLI. * * When running CLI commands from a project directory that has a .coolify.json * (generated by create-bunspace or first deploy), reads the state to auto-fill * UUIDs so users don't need to copy-paste them. * * @module */ /** * State stored in .coolify.json (generated by create-bunspace deployer or init command). * * This file links a local directory to a Coolify deployment, storing all necessary * UUIDs and metadata for CLI commands to work without manual UUID entry. */ export interface ICoolifyDeployState { /** Application UUID in Coolify */ appUuid: string; /** Application name (for display purposes) */ appName?: string; /** Server UUID */ serverUuid: string; /** Server name (for display purposes) */ serverName?: string; /** Project UUID */ projectUuid: string; /** Project name (for display purposes) */ projectName?: string; /** Environment UUID */ environmentUuid: string; /** Environment name (for display purposes) */ environmentName?: string; /** Domain if configured */ domain?: string; /** Docker compose or Dockerfile path */ dockerComposePath?: string; /** Base directory for build context */ baseDirectory?: string; /** Git branch */ branch?: string; /** Git repository URL */ gitRepository?: string; /** Application source type (github-app, deploy-key, docker-image, etc.) */ sourceType?: string; /** Application type (legacy, may be undefined) */ type?: string; /** Build pack (dockerfile, nixpacks, static, dockercompose) */ buildPack?: string; /** Ports exposed (comma-separated) */ portsExposes?: string; /** Auto-deploy enabled (Coolify default: true) */ autoDeployEnabled?: boolean; /** Watch paths for selective auto-deploy (newline-separated globs, null = all changes) */ watchPaths?: string | null; /** When this state was last updated */ updatedAt?: string; /** Coolify instance URL */ coolifyUrl?: string; } /** * Multi-app state for monorepos deploying multiple services from one repo. * * Stored alongside or instead of the single-app state in .coolify.json. */ export interface ICoolifyMultiAppState { /** All apps deployed from this repo */ apps: Array<{ /** Application UUID in Coolify */ uuid: string; /** Application name */ name: string; /** Service role (e.g. "backend", "admin", "docs", "proxy") */ service: string; /** Domain if configured (with protocol). Null for internal services. */ domain?: string | null; /** Dockerfile path relative to repo root */ dockerfile?: string | null; /** Exposed port */ port?: number; /** Auto-deploy enabled (Coolify default: true) */ autoDeployEnabled?: boolean; /** Watch paths for selective auto-deploy (newline-separated globs, null = all changes) */ watchPaths?: string | null; }>; /** Server UUID */ serverUuid: string; /** Server name (for display purposes) */ serverName?: string; /** Project UUID */ projectUuid: string; /** Project name (for display purposes) */ projectName?: string; /** Environment UUID */ environmentUuid: string; /** Environment name (for display purposes) */ environmentName?: string; /** Git branch */ branch?: string; /** Git repository URL */ gitRepository?: string; /** Coolify instance URL */ coolifyUrl?: string; /** When this state was last updated */ updatedAt?: string; } /** * Loads .coolify.json from the current working directory (single-app format). * * Handles both single-app and multi-app formats. For multi-app state with * exactly one app, returns a synthesized single-app state for backward compat. * * @returns The deploy state if found, null otherwise */ export declare function loadCoolifyState(): ICoolifyDeployState | null; /** * Loads .coolify.json in multi-app format. * * If the file is in single-app format, returns null (use loadCoolifyState instead). * * @returns The multi-app state if found, null otherwise */ export declare function loadMultiAppState(): ICoolifyMultiAppState | null; /** * Writes .coolify.json in multi-app format to the current working directory. * * @param state - The multi-app state to write */ export declare function writeMultiAppState(state: ICoolifyMultiAppState): void; /** * Writes .coolify.json to the current working directory. * * @param state - The state to write */ export declare function writeCoolifyState(state: ICoolifyDeployState): void; /** * Resolves a UUID argument — if not provided, tries to read from .coolify.json. * * Supports both single-app and multi-app state formats. For multi-app state * with exactly one app, auto-selects that app. For multiple apps, returns null * (user must specify explicitly). * * @param uuid - UUID from CLI argument (may be undefined) * @param field - Which field to read from .coolify.json (default: appUuid) * @returns The resolved UUID or null if not found */ export declare function resolveUuid(uuid: string | undefined, field?: keyof ICoolifyDeployState): string | null; //# sourceMappingURL=coolify-state.d.ts.map