This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
npm install # Install dependencies
npm run dev # Watch mode development build (uses esbuild)
npm run build # Production build
node dist/index.js # Run CLI from sourcenpm test # Run all tests (vitest)
npm run test:watch # Watch mode
npm run test:coverage # Coverage report
npx vitest tests/commands/deploy.test.ts # Single test file
npx vitest -t "test name pattern" # Run specific test by namesrc/index.ts- Main entry, initializes Commander program and registers all command groups- Commands organized in
src/commands/<domain>/index.ts- each exportsinitialize*Commands(program)function - Command domains: general (init/up/stop), account, contracts, config, localnet, update, scaffold, network, transactions, staking
BaseAction(src/lib/actions/BaseAction.ts) - Base class for all CLI actions. Provides:- GenLayer client initialization via
genlayer-jsSDK - Keystore management (encrypted wallet with password)
- Spinner/logging utilities (ora, chalk)
- User prompts (inquirer)
- GenLayer client initialization via
ConfigFileManager(src/lib/config/ConfigFileManager.ts) - Manages~/.genlayer/genlayer-config.jsonKeychainManager(src/lib/config/KeychainManager.ts) - System keychain integration via keytar
- Create action class extending
BaseActioninsrc/commands/<domain>/<action>.ts - Export action options interface
- Register in domain's
index.tsvia Commander - Add tests in
tests/commands/<domain>.test.tsandtests/actions/<action>.test.ts
commander- CLI frameworkgenlayer-js- GenLayer SDK for blockchain interactionsethers- Wallet/keystore encryptiondockerode- Docker management for localnetviem- Ethereum utilities
@/*→./src/*@@/tests/*→./tests/*