- Node.js >= 20.18.0
- Terminal with 256-color support (iTerm2, Kitty, Windows Terminal, or any xterm-compatible terminal)
- Optional: glow for rich markdown rendering (
brew install glowon macOS)
npm install -g @emblemvault/agentwalletgit clone https://github.com/EmblemCompany/EmblemAi-cli.git
cd EmblemAi-AgentWallet-Plugins/cli
npm install
npm link # makes `emblemai` available globallyEmblemAI v3 supports two authentication modes: browser auth for interactive use and password auth for agent/scripted use.
When you run emblemai without -p, the CLI:
- Resolves the active profile from
--profile,~/.emblemai/active-profile, ordefault - Checks
~/.emblemai/profiles/<profile>/session.jsonfor a saved session - If a valid (non-expired) session exists, restores it instantly -- no login needed
- If no session, starts a local server on
127.0.0.1:18247and opens your browser - You authenticate via the EmblemVault auth modal in the browser
- The session JWT is captured, saved to disk, and the CLI proceeds
- If the browser can't open, the URL is printed for manual copy-paste
- If authentication times out (5 minutes), falls back to a password prompt
Login and signup are the same action -- the first use of a password creates a vault, and subsequent uses of the same password return the same vault.
Password auth is a core feature for agent workflows because it gives repeatable wallet access without requiring browser auth each time.
- Minimum 16 characters
- No recovery if lost (treat it like a private key)
- Different passwords produce completely different wallets and identities
- If the CLI auto-generates a password for agent mode, back it up after first wallet creation
| Method | How to use | Priority |
|---|---|---|
| CLI argument | emblemai -p "your-password-16-chars-min" |
1 (highest, stored encrypted) |
| Environment variable | export EMBLEM_PASSWORD="your-password" |
2 (not stored) |
| Encrypted credential | dotenvx-encrypted ~/.emblemai/profiles/<profile>/.env |
3 |
| Auto-generate (agent mode) | Automatic on first run | 4 |
| Interactive prompt | Fallback when browser auth fails | 5 (lowest) |
In agent mode, if no password is found from sources 1-3, a secure random password is auto-generated and stored encrypted. This means agent mode works out of the box with no manual password setup.
- Browser auth: session JWT is received from browser and hydrated into the SDK
Password auth: password is sent to
EmblemAuthSDK.authenticatePassword() - A deterministic vault is derived -- same credentials always yield the same vault
- The session provides wallet addresses across multiple chains: Solana, Ethereum, Base, BSC, Polygon, Hedera, Bitcoin
HustleIncognitoClientis initialized with the session- Plugins are loaded and registered with the client
Readline-based interactive mode with streaming, glow rendering, and slash commands.
emblemai # Browser auth (recommended)
emblemai --profile treasury
emblemai -p "your-password" # Password auth (skips browser)Single-shot queries for scripts and AI agent integrations. Sends one message, prints the response, and exits. Always uses password auth.
If more than one profile exists in $HOME/.emblemai, every agent-mode invocation must include --profile <name>. Agent mode never guesses which wallet identity to use.
emblemai --agent -p "your-password" -m "What are my wallet addresses?"
emblemai -a -p "your-password" -m "Show all my balances"
emblemai --profile treasury --agent -m "Show my balances"emblemai --resetFrom the /auth menu (option 8), select Backup Agent Auth to export your credentials to a JSON file. This file contains your EmblemVault password -- keep it secure.
If you are using password auth, especially auto-generated password auth in agent mode, this backup should be treated as part of initial setup rather than an optional cleanup step.
emblemai --restore-auth ~/emblemai-auth-backup.jsonThis restores the credential files into the resolved active profile. If you pass --profile <name>, restore writes into that profile and creates it first when needed.
| Flag | Alias | Description |
|---|---|---|
--password <pw> |
-p |
Authentication password (16+ chars) -- skips browser auth |
--profile <name> |
Select a named wallet profile for this invocation. Required in agent mode when more than one profile exists. | |
--message <msg> |
-m |
Message for agent mode |
--agent |
-a |
Run in agent mode (single-shot, password auth only) |
--restore-auth <path> |
Restore credentials from backup file and exit | |
--reset |
Clear conversation history and exit | |
--debug |
Start with debug mode enabled | |
--stream |
Start with streaming enabled (default: on) | |
--log |
Enable stream logging | |
--log-file <path> |
Override log file path (default: ~/.emblemai-stream.log) |
|
--hustle-url <url> |
Override Hustle API URL | |
--auth-url <url> |
Override auth service URL | |
--api-url <url> |
Override API service URL |
| Variable | Description |
|---|---|
EMBLEM_PASSWORD |
Authentication password |
HUSTLE_API_URL |
Override Hustle API endpoint |
EMBLEM_AUTH_URL |
Override auth service endpoint |
EMBLEM_API_URL |
Override API service endpoint |
ELIZA_URL |
ElizaOS agent URL for inverse discovery (default: http://localhost:3000) |
ELIZA_API_URL |
Override ElizaOS API URL |
CLI arguments override environment variables when both are provided.
- Install:
npm install -g @emblemvault/agentwallet - Run:
emblemai - Authenticate in the browser (or enter a password if prompted)
- Check
/pluginsto see which plugins loaded - Type
/helpto see all commands - Try: "What are my wallet addresses?" to verify authentication
| File | Purpose |
|---|---|
~/.emblemai/active-profile |
Persisted active profile name |
~/.emblemai/profiles/<profile>/.env |
dotenvx-encrypted credentials (EMBLEM_PASSWORD) |
~/.emblemai/profiles/<profile>/.env.keys |
dotenvx private decryption key (chmod 600) |
~/.emblemai/profiles/<profile>/secrets.json |
auth-sdk encrypted plugin secrets |
~/.emblemai/profiles/<profile>/session.json |
Saved browser auth session (auto-managed) |
~/.emblemai/profiles/<profile>/history/{vaultId}.json |
Conversation history (per vault) |
~/.emblemai/profiles/<profile>/x402-favorites.json |
Saved x402 favorite services |
~/.emblemai-stream.log |
Stream log (when enabled) |
~/.emblemai/profiles/<profile>/plugins.json |
Custom plugin definitions |
Legacy credentials (~/.emblem-vault) are automatically migrated to the new dotenvx-encrypted format on first run. The old file is backed up to ~/.emblem-vault.bak.
Solana, Ethereum, Base, BSC, Polygon, Hedera, Bitcoin
| Issue | Solution |
|---|---|
| "Password must be at least 16 characters" | Use a longer password |
| "Authentication failed" | Check network connectivity to auth service |
| Browser doesn't open for auth | Copy the printed URL and open it manually |
| Session expired | Run emblemai again -- it will open the browser for a fresh login |
| glow not rendering | Install glow: brew install glow (optional, falls back to plain text) |
| Plugin not loading | Check that the npm package is installed |
| MASQ not responding on :3001 | Check ElizaOS plugin loaded via /plugins |