A command-line interface for executing transactions using Bako predicates on the Fuel network without requiring a server.
Bako Vault CLI provides a serverless alternative to interact with BakoSafe vaults. It allows you to:
- Create and manage multi-signature transactions
- Sign transactions using Fuel private keys
- Send transactions directly to the Fuel network
- Check wallet balances across multiple networks
# Clone the repository
git clone https://github.com/guimroque/bako-vault-cli.git
cd bako-vault-cli
# Install dependencies
npm install
# Build the project
npm run build
# Link globally (optional)
npm linkCreate a network configuration file in networks/testnet.json:
{
"url": "https://testnet.fuel.network/v1/graphql",
"explorerUrl": "https://app-testnet.fuel.network",
"assets": {
"ETH": "0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07",
"USDC": "0x..."
}
}Option A: Export from BakoSafe UI (Recommended)
- Open BakoSafe
- Navigate to your vault → Settings
- Click Export Wallet
- Save the file to
wallets/<name>.json
Option B: Create manually
Create a wallet configuration file in wallets/my-vault.json:
{
"config": {
"SIGNATURES_COUNT": 1,
"SIGNERS": [
"0xYourSignerAddressHere..."
],
"HASH_PREDICATE": "0x..."
},
"version": "0x..."
}# Create a transaction
npm run dev -- create-tx -w my-vault -n testnet -t 0xRecipientAddress -a 0.001
# Sign and send
npm run dev -- sign -p 0xYourPrivateKey| Command | Alias | Description |
|---|---|---|
list-wallets |
ls |
List all configured wallets |
list-networks |
networks |
List all configured networks |
wallet-info |
info |
Show wallet details |
create-tx |
create |
Create a transaction |
send-tx |
send |
Send a pending transaction |
sign |
- | Sign a pending transaction |
balances |
bal |
List all wallet balances |
- Architecture - System design and components
- Configuration - Wallet and network setup
- Commands - Complete command reference
- Transaction Flow - How transactions work
- Integration - Integration with BakoSafe SDK
- Create Transaction: Generates a transaction hash that needs to be signed
- Sign: Signs the hash using a Fuel private key
- Send: Submits the signed transaction to the network
The CLI uses the BakoSafe SDK to interact with predicate-based vaults, enabling multi-signature wallet functionality without a centralized server.
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ create-tx │────▶│ sign │────▶│ encode │────▶│ send │
│ │ │ (N times) │ │ witnesses │ │ │
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
The amount is specified as a decimal string:
0.001= 0.001 ETH1= 1 ETH0.000001= 0.000001 ETH
bako-vault-cli/
├── src/
│ ├── index.ts # CLI entry point
│ ├── types.ts # TypeScript type definitions
│ ├── commands/ # CLI command implementations
│ ├── services/ # Business logic layer
│ └── utils/ # Utility functions
├── wallets/ # Wallet configuration files
├── networks/ # Network configuration files
├── docs/ # Documentation
└── package.json
- Node.js 20+
- npm or yarn
- A Fuel wallet with funds
# Run in development mode
npm run dev -- <command>
# Build
npm run build
# Type check
npm run typecheck- Private Keys: Never stored - only used temporarily for signing
- Wallet Files: Contain only public addresses (safe to commit)
- Pending Transactions: Stored locally in
.pending-tx.json - No Server Dependency: Transactions go directly to the blockchain
Verify the file exists in wallets/<name>.json.
Verify the file exists in networks/<name>.json.
The vault needs sufficient balance for the value + gas.
Ensure:
- The signer address is in the SIGNERS list
- The signature was made on the correct hash
- The signature format is correct (0x...)
MIT
- BakoSafe - The SDK this CLI is built on
- Fuel Network - The underlying blockchain