/** * `forge init` — Interactive project initialization wizard. * * Sets up ForgeOS for a project in < 60 seconds: * - Detects or creates ~/.forgeos/config.json (global credentials) * - Prompts for engine URL and API key (validates via /health) * - Detects project type from cwd files (node/rust/go/python/ios) * - Applies a named starter profile (backend-service|mobile-release|library-sdk|quick) * - Writes .forgeos/config.json (project-local config, Sprint 1 schema) * - Writes .forgeos/gates.yaml (gate template) * - Calls POST /api/projects to register with the engine * - Optionally creates a first initiative * * Flags: * --project-name Skip project name prompt (backward compat + scripting) * --profile Apply a named profile (skips auto-detection) * --local-only Skip engine connection; trust ledger only * --yes Non-interactive; accept all defaults * * Sprint 1 DX : * When called without --project-name, shows a focused 3-prompt wizard: * 1. Project name * 2. Pathway (fast_track / standard / infrastructure) * 3. First initiative title (optional) * Prints a compact "what just happened" summary, then `forge status`. */ import { Command } from "commander"; import { ForgeOSClient } from "../../shared/client.js"; export interface GateDefinition { id: string; name: string; required_evidence: string[]; required_roles?: string[]; } export interface ProfileDefinition { name: string; description: string; gates: GateDefinition[]; } export declare const PROFILES: Record; export type DetectedPlatform = "node" | "rust" | "go" | "python" | "ios" | "unknown"; /** * Detect project type by inspecting files in the given directory. * Returns the first match in priority order. */ export declare function detectPlatform(dir: string): DetectedPlatform; /** Map detected filesystem platform to the API's platform enum. */ export declare function toApiPlatform(detected: DetectedPlatform): string; /** Return the best-fit profile name for a detected platform. */ export declare function defaultProfileForPlatform(platform: DetectedPlatform): string; export interface GlobalConfig { engine_url?: string; api_key?: string; default_project_id?: string; telemetry?: boolean; local_only?: boolean; } export interface ProjectConfig { project_id: string; platform: string; profile: string; local_only: boolean; created_at: string; } /** Returns the default path to the global ForgeOS config file. */ export declare function globalConfigPath(): string; export declare const PROJECT_CONFIG_DIR = ".forgeos"; export declare const PROJECT_CONFIG_FILE = ".forgeos/config.json"; export declare const PROJECT_GATES_FILE = ".forgeos/gates.yaml"; /** Serialise a profile's gates to a human-readable YAML string. */ export declare function generateGatesYaml(profile: ProfileDefinition): string; /** * Load the global ForgeOS config. * @param configPath Override path (for testing). Defaults to ~/.forgeos/config.json. */ export declare function loadGlobalConfig(configPath?: string): GlobalConfig; /** * Persist the global ForgeOS config. * @param cfg Config object to write. * @param configPath Override path (for testing). Defaults to ~/.forgeos/config.json. */ export declare function writeGlobalConfig(cfg: GlobalConfig, configPath?: string): void; export interface InitOptions { /** Explicit project name — skips the wizard name prompt when provided. */ projectName?: string; /** Pathway override for Sprint 1 wizard (fast_track|standard|infrastructure). */ pathway?: string; /** First initiative title — creates an initiative after project setup. */ initiativeTitle?: string; profile?: string; localOnly?: boolean; yes?: boolean; cwd?: string; globalCfgPath?: string; } export interface InitResult { projectConfigPath: string; gatesPath: string; platform: DetectedPlatform; profile: string; projectId: string | null; /** ID of the first initiative created during init, if any. */ initiativeId: string | null; localOnly: boolean; globalConfigUpdated: boolean; } /** * Core init logic — separated from Commander action for testability. * Writes files and (optionally) calls the engine. Returns a summary object. */ export declare function runInit(_client: ForgeOSClient, opts: InitOptions): Promise; export declare function registerInitCommands(parent: Command, client: ForgeOSClient): void; //# sourceMappingURL=init.d.ts.map