A command-line interface for AI chat powered by Echo with support for API keys, WalletConnect, and self-custodied local wallets.
- Triple Authentication Options:
- Echo API keys for managed accounts
- WalletConnect for mobile wallet integration
- Local Wallet for full self-custody (NEW!)
- Multi-Model Support: GPT-4o, GPT-5, GPT-5 Mini, GPT-5 Nano
- X402 Protocol: Pay-per-use with crypto wallets via the X402 payment protocol
- Conversation Management: Resume previous conversations and export chat history
- Secure Storage: OS keychain integration for credential and private key storage
- Real-time Balance Tracking: Check USDC balance and usage in real-time
- Multi-Chain Support: Base, Ethereum, Optimism, Polygon, Arbitrum
- Node.js 18.0.0 or higher
- pnpm 10.0.0 or higher
- An Echo account (sign up at echo.merit.systems)
Clone the repository and install dependencies:
git clone https://github.com/Merit-Systems/echo.git
cd echo/templates/echo-cli
pnpm install
pnpm buildTo use echodex globally:
pnpm link --globalOr use it directly:
pnpm start-
Authenticate
echodex login
Choose your authentication method:
- Echo API Key: Browser-based API key creation
- WalletConnect: Mobile wallet via QR code
- Local Wallet: Generate and self-custody your own wallet (NEW!)
-
Start chatting
echodex
-
Select a model (optional)
echodex model
echodex login # Authenticate with Echo (API key or wallet)
echodex logout # Sign out and clear credentialsechodex # Start a new chat session
echodex resume # Resume your last conversationechodex model # Select a different AI modelechodex history # View your conversation history
echodex export # Export conversations as JSON
echodex clear-history # Clear all conversation historyechodex profile # View your profile and balanceechodex wallet-balance # Show USDC balance
echodex wallet-address # Display wallet address and QR code
echodex fund-wallet # Show QR code and wait for USDC deposit
echodex export-private-key # Export private key for backup (⚠️ SENSITIVE)Managed account with web-based API key creation:
- Run
echodex loginand select "Echo API Key" - Your browser opens to echo.merit.systems
- Sign in and create an API key
- The key is securely stored in your OS keychain
- Pay for AI usage via Echo's account system
Connect your mobile wallet via WalletConnect:
- Run
echodex loginand select "WalletConnect" - Scan the QR code with your mobile wallet (MetaMask, Rainbow, etc.)
- Approve the connection
- Fund your wallet with USDC on supported chains
- Pay for AI usage directly from your wallet via X402
Generate and manage your own wallet locally:
- Run
echodex loginand select "Local Wallet (Self Custody)" - Select your preferred blockchain (Ethereum, Base, Optimism, Polygon, Arbitrum)
- Your private key is generated and stored securely in your OS keychain
- A QR code is displayed to fund your wallet with USDC
- Scan with any wallet and send USDC to your generated address
- The CLI waits for confirmation or press Ctrl+C to continue later
- Use
echodex wallet-balanceto check your balance anytime - Use
echodex fund-walletto fund later if needed
Security Features:
- ✅ Private keys stored in OS keychain (macOS Keychain, Windows Credential Vault, Linux Secret Service)
- ✅ You have full custody of your keys
- ✅ Backup your key with
echodex export-private-key - ✅ Keys are deleted from keychain on logout
- ✅ No central authority controls your funds
Supported Networks:
- Ethereum Mainnet (chainId 1)
- Base (chainId 8453)
- Optimism (chainId 10)
- Polygon (chainId 137)
- Arbitrum (chainId 42161)
Before running the CLI, update the configuration in src/constants.ts:
-
Echo App ID:
- Visit echo.merit.systems
- Create or retrieve your Echo App ID
- Replace
YOUR_ECHO_APP_IDinsrc/constants.ts
-
WalletConnect Project ID:
- Visit walletconnect.com
- Create a new project and get your Project ID
- Replace
YOUR_WALLETCONNECT_PROJECT_IDinsrc/constants.ts
After updating these values, rebuild the project:
pnpm buildConfiguration is stored in:
- Credentials: OS keychain (secure)
- Settings:
~/.config/echodex/(platform-specific)
- GPT-4o
- GPT-5
- GPT-5 Mini
- GPT-5 Nano
Switch models anytime with echodex model.
- TypeScript: ESNext with strict mode
- Echo SDK: TypeScript SDK for Echo integration
- Vercel AI SDK: Streaming AI responses
- WalletConnect: Crypto wallet authentication
- X402 Protocol: Decentralized payment protocol
- Keytar: Secure credential storage
- Conf: Configuration management
- Zod: Runtime validation
- Commander: CLI framework
- Clack Prompts: Interactive CLI prompts
pnpm devpnpm buildsrc/
├── auth/ # Authentication logic (API key, WalletConnect, Local Wallet)
│ ├── login.ts # Echo API key login
│ ├── wallet.ts # WalletConnect login
│ ├── local-wallet.ts # Local wallet initialization
│ └── providers.ts # AI provider setup
├── config/ # Configuration, models, and constants
├── core/ # Core features (chat, history, profile)
│ └── local-wallet.ts # Wallet management commands
├── utils/ # Utility functions
│ ├── signer.ts # Wallet client creation
│ └── local-wallet.ts # Wallet utilities & balance queries
├── validation/ # Zod schemas and validators
└── index.ts # CLI entry point
macOS:
- Grant Terminal/iTerm2 access in System Preferences → Privacy & Security
Linux:
- Ensure Secret Service is running:
systemctl --user status secrets-service - Install if needed:
sudo apt-get install gnome-keyring
Windows:
- Credential Manager should work automatically
Private Key Not Found:
- Run
echodex logoutthenechodex loginagain - Your private key should be stored in OS keychain
- If issues persist, check keychain/credential vault settings
Balance Not Showing:
- Ensure USDC is sent on the correct network (shown on wallet address screen)
- Allow 10-30 seconds for blockchain confirmation
- Run
echodex wallet-balanceto force a refresh - Check your address on a block explorer (e.g., Etherscan for Ethereum)
Deposit Not Being Detected:
- Verify the USDC token address matches your network
- Wait for block confirmation (usually 12-15 seconds)
- Try
echodex fund-walletagain to continue monitoring - Use block explorer to verify transaction completed
If WalletConnect fails:
- Ensure you have a stable internet connection
- Try regenerating the QR code
- Check that your wallet supports WalletConnect v2
If your balance isn't updating:
- Run
echodex profileto refresh - Ensure you're authenticated (run
echodex loginagain if needed)
Lost or Compromised Key:
- Immediately run
echodex logout(deletes local key) - Create a new wallet:
echodex login→ select "Local Wallet (Self Custody)" - Transfer remaining USDC from old address to new address (if needed)
- Never reuse compromised private keys
- Documentation: echo.merit.systems/docs
- Platform: echo.merit.systems
- GitHub: github.com/Merit-Systems/echo
- Discord: discord.gg/merit
See CONTRIBUTING.md for contribution guidelines.
MIT
Built with ❤️ by Merit Systems