@capgo/cli
Version:
A CLI to upload to capgo servers
72 lines (71 loc) • 3.07 kB
TypeScript
export interface KeyVaultBaseOptions {
apikey?: string;
apiHost?: string;
vaultSecretFile?: string;
}
export interface KeyVaultPushOptions extends KeyVaultBaseOptions {
key?: string;
generateSecret?: boolean;
replace?: boolean;
force?: boolean;
}
export interface KeyVaultPullOptions extends KeyVaultBaseOptions {
out?: string;
force?: boolean;
}
export interface KeyVaultDeleteOptions extends KeyVaultBaseOptions {
yes?: boolean;
}
export interface KeyVaultStatus {
app_id: string;
configured: boolean;
revision?: number;
public_key?: string;
public_key_sha256?: string;
kdf_iterations?: number;
updated_at?: string;
envelope_access?: boolean;
envelope?: unknown;
}
/** Vault secret from --vault-secret-file, then CAPGO_KEY_VAULT_SECRET, then a hidden prompt. */
export declare function readVaultSecret(options: {
vaultSecretFile?: string;
}, prompt?: boolean): Promise<string | undefined>;
/**
* Downloads the envelope and decrypts it in memory. Used by `bundle upload --key-vault`,
* `bundle zip --for-upload --key-vault`, the SDK and the local MCP server.
*/
export declare function loadPrivateKeyFromVault(appId: string, options: KeyVaultBaseOptions, vaultSecret?: string, matchProjectKey?: boolean): Promise<string>;
/** `--key-vault` replaces the local key file, so it cannot be combined with the other key options. */
export declare function assertKeyVaultOptions(options: {
keyV2?: unknown;
keyDataV2?: string;
key?: unknown;
external?: string;
}): void;
export declare function pushKeyVault(appIdArg: string | undefined, options: KeyVaultPushOptions): Promise<KeyVaultStatus>;
/**
* Writes the key owner-only without following links: an existing symlink (even dangling) is
* refused, and the file is created exclusively next to the target, then renamed over it.
*/
export declare function writePrivateKeyFile(out: string, privateKey: string, force: boolean): void;
export declare function pullKeyVault(appIdArg: string | undefined, options: KeyVaultPullOptions): Promise<{
path: string;
}>;
export declare function keyVaultStatus(appIdArg: string | undefined, options: KeyVaultBaseOptions): Promise<{
app_id: string;
configured: boolean;
revision?: number;
public_key?: string;
public_key_sha256?: string;
kdf_iterations?: number;
updated_at?: string;
envelope_access?: boolean;
}>;
export declare function deleteKeyVault(appIdArg: string | undefined, options: KeyVaultDeleteOptions): Promise<{
deleted: boolean;
} | null>;
export declare const pushKeyVaultCommand: (appIdArg: string | undefined, options: KeyVaultPushOptions) => Promise<void>;
export declare const pullKeyVaultCommand: (appIdArg: string | undefined, options: KeyVaultPullOptions) => Promise<void>;
export declare const keyVaultStatusCommand: (appIdArg: string | undefined, options: KeyVaultBaseOptions) => Promise<void>;
export declare const deleteKeyVaultCommand: (appIdArg: string | undefined, options: KeyVaultDeleteOptions) => Promise<void>;