/** * Git runtime mode control * * Provides centralized feature flag for controlling git command execution. * This module manages whether git operations should be executed (live mode) * or skipped (off mode). */ /** * Git execution mode * - 'off': Git commands are not executed (default, safe for non-git environments) * - 'live': Git commands are executed normally */ export type GitMode = "off" | "live"; /** * Get the current git execution mode * * @returns Current git mode ('off' or 'live') * * @example * ```ts * const mode = getGitMode(); * console.log(`Git mode: ${mode}`); // 'off' or 'live' * ``` */ export declare function getGitMode(): GitMode; /** * Set the git execution mode * * Allows runtime modification of git behavior. * Useful for testing or dynamic environment configuration. * * @param mode - The git mode to set ('off' or 'live') * * @example * ```ts * setGitMode('live'); // Enable git commands * setGitMode('off'); // Disable git commands * ``` */ export declare function setGitMode(mode: GitMode): void; /** * Check if git commands are enabled * * Convenience function for checking if git operations should be executed. * * @returns true if git mode is 'live', false otherwise * * @example * ```ts * import { runGit } from './run.js'; * * if (gitIsEnabled()) { * // Execute git commands using the safe wrapper * const status = runGit(['status', '--short']); * console.log(status); * } else { * // Skip git operations * console.log('Git is disabled'); * } * ``` */ export declare function gitIsEnabled(): boolean; /** * Get the default git branch from environment variables * * Checks LEX_DEFAULT_BRANCH first, then falls back to LEX_BRANCH. * Returns undefined if neither is set. * * @returns The branch name from environment, or undefined * * @example * ```ts * const branch = getEnvBranch(); * if (branch) { * console.log(`Using branch: ${branch}`); * } * ``` */ export declare function getEnvBranch(): string | undefined; /** * Get the default git commit from environment variables * * Checks LEX_DEFAULT_COMMIT first, then falls back to LEX_COMMIT. * Returns undefined if neither is set. * * @returns The commit SHA from environment, or undefined * * @example * ```ts * const commit = getEnvCommit(); * if (commit) { * console.log(`Using commit: ${commit}`); * } * ``` */ export declare function getEnvCommit(): string | undefined;