import type { Command } from 'commander'; import type { GlobalOptions, KeystoreProtectionLabel, NetworkOption } from '../types.js'; /** Options for the shared {@link runInit} scaffolding step. */ export interface RunInitOptions { /** Establish an UNENCRYPTED dev keystore (plaintext keys, testnet only). */ dev?: boolean; /** Re-scaffold the regenerable config even if it exists (never the keystore). */ force?: boolean; /** Explicit network from `-n/--network`, already validated. Persisted to `defaults.network`. */ network?: NetworkOption; /** * Network to persist when `-n` is absent and `defaults.network` is unset: a * command's opinionated default (mutinynet for `quickstart`). Omitted by plain * `init`, which never persists a merely-defaulted network. */ fallbackNetwork?: NetworkOption; /** * Capture the establish-time confirmed passphrase so the caller can seed a * session with no second prompt (`quickstart --unlock`). Only populated when a * fresh ENCRYPTED keystore is established in this call. Never printed. */ captureEstablishedPassphrase?: boolean; } /** Result of the shared {@link runInit} scaffolding step. */ export interface RunInitResult { home: string; config: string; keystore: string; network: NetworkOption; created: string[]; protection: KeystoreProtectionLabel; /** * The confirmed passphrase from a fresh ENCRYPTED establishment in this call, * present only when {@link RunInitOptions.captureEstablishedPassphrase} was set * and a keystore was established. Consumed to seed a session; never printed. */ establishedPassphrase?: string; } /** * The shared scaffolding step behind `btcr2 init` and `btcr2 quickstart` (ADR * 079/080/083): create the home, a default config if none exists, and establish * the keystore if none exists (encrypted by default, `--dev` for unencrypted). * Idempotent: existing files are left untouched, and `--force` re-scaffolds only * the regenerable config, never the keystore. Records `defaults.network` via * {@link persistDefaultNetwork}. Returns the resolved paths, network, protection, * and (when asked) the establish-time passphrase for session seeding. */ export declare function runInit(g: GlobalOptions, options?: RunInitOptions): RunInitResult; /** * Registers the top-level `btcr2 init`: the one-command entry point that creates * the btcr2 home (ADR 079), writes a default config if none exists, and * establishes the keystore if none exists (encrypted with a confirmed passphrase * by default, or `--dev` for an unencrypted testnet keystore). `-n/--network` * records `defaults.network` so later commands can drop `-n` (ADR 083). * Idempotent: existing files are left untouched unless `--force` is given. * Establishing the passphrase here, up front and confirmed, is what keeps the * first `key generate` off the accidental-first-seal path (ADR 080). */ export declare function registerInitCommand(program: Command, globals: () => GlobalOptions): void; //# sourceMappingURL=init.d.ts.map