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
The CLI package is not yet published to npm. For now, 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 | Arbitrum RPC endpoint |
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.7n7d.com",
"rpcUrl": "https://arb1.arbitrum.io/rpc",
"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 all 9 commands
- SDK Overview — Use the SDK programmatically