CLI Getting Started
The 7n7d CLI lets you interact with the 7N7D protocol from your terminal — check vault status, manage positions, stake tokens, and chat with the AI agent.
Installation
npm install -g @7n7d/cli
note
0.2.0 is the first version published to npm. If npm install returns a 404, it is not published yet; build from source:
git clone https://github.com/byennen-team/7N7D.git
cd 7N7D
npm install
npm run build -w packages/cli
npm link -w packages/cli
Configuration
The CLI needs an API key and (optionally) a private key for on-chain transactions.
Environment Variables
| Variable | Required | Description |
|---|---|---|
SEVEN_N_SEVEN_D_API_KEY | Yes | API key for the 7N7D API |
SEVEN_N_SEVEN_D_API_URL | No | Custom API URL (defaults to production) |
SEVEN_N_SEVEN_D_RPC_URL | No | RPC endpoint for the network's chain (testnet: Ethereum Sepolia, default https://ethereum-sepolia-rpc.publicnode.com) |
SEVEN_N_SEVEN_D_PRIVATE_KEY | For transactions | Wallet private key |
SEVEN_N_SEVEN_D_NETWORK | No | testnet or mainnet (default: testnet) |
Config File
Alternatively, create ~/.7n7d/config.json:
{
"apiKey": "your-api-key",
"apiUrl": "https://api-testnet.7n7d.com",
"rpcUrl": "https://ethereum-sepolia-rpc.publicnode.com",
"privateKey": "0x...",
"network": "testnet"
}
Environment variables take precedence over the config file.
Quick Start
# Check vault and agent status
7n7d status
# View open trading positions
7n7d positions
# Check balances for an address
7n7d balance 0xYourAddress
# Chat with the AI agent
7n7d chat "What's your current strategy?"
All commands support --json for machine-readable output.
Next Steps
- Commands Reference — Full reference for every command
- SDK Overview — Use the SDK programmatically