This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
- Build:
npm run build- Compiles TypeScript to JavaScript in thedist/directory - Development:
npm run dev- Runs the CLI directly with ts-node for development - Start:
npm run start- Runs the compiled CLI from dist/index.js - Local installation:
npm i -g .- Installs the CLI globally from the current directory
This is a Node.js CLI tool for managing Skyflow vaults and service accounts, built with TypeScript and Commander.js.
- Entry Point:
src/index.ts- Sets up Commander.js program with global options and command registration - Commands:
src/commands/- Individual command implementations (configure, createVault) - Utilities:
src/utils/- Shared functionality for API calls, config management, prompts, and logging - Types:
src/types.ts- TypeScript interfaces for vault operations and API responses
- Configuration Management: Uses
~/.skyflow/config.jsonfor persistent config, with environment variable fallbacks- Stores:
bearerToken,accountId,workspaceID,lastVaultId,lastClusterId,lastVaultUrl - Last-used vault details are automatically saved and offered as defaults in interactive prompts
- Stores:
- Authentication Flow: Pre-action hooks validate configuration before command execution (except for
configurecommand) - Interactive Prompts: Uses inquirer.js to prompt for missing required options
- All data operation commands (
insert,deidentify,reidentify) prompt for missing vault-id and cluster-id - Prompts offer last-used values as defaults for improved UX
- Parameter resolution priority: CLI options → Environment variables → Interactive prompts with defaults
- All data operation commands (
- Error Handling: Comprehensive error handling with user-friendly messages and proper exit codes
- Verbose Logging: Global
--verboseflag enables detailed debugging output throughout the application
The CLI interacts with Skyflow's REST APIs for:
- Vault creation and management
- Service account creation
- Role assignment (VAULT_OWNER role)
- Access verification
- TypeScript compilation targets ES2018 with CommonJS modules
- Output goes to
dist/directory - Executable binary is
dist/index.jswith shebang for direct execution