From 870de95cc051746a82487ab2aa95bc9e1415cfb4 Mon Sep 17 00:00:00 2001 From: sidrisov Date: Sat, 7 Feb 2026 01:25:26 +0400 Subject: [PATCH 1/7] Migrate skills from bash scripts to Bankr CLI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove bankr/scripts/ (curl-based submit/poll/cancel) — replaced by `bankr prompt`, `bankr status`, `bankr cancel` CLI commands - Update 8 scripts across endaoment, ens-primary-name, erc-8004, and veil to use `bankr prompt` instead of hardcoded script paths - Expand SKILL.md LLM Gateway section with model table, credits, OpenClaw setup, and Anthropic API mode --- README.md | 16 +- bankr/SKILL.md | 305 ++++++++++++++++++------ bankr/references/api-workflow.md | 29 +++ bankr/references/error-handling.md | 78 +++--- bankr/scripts/bankr-cancel.sh | 44 ---- bankr/scripts/bankr-status.sh | 43 ---- bankr/scripts/bankr-submit.sh | 50 ---- bankr/scripts/bankr.sh | 75 ------ endaoment/scripts/donate.sh | 15 +- ens-primary-name/SKILL.md | 34 +-- ens-primary-name/scripts/set-avatar.sh | 32 +-- ens-primary-name/scripts/set-primary.sh | 31 +-- erc-8004/scripts/bridge-to-mainnet.sh | 8 +- erc-8004/scripts/register-http.sh | 8 +- erc-8004/scripts/register-onchain.sh | 8 +- erc-8004/scripts/register.sh | 8 +- erc-8004/scripts/update-profile.sh | 8 +- veil/scripts/_common.sh | 26 +- veil/scripts/veil-bankr-prompt.sh | 11 +- 19 files changed, 402 insertions(+), 427 deletions(-) delete mode 100755 bankr/scripts/bankr-cancel.sh delete mode 100755 bankr/scripts/bankr-status.sh delete mode 100755 bankr/scripts/bankr-submit.sh delete mode 100755 bankr/scripts/bankr.sh diff --git a/README.md b/README.md index a61c8a95..3611c004 100644 --- a/README.md +++ b/README.md @@ -10,15 +10,13 @@ Each top-level directory is a provider. Each subdirectory within a provider is a moltbot-skills/ ├── bankr/ │ ├── SKILL.md -│ ├── references/ -│ │ ├── token-trading.md -│ │ ├── leverage-trading.md -│ │ ├── polymarket.md -│ │ ├── automation.md -│ │ ├── token-deployment.md -│ │ └── ... -│ └── scripts/ -│ └── bankr.sh +│ └── references/ +│ ├── token-trading.md +│ ├── leverage-trading.md +│ ├── polymarket.md +│ ├── automation.md +│ ├── token-deployment.md +│ └── ... │ ├── base/ # Base (placeholder) │ └── SKILL.md diff --git a/bankr/SKILL.md b/bankr/SKILL.md index 88b52a67..d952a368 100644 --- a/bankr/SKILL.md +++ b/bankr/SKILL.md @@ -7,62 +7,105 @@ metadata: { "emoji": "📺", "homepage": "https://bankr.bot", - "requires": { "bins": ["curl", "jq"] }, + "requires": { "bins": ["bankr"] }, }, } --- # Bankr -Execute crypto trading and DeFi operations using natural language through Bankr's AI agent API. +Execute crypto trading and DeFi operations using natural language through the Bankr CLI. -## Quick Start +## Requirements -### First-Time Setup +Install the Bankr CLI: -There are two ways to get started: +```bash +bun install -g @bankr/cli +``` -#### Option A: User provides an existing API key +Or with npm: -If the user already has a Bankr API key, they can provide it directly: +```bash +npm install -g @bankr/cli +``` + +## Quick Start + +### First-Time Setup ```bash -mkdir -p ~/.clawdbot/skills/bankr -cat > ~/.clawdbot/skills/bankr/config.json << 'EOF' -{ - "apiKey": "bk_YOUR_KEY_HERE", - "apiUrl": "https://api.bankr.bot" -} -EOF +# Authenticate with Bankr (creates account if needed) +bankr login + +# Verify your identity +bankr whoami ``` -API keys can be created and managed at [bankr.bot/api](https://bankr.bot/api). The key must have **Agent API** access enabled. +The `bankr login` command gives you two options: + +#### Option A: Open the Bankr dashboard (recommended for new users) + +The CLI opens [bankr.bot/api](https://bankr.bot/api) in your browser where you: + +1. **Sign up / Sign in** — Enter your email and the one-time passcode (OTP) sent to it +2. **Generate an API key** — Create a key with **Agent API** access enabled +3. **Paste the key** — Copy the `bk_...` key back into the CLI prompt -#### Option B: Create a new account (guided by Clawd) +Creating a new account automatically provisions **EVM wallets** (Base, Ethereum, Polygon, Unichain) and a **Solana wallet** — no manual wallet setup needed. -Clawd can walk the user through the full signup flow: +#### Option B: Paste an existing API key -1. **Sign up / Sign in** — User provides their email address. Bankr sends a one-time passcode (OTP) to that email. Creating a new account automatically provisions **EVM wallets** (Base, Ethereum, Polygon, Unichain) and a **Solana wallet** — no manual wallet setup needed. -2. **Enter OTP** — User checks their email and provides the OTP code. -3. **Generate API key** — Once authenticated, navigate to [bankr.bot/api](https://bankr.bot/api) to create an API key with **Agent API** access enabled. -4. **Configure** — Save the key (starts with `bk_`) to config: +If you already have an API key, select "Paste an existing Bankr API key" and enter it directly. You can also set it without the interactive flow: ```bash -mkdir -p ~/.clawdbot/skills/bankr -cat > ~/.clawdbot/skills/bankr/config.json << 'EOF' -{ - "apiKey": "bk_YOUR_KEY_HERE", - "apiUrl": "https://api.bankr.bot" -} -EOF +bankr config set apiKey bk_YOUR_KEY_HERE ``` -#### Verify Setup +### Verify Setup ```bash -scripts/bankr.sh "What is my balance?" +bankr whoami +bankr prompt "What is my balance?" ``` +## CLI Command Reference + +### Core Commands + +| Command | Description | +|---------|-------------| +| `bankr login` | Authenticate with the Bankr API | +| `bankr logout` | Clear stored credentials | +| `bankr whoami` | Show current authentication info | +| `bankr prompt ` | Send a prompt to the Bankr AI agent | +| `bankr status ` | Check the status of a running job | +| `bankr cancel ` | Cancel a running job | +| `bankr skills` | Show all Bankr AI agent skills with examples | + +### Configuration Commands + +| Command | Description | +|---------|-------------| +| `bankr config get [key]` | Get config value(s) | +| `bankr config set ` | Set a config value | +| `bankr --config ` | Use a custom config file path | + +Valid config keys: `apiKey`, `apiUrl`, `llmUrl` + +Default config location: `~/.bankr/config.json`. Override with `--config` or `BANKR_CONFIG` env var. + +### LLM Gateway Commands + +| Command | Description | +|---------|-------------| +| `bankr llm models` | List available LLM models | +| `bankr llm setup openclaw [--install]` | Generate or install OpenClaw config | +| `bankr llm setup opencode [--install]` | Generate or install OpenCode config | +| `bankr llm setup claude` | Show Claude Code environment setup | +| `bankr llm setup cursor` | Show Cursor IDE setup instructions | +| `bankr llm claude [args...]` | Launch Claude Code via the Bankr LLM Gateway | + ## Core Usage ### Simple Query @@ -70,11 +113,28 @@ scripts/bankr.sh "What is my balance?" For straightforward requests that complete quickly: ```bash -scripts/bankr.sh "What is my ETH balance?" -scripts/bankr.sh "What's the price of Bitcoin?" +bankr prompt "What is my ETH balance?" +bankr prompt "What's the price of Bitcoin?" ``` -The main script handles the full submit-poll-complete workflow automatically. +The CLI handles the full submit-poll-complete workflow automatically. You can also use the shorthand — any unrecognized command is treated as a prompt: + +```bash +bankr What is the price of ETH? +``` + +### Interactive Prompt + +For prompts containing `$` or special characters that the shell would expand: + +```bash +# Interactive mode — no shell expansion issues +bankr prompt +# Then type: Buy $50 of ETH on Base + +# Or pipe input +echo 'Buy $50 of ETH on Base' | bankr prompt +``` ### Manual Job Control @@ -82,13 +142,110 @@ For advanced use or long-running operations: ```bash # Submit and get job ID -JOB_ID=$(scripts/bankr-submit.sh "Buy $100 of ETH" | jq -r '.jobId') +bankr prompt "Buy $100 of ETH" +# → Job submitted: job_abc123 -# Poll for status -scripts/bankr-status.sh "$JOB_ID" +# Check status of a specific job +bankr status job_abc123 # Cancel if needed -scripts/bankr-cancel.sh "$JOB_ID" +bankr cancel job_abc123 +``` + +## LLM Gateway + +The [Bankr LLM Gateway](https://docs.bankr.bot/llm-gateway/overview) is a unified API for Claude, Gemini, GPT, and other models. It provides: + +- **Multi-provider access** — Anthropic, Google, OpenAI, Moonshot AI, and Alibaba through one API +- **Cost tracking** — Full visibility into token usage and costs per request +- **High availability** — Automatic failover between Vertex AI and OpenRouter +- **SDK compatible** — Works with OpenAI and Anthropic SDKs, no code changes needed + +**Base URL:** `https://llm.bankr.bot/v1` + +### Available Models + +| Model | Provider | Best For | +|-------|----------|----------| +| `claude-opus-4.6` | Anthropic | Most capable, advanced reasoning | +| `claude-sonnet-4.5` | Anthropic | Balanced speed and quality | +| `claude-haiku-4.5` | Anthropic | Fast, cost-effective | +| `gemini-3-pro` | Google | Long context (2M tokens) | +| `gemini-3-flash` | Google | High throughput | +| `gemini-2.5-pro` | Google | Long context, multimodal | +| `gemini-2.5-flash` | Google | Speed, high throughput | +| `gpt-5.2` | OpenAI | Advanced reasoning | +| `gpt-5.2-codex` | OpenAI | Code generation | +| `gpt-5-mini` | OpenAI | Fast, economical | +| `gpt-5-nano` | OpenAI | Ultra-fast, lowest cost | +| `kimi-k2.5` | Moonshot AI | Long-context reasoning | +| `qwen3-coder` | Alibaba | Code generation, debugging | + +```bash +# Fetch live model list from the gateway +bankr llm models +``` + +### Credits + +```bash +# Check your LLM gateway credit balance +bankr llm credits +``` + +### OpenClaw Setup + +The fastest way to connect OpenClaw to the gateway: + +```bash +# Auto-install Bankr provider into ~/.openclaw/openclaw.json +bankr llm setup openclaw --install +``` + +This writes the full provider config (base URL, API key, all models) into your OpenClaw config. To preview without writing: + +```bash +bankr llm setup openclaw +``` + +To use a Bankr model as your default in OpenClaw, add to `openclaw.json`: + +```json +{ + "agents": { + "defaults": { + "model": { + "primary": "bankr/claude-sonnet-4.5" + } + } + } +} +``` + +The gateway also supports the Anthropic Messages API format. Change the `api` field in the provider config from `"openai-completions"` to `"anthropic-messages"` for Claude-native features like extended thinking. + +### Claude Code + +```bash +# Print env vars to add to your shell profile +bankr llm setup claude + +# Or launch Claude Code directly through the gateway +bankr llm claude +``` + +### OpenCode + +```bash +# Auto-install Bankr provider into ~/.config/opencode/opencode.json +bankr llm setup opencode --install +``` + +### Cursor + +```bash +# Get step-by-step instructions with your API key +bankr llm setup cursor ``` ## Capabilities Overview @@ -212,63 +369,65 @@ scripts/bankr-cancel.sh "$JOB_ID" ```bash # Check balance -scripts/bankr.sh "What is my ETH balance on Base?" +bankr prompt "What is my ETH balance on Base?" # Check price -scripts/bankr.sh "What's the current price of PEPE?" +bankr prompt "What's the current price of PEPE?" # Then trade -scripts/bankr.sh "Buy $20 of PEPE on Base" +bankr prompt "Buy $20 of PEPE on Base" ``` ### Portfolio Review ```bash # Full portfolio -scripts/bankr.sh "Show my complete portfolio" +bankr prompt "Show my complete portfolio" # Chain-specific -scripts/bankr.sh "What tokens do I have on Base?" +bankr prompt "What tokens do I have on Base?" # Token-specific -scripts/bankr.sh "Show my ETH across all chains" +bankr prompt "Show my ETH across all chains" ``` ### Set Up Automation ```bash # DCA strategy -scripts/bankr.sh "DCA $100 into ETH every week" +bankr prompt "DCA $100 into ETH every week" # Stop loss protection -scripts/bankr.sh "Set stop loss for my ETH at $2,500" +bankr prompt "Set stop loss for my ETH at $2,500" # Limit order -scripts/bankr.sh "Buy ETH if price drops to $3,000" +bankr prompt "Buy ETH if price drops to $3,000" ``` ### Market Research ```bash # Price and analysis -scripts/bankr.sh "Do technical analysis on ETH" +bankr prompt "Do technical analysis on ETH" # Trending tokens -scripts/bankr.sh "What tokens are trending on Base?" +bankr prompt "What tokens are trending on Base?" # Compare tokens -scripts/bankr.sh "Compare ETH vs SOL" +bankr prompt "Compare ETH vs SOL" ``` ## API Workflow Bankr uses an asynchronous job-based API: -1. **Submit** - Send prompt, get job ID -2. **Poll** - Check status every 2 seconds -3. **Complete** - Process results when done +1. **Submit** — Send prompt, get job ID +2. **Poll** — Check status every 2 seconds +3. **Complete** — Process results when done + +The `bankr prompt` command handles this automatically. For manual job control, use `bankr status ` and `bankr cancel `. -The `bankr.sh` wrapper handles this automatically. For details on the API structure, job states, polling strategy, and error handling, see: +For details on the API structure, job states, polling strategy, and error handling, see: **Reference**: [references/api-workflow.md](references/api-workflow.md) @@ -276,7 +435,7 @@ The `bankr.sh` wrapper handles this automatically. For details on the API struct Common issues and fixes: -- **Authentication errors** → Check API key setup +- **Authentication errors** → Run `bankr login` or check `bankr whoami` - **Insufficient balance** → Add funds or reduce amount - **Token not found** → Verify symbol and chain - **Transaction reverted** → Check parameters and balances @@ -410,21 +569,33 @@ For comprehensive error troubleshooting, setup instructions, and debugging steps ## Resources -- **Agent API Reference**: https://www.notion.so/Agent-API-2e18e0f9661f80cb83ccfc046f8872e3 +- **Documentation**: https://docs.bankr.bot +- **LLM Gateway Docs**: https://docs.bankr.bot/llm-gateway/overview - **API Key Management**: https://bankr.bot/api - **Terminal**: https://bankr.bot/terminal +- **CLI Package**: https://www.npmjs.com/package/@bankr/cli - **Twitter**: @bankr_bot ## Troubleshooting -### Scripts Not Working +### CLI Not Found + +```bash +# Verify installation +which bankr + +# Reinstall if needed +bun install -g @bankr/cli +``` + +### Authentication Issues ```bash -# Ensure scripts are executable -chmod +x ~/.clawdbot/skills/bankr/scripts/*.sh +# Check current auth +bankr whoami -# Test connectivity -curl -I https://api.bankr.bot +# Re-authenticate +bankr login ``` ### API Errors @@ -433,15 +604,15 @@ See [references/error-handling.md](references/error-handling.md) for comprehensi ### Getting Help -1. Check error message in response JSON -2. Consult relevant reference document -3. Verify configuration and connectivity -4. Test with simple queries first +1. Check error message in CLI output +2. Run `bankr whoami` to verify auth +3. Consult relevant reference document +4. Test with simple queries first (`bankr prompt "What is my balance?"`) --- -**💡 Pro Tip**: The most common issue is not specifying the chain for tokens. When in doubt, always include "on Base" or "on Ethereum" in your prompt. +**Pro Tip**: The most common issue is not specifying the chain for tokens. When in doubt, always include "on Base" or "on Ethereum" in your prompt. -**⚠️ Security**: Keep your API key private. Never commit config.json to version control. Only trade amounts you can afford to lose. +**Security**: Keep your API key private. Never commit your config file to version control. Only trade amounts you can afford to lose. -**🚀 Quick Win**: Start by checking your portfolio to see what's possible, then try a small $5-10 trade on Base to get familiar with the flow. +**Quick Win**: Start by checking your portfolio (`bankr prompt "Show my portfolio"`) to see what's possible, then try a small $5-10 trade on Base to get familiar with the flow. diff --git a/bankr/references/api-workflow.md b/bankr/references/api-workflow.md index ff42d685..38a4fa47 100644 --- a/bankr/references/api-workflow.md +++ b/bankr/references/api-workflow.md @@ -4,6 +4,29 @@ Understanding the asynchronous job pattern for Bankr API operations. **Source**: [Agent API Reference](https://www.notion.so/Agent-API-2e18e0f9661f80cb83ccfc046f8872e3) +## Using the Bankr CLI (Recommended) + +The Bankr CLI handles the full submit-poll-complete workflow automatically: + +```bash +# Install +bun install -g @bankr/cli + +# Authenticate +bankr login + +# Submit a prompt (handles polling and completion automatically) +bankr prompt "What is my ETH balance?" + +# Check status of a specific job +bankr status + +# Cancel a running job +bankr cancel +``` + +The CLI manages authentication, job polling, status updates, and error handling out of the box. The raw API details below are provided for reference. + ## Core Pattern: Submit-Poll-Complete All Bankr operations follow this pattern: @@ -19,6 +42,8 @@ All Bankr operations follow this pattern: ### POST /agent/prompt Submit a natural language prompt to start a job. +**CLI equivalent:** `bankr prompt "What is my ETH balance?"` + **Request:** ```bash curl -X POST "https://api.bankr.bot/agent/prompt" \ @@ -51,6 +76,8 @@ curl -X POST "https://api.bankr.bot/agent/prompt" \ ### GET /agent/job/{jobId} Check job status and results. +**CLI equivalent:** `bankr status job_abc123` + **Request:** ```bash curl -X GET "https://api.bankr.bot/agent/job/job_abc123" \ @@ -87,6 +114,8 @@ curl -X GET "https://api.bankr.bot/agent/job/job_abc123" \ ### POST /agent/job/{jobId}/cancel Cancel a pending or processing job. Cancel requests are idempotent — cancelling an already-cancelled job returns success. +**CLI equivalent:** `bankr cancel job_abc123` + **Request:** ```bash curl -X POST "https://api.bankr.bot/agent/job/job_abc123/cancel" \ diff --git a/bankr/references/error-handling.md b/bankr/references/error-handling.md index 1f08336a..a88f354a 100644 --- a/bankr/references/error-handling.md +++ b/bankr/references/error-handling.md @@ -11,24 +11,25 @@ Resolve Bankr API errors and common issues. ### Resolution Steps -**1. Get API Key** -Visit https://bankr.bot/api to create a new API key +**1. Install the Bankr CLI** +```bash +bun install -g @bankr/cli +``` + +**2. Authenticate** +```bash +bankr login +``` -**2. Create Configuration** +Or if you already have an API key from https://bankr.bot/api: ```bash -mkdir -p ~/.clawdbot/skills/bankr -cat > ~/.clawdbot/skills/bankr/config.json << 'EOF' -{ - "apiKey": "bk_your_actual_key_here", - "apiUrl": "https://api.bankr.bot" -} -EOF +bankr config set apiKey bk_your_actual_key_here ``` **3. Verify Setup** -Test with a simple command: ```bash -~/.clawdbot/skills/bankr/scripts/bankr.sh "What is my balance?" +bankr whoami +bankr prompt "What is my balance?" ``` ### Common API Key Issues @@ -162,38 +163,35 @@ curl -sf https://api.bankr.bot || echo "Connection failed" ## Configuration Issues -### Config File Not Found +### CLI Not Installed ```bash -# Create config directory -mkdir -p ~/.clawdbot/skills/bankr - -# Create config file -cat > ~/.clawdbot/skills/bankr/config.json << 'EOF' -{ - "apiKey": "bk_your_key_here", - "apiUrl": "https://api.bankr.bot" -} -EOF -``` +# Install the Bankr CLI +bun install -g @bankr/cli -### Invalid JSON -```bash -# Validate JSON -jq . ~/.clawdbot/skills/bankr/config.json +# Or with npm +npm install -g @bankr/cli -# If error, fix formatting +# Verify installation +which bankr ``` -### Missing jq Command +### Not Authenticated ```bash -# macOS -brew install jq +# Authenticate (opens browser for email/OTP flow) +bankr login -# Linux (Debian/Ubuntu) -sudo apt install jq +# Or set API key directly +bankr config set apiKey bk_your_key_here -# Linux (RHEL/CentOS) -sudo yum install jq +# Verify +bankr whoami +``` + +### Config File Location +The CLI stores config at `~/.bankr/config.json`. You can view or update it: +```bash +bankr config get +bankr config set apiKey bk_new_key_here ``` ## User-Friendly Error Messages @@ -260,11 +258,11 @@ Before reporting an issue, check: ### Check Status ```bash -# Test API connectivity -~/.clawdbot/skills/bankr/scripts/bankr.sh "ping" +# Verify authentication +bankr whoami -# Check your balance (validates auth) -~/.clawdbot/skills/bankr/scripts/bankr.sh "What is my balance?" +# Test with a simple query +bankr prompt "What is my balance?" ``` ### Gather Information diff --git a/bankr/scripts/bankr-cancel.sh b/bankr/scripts/bankr-cancel.sh deleted file mode 100755 index 72dcd276..00000000 --- a/bankr/scripts/bankr-cancel.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# Cancel a running Bankr job -# Usage: bankr-cancel.sh - -set -euo pipefail - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -SKILL_DIR="$(dirname "$SCRIPT_DIR")" - -# Find config file -if [ -f "$SKILL_DIR/config.json" ]; then - CONFIG_FILE="$SKILL_DIR/config.json" -elif [ -f "$HOME/.clawdbot/skills/bankr/config.json" ]; then - CONFIG_FILE="$HOME/.clawdbot/skills/bankr/config.json" -else - echo "{\"error\": \"config.json not found\"}" >&2 - exit 1 -fi - -# Extract config -API_KEY=$(jq -r '.apiKey // empty' "$CONFIG_FILE") -API_URL=$(jq -r '.apiUrl // "https://api.bankr.bot"' "$CONFIG_FILE") - -if [ -z "$API_KEY" ]; then - echo "{\"error\": \"apiKey not set in config.json\"}" >&2 - exit 1 -fi - -# Get job ID -JOB_ID="$1" - -if [ -z "$JOB_ID" ]; then - echo "{\"error\": \"Usage: $0 \"}" >&2 - exit 1 -fi - -# Cancel job -curl -sf -X POST "${API_URL}/agent/job/${JOB_ID}/cancel" \ - -H "X-API-Key: ${API_KEY}" \ - -H "Content-Type: application/json" \ - || { - echo "{\"error\": \"Failed to cancel job\"}" >&2 - exit 1 - } diff --git a/bankr/scripts/bankr-status.sh b/bankr/scripts/bankr-status.sh deleted file mode 100755 index 0e6dd27c..00000000 --- a/bankr/scripts/bankr-status.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# Check status of a Bankr job -# Usage: bankr-status.sh - -set -euo pipefail - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -SKILL_DIR="$(dirname "$SCRIPT_DIR")" - -# Find config file -if [ -f "$SKILL_DIR/config.json" ]; then - CONFIG_FILE="$SKILL_DIR/config.json" -elif [ -f "$HOME/.clawdbot/skills/bankr/config.json" ]; then - CONFIG_FILE="$HOME/.clawdbot/skills/bankr/config.json" -else - echo "{\"error\": \"config.json not found\"}" >&2 - exit 1 -fi - -# Extract config -API_KEY=$(jq -r '.apiKey // empty' "$CONFIG_FILE") -API_URL=$(jq -r '.apiUrl // "https://api.bankr.bot"' "$CONFIG_FILE") - -if [ -z "$API_KEY" ]; then - echo "{\"error\": \"apiKey not set in config.json\"}" >&2 - exit 1 -fi - -# Get job ID -JOB_ID="$1" - -if [ -z "$JOB_ID" ]; then - echo "{\"error\": \"Usage: $0 \"}" >&2 - exit 1 -fi - -# Get job status -curl -sf -X GET "${API_URL}/agent/job/${JOB_ID}" \ - -H "X-API-Key: ${API_KEY}" \ - || { - echo "{\"error\": \"Failed to get job status\"}" >&2 - exit 1 - } diff --git a/bankr/scripts/bankr-submit.sh b/bankr/scripts/bankr-submit.sh deleted file mode 100755 index dba5fe38..00000000 --- a/bankr/scripts/bankr-submit.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# Submit a prompt to Bankr Agent API -# Returns job ID for polling - -set -euo pipefail - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -SKILL_DIR="$(dirname "$SCRIPT_DIR")" - -# Find config file -if [ -f "$SKILL_DIR/config.json" ]; then - CONFIG_FILE="$SKILL_DIR/config.json" -elif [ -f "$HOME/.clawdbot/skills/bankr/config.json" ]; then - CONFIG_FILE="$HOME/.clawdbot/skills/bankr/config.json" -else - echo "{\"error\": \"config.json not found. Create it with your API key from https://bankr.bot/api\"}" >&2 - exit 1 -fi - -# Extract config -API_KEY=$(jq -r '.apiKey // empty' "$CONFIG_FILE") -API_URL=$(jq -r '.apiUrl // "https://api.bankr.bot"' "$CONFIG_FILE") - -if [ -z "$API_KEY" ]; then - echo "{\"error\": \"apiKey not set in config.json\"}" >&2 - exit 1 -fi - -# Get prompt from argument -PROMPT="$*" - -if [ -z "$PROMPT" ]; then - echo "{\"error\": \"Usage: $0 \"}" >&2 - exit 1 -fi - -# Submit prompt -curl -sf -X POST "${API_URL}/agent/prompt" \ - -H "X-API-Key: ${API_KEY}" \ - -H "Content-Type: application/json" \ - -d "$(jq -nc --arg prompt "$PROMPT" '{prompt: $prompt}')" \ - || { - STATUS=$? - if [ $STATUS -eq 22 ]; then - echo "{\"error\": \"API request failed. Check your API key at https://bankr.bot/api\"}" >&2 - else - echo "{\"error\": \"Network error. Please check your connection.\"}" >&2 - fi - exit 1 - } diff --git a/bankr/scripts/bankr.sh b/bankr/scripts/bankr.sh deleted file mode 100755 index f01770d3..00000000 --- a/bankr/scripts/bankr.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -# Bankr Agent API wrapper - handles submit-poll-complete workflow -# Usage: bankr.sh - -set -euo pipefail - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -# Submit the prompt -SUBMIT_RESULT=$("$SCRIPT_DIR/bankr-submit.sh" "$@") - -# Check if submission succeeded -if ! echo "$SUBMIT_RESULT" | jq -e '.success == true' >/dev/null 2>&1; then - echo "$SUBMIT_RESULT" | jq -r '.error // "Submission failed"' >&2 - exit 1 -fi - -# Extract job ID -JOB_ID=$(echo "$SUBMIT_RESULT" | jq -r '.jobId') - -if [ -z "$JOB_ID" ] || [ "$JOB_ID" = "null" ]; then - echo "Failed to get job ID" >&2 - exit 1 -fi - -echo "Job submitted: $JOB_ID" >&2 -echo "Polling for results..." >&2 - -# Poll for completion (max 5 minutes) -MAX_ATTEMPTS=150 # 150 * 2s = 5 minutes -ATTEMPT=0 - -while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do - sleep 2 - - STATUS_RESULT=$("$SCRIPT_DIR/bankr-status.sh" "$JOB_ID") - - # Get status - STATUS=$(echo "$STATUS_RESULT" | jq -r '.status') - - case "$STATUS" in - "completed") - echo "✓ Job completed" >&2 - echo "$STATUS_RESULT" - exit 0 - ;; - "failed") - ERROR=$(echo "$STATUS_RESULT" | jq -r '.error // "Unknown error"') - echo "✗ Job failed: $ERROR" >&2 - echo "$STATUS_RESULT" - exit 1 - ;; - "cancelled") - echo "✗ Job was cancelled" >&2 - echo "$STATUS_RESULT" - exit 1 - ;; - "pending"|"processing") - # Show status updates if any - UPDATES=$(echo "$STATUS_RESULT" | jq -r '.statusUpdates[]?.message // empty' 2>/dev/null | tail -1) - if [ -n "$UPDATES" ]; then - echo " → $UPDATES" >&2 - fi - ;; - *) - echo "Unknown status: $STATUS" >&2 - ;; - esac - - ATTEMPT=$((ATTEMPT + 1)) -done - -echo "✗ Job timed out after 5 minutes" >&2 -echo "Job ID: $JOB_ID (you can check status manually)" >&2 -exit 1 diff --git a/endaoment/scripts/donate.sh b/endaoment/scripts/donate.sh index c46833fc..35de7b53 100755 --- a/endaoment/scripts/donate.sh +++ b/endaoment/scripts/donate.sh @@ -6,8 +6,11 @@ set -euo pipefail -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -BANKR_SCRIPT="${BANKR_SCRIPT:-$SCRIPT_DIR/../../bankr/scripts/bankr.sh}" +# Require Bankr CLI +if ! command -v bankr >/dev/null 2>&1; then + echo "Bankr CLI not found. Install with: bun install -g @bankr/cli" >&2 + exit 1 +fi EIN="${1:-}" AMOUNT="${2:-}" @@ -78,7 +81,7 @@ if [[ "$CODE" != "0x" ]] && [[ -n "$CODE" ]]; then echo "📝 Step 1: Approving USDC..." APPROVE_TX="{\"to\": \"$USDC\", \"data\": \"$APPROVE_DATA\", \"value\": \"0\", \"chainId\": $CHAIN_ID}" - APPROVE_RESULT=$("$BANKR_SCRIPT" "Submit this transaction: $APPROVE_TX" 2>&1) + APPROVE_RESULT=$(bankr prompt "Submit this transaction: $APPROVE_TX" 2>&1) if echo "$APPROVE_RESULT" | grep -q "basescan.org/tx"; then APPROVE_HASH=$(echo "$APPROVE_RESULT" | grep -o 'https://basescan.org/tx/[^ "]*' | head -1) echo " ✅ Approved: $APPROVE_HASH" @@ -92,7 +95,7 @@ if [[ "$CODE" != "0x" ]] && [[ -n "$CODE" ]]; then echo "📝 Step 2: Donating..." DONATE_TX="{\"to\": \"$ENTITY_ADDRESS\", \"data\": \"$DONATE_DATA\", \"value\": \"0\", \"chainId\": $CHAIN_ID}" - DONATE_RESULT=$("$BANKR_SCRIPT" "Submit this transaction: $DONATE_TX" 2>&1) + DONATE_RESULT=$(bankr prompt "Submit this transaction: $DONATE_TX" 2>&1) if echo "$DONATE_RESULT" | grep -q "basescan.org/tx"; then DONATE_HASH=$(echo "$DONATE_RESULT" | grep -o 'https://basescan.org/tx/[^ "]*' | head -1) echo " ✅ Donated: $DONATE_HASH" @@ -109,7 +112,7 @@ else echo "📝 Step 1: Approving USDC to factory..." APPROVE_TX="{\"to\": \"$USDC\", \"data\": \"$APPROVE_DATA\", \"value\": \"0\", \"chainId\": $CHAIN_ID}" - APPROVE_RESULT=$("$BANKR_SCRIPT" "Submit this transaction: $APPROVE_TX" 2>&1) + APPROVE_RESULT=$(bankr prompt "Submit this transaction: $APPROVE_TX" 2>&1) if echo "$APPROVE_RESULT" | grep -q "basescan.org/tx"; then APPROVE_HASH=$(echo "$APPROVE_RESULT" | grep -o 'https://basescan.org/tx/[^ "]*' | head -1) echo " ✅ Approved: $APPROVE_HASH" @@ -123,7 +126,7 @@ else echo "📝 Step 2: Deploying & donating..." DEPLOY_TX="{\"to\": \"$FACTORY\", \"data\": \"$DEPLOY_DATA\", \"value\": \"0\", \"chainId\": $CHAIN_ID}" - DEPLOY_RESULT=$("$BANKR_SCRIPT" "Submit this transaction: $DEPLOY_TX" 2>&1) + DEPLOY_RESULT=$(bankr prompt "Submit this transaction: $DEPLOY_TX" 2>&1) if echo "$DEPLOY_RESULT" | grep -q "basescan.org/tx"; then DEPLOY_HASH=$(echo "$DEPLOY_RESULT" | grep -o 'https://basescan.org/tx/[^ "]*' | head -1) echo " ✅ Deployed & Donated: $DEPLOY_HASH" diff --git a/ens-primary-name/SKILL.md b/ens-primary-name/SKILL.md index acfcdedd..ca1ed0ef 100644 --- a/ens-primary-name/SKILL.md +++ b/ens-primary-name/SKILL.md @@ -13,22 +13,20 @@ A primary name creates a bi-directional link: ## Requirements -### Required: Transaction Signing +### Required: Bankr CLI -This skill requires a way to sign and submit transactions. It looks for the **bankr skill** which provides wallet functionality via the Bankr API. +This skill requires the **Bankr CLI** for transaction signing: -**If you don't have bankr installed:** - -1. Install from: https://github.com/BankrBot/openclaw-skills (bankr skill) -2. Or modify the scripts to use your own transaction submission method +```bash +bun install -g @bankr/cli +bankr login +``` -The scripts call bankr.sh with a prompt like: +The scripts use `bankr prompt` to submit transactions like: ``` Submit this transaction: {"to": "0x...", "data": "0x...", "value": "0", "chainId": 8453} ``` -You can replace the `find_bankr()` function in each script with your own wallet/signer. - ### Required: Node.js Scripts use Node.js with `viem` for ENS namehash calculation and ABI encoding. @@ -112,27 +110,13 @@ Output: | "Transaction reverted" | Ensure the ENS name resolves to your address | | "Name not showing" | Forward resolution may not be set for that chain's cointype | | "Not authorized" | You must call from the address the name resolves to | -| "bankr.sh not found" | Install bankr skill or modify scripts to use your signer | +| "Bankr CLI not found" | Install with `bun install -g @bankr/cli && bankr login` | | "Chain-specific address not set" | Set the address for the target chain via app.ens.domains | | "Could not find resolver" | Ensure the ENS name exists and has a resolver set | -## Customization - -### Using a Different Wallet/Signer - -Replace the `find_bankr()` function in the scripts: - -```bash -# Example: use cast (foundry) instead -send_tx() { - local to="$1" data="$2" chain_id="$3" - cast send "$to" --data "$data" --rpc-url "https://..." --private-key "$PRIVATE_KEY" -} -``` - ## Links - ENS Docs: https://docs.ens.domains/web/reverse - ENS App: https://app.ens.domains - Primary Names UI: https://primary.ens.domains -- Bankr Skill: https://github.com/BankrBot/openclaw-skills +- Bankr CLI: https://www.npmjs.com/package/@bankr/cli diff --git a/ens-primary-name/scripts/set-avatar.sh b/ens-primary-name/scripts/set-avatar.sh index 0512c968..d4c3b29b 100755 --- a/ens-primary-name/scripts/set-avatar.sh +++ b/ens-primary-name/scripts/set-avatar.sh @@ -10,36 +10,14 @@ set -e -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ENS_NAME="${1:?Usage: set-avatar.sh }" AVATAR_URL="${2:?Usage: set-avatar.sh }" -# Find bankr.sh in common locations -# Bankr provides wallet/signing via the Bankr API -# If you don't have bankr, modify this function to use your own signer -find_bankr() { - local locations=( - "$SCRIPT_DIR/../../bankr/scripts/bankr.sh" - "$SCRIPT_DIR/../../moltbot-skills/bankr/scripts/bankr.sh" - "$(command -v bankr.sh 2>/dev/null)" - ) - for loc in "${locations[@]}"; do - if [ -x "$loc" ]; then - echo "$loc" - return 0 - fi - done - echo "ERROR: bankr.sh not found." >&2 - echo "" >&2 - echo "This skill requires a transaction signer. Options:" >&2 - echo "1. Install the bankr skill from https://github.com/BankrBot/openclaw-skills" >&2 - echo "2. Modify find_bankr() in this script to use your own wallet/signer" >&2 - echo "" >&2 - echo "The script needs to submit: {to, data, value, chainId} transactions" >&2 +# Require Bankr CLI +if ! command -v bankr >/dev/null 2>&1; then + echo "Bankr CLI not found. Install with: bun install -g @bankr/cli" >&2 exit 1 -} - -BANKR_SH=$(find_bankr) +fi # Avatars are text records stored on L1 RPC_URL="https://eth.publicnode.com" @@ -107,7 +85,7 @@ echo "Submitting to resolver on Ethereum mainnet..." >&2 echo "⚠️ Note: This requires ETH on mainnet for gas" >&2 # Submit transaction via Bankr -RESULT=$("$BANKR_SH" "Submit this transaction: {\"to\": \"$RESOLVER\", \"data\": \"$CALLDATA\", \"value\": \"0\", \"chainId\": $CHAIN_ID}" 2>/dev/null) +RESULT=$(bankr prompt "Submit this transaction: {\"to\": \"$RESOLVER\", \"data\": \"$CALLDATA\", \"value\": \"0\", \"chainId\": $CHAIN_ID}" 2>/dev/null) if echo "$RESULT" | grep -q "$EXPLORER"; then TX_HASH=$(echo "$RESULT" | grep -oE "$EXPLORER/tx/0x[a-fA-F0-9]{64}" | grep -oE '0x[a-fA-F0-9]{64}') diff --git a/ens-primary-name/scripts/set-primary.sh b/ens-primary-name/scripts/set-primary.sh index 5004a3ed..21d3c95c 100755 --- a/ens-primary-name/scripts/set-primary.sh +++ b/ens-primary-name/scripts/set-primary.sh @@ -9,32 +9,11 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ENS_NAME="${1:?Usage: set-primary.sh [chain]}" CHAIN="${2:-base}" -# Find bankr.sh in common locations -# Bankr provides wallet/signing via the Bankr API -# If you don't have bankr, modify this function to use your own signer -find_bankr() { - local locations=( - "$SCRIPT_DIR/../../bankr/scripts/bankr.sh" - "$SCRIPT_DIR/../../moltbot-skills/bankr/scripts/bankr.sh" - "$(command -v bankr.sh 2>/dev/null)" - ) - for loc in "${locations[@]}"; do - if [ -x "$loc" ]; then - echo "$loc" - return 0 - fi - done - echo "ERROR: bankr.sh not found." >&2 - echo "" >&2 - echo "This skill requires a transaction signer. Options:" >&2 - echo "1. Install the bankr skill from https://github.com/BankrBot/openclaw-skills" >&2 - echo "2. Modify find_bankr() in this script to use your own wallet/signer" >&2 - echo "" >&2 - echo "The script needs to submit: {to, data, value, chainId} transactions" >&2 +# Require Bankr CLI +if ! command -v bankr >/dev/null 2>&1; then + echo "Bankr CLI not found. Install with: bun install -g @bankr/cli" >&2 exit 1 -} - -BANKR_SH=$(find_bankr) +fi # Reverse Registrar addresses by chain case "$CHAIN" in @@ -145,7 +124,7 @@ console.log(selector + offset + len + data); echo "Calldata: $CALLDATA" >&2 echo "Submitting transaction..." >&2 -RESULT=$("$BANKR_SH" "Submit this transaction: {\"to\": \"$REVERSE_REGISTRAR\", \"data\": \"$CALLDATA\", \"value\": \"0\", \"chainId\": $CHAIN_ID}" 2>/dev/null) +RESULT=$(bankr prompt "Submit this transaction: {\"to\": \"$REVERSE_REGISTRAR\", \"data\": \"$CALLDATA\", \"value\": \"0\", \"chainId\": $CHAIN_ID}" 2>/dev/null) if echo "$RESULT" | grep -q "$EXPLORER"; then TX_HASH=$(echo "$RESULT" | grep -oE "$EXPLORER/tx/0x[a-fA-F0-9]{64}" | grep -oE '0x[a-fA-F0-9]{64}') diff --git a/erc-8004/scripts/bridge-to-mainnet.sh b/erc-8004/scripts/bridge-to-mainnet.sh index 59a31f79..42f89dcf 100755 --- a/erc-8004/scripts/bridge-to-mainnet.sh +++ b/erc-8004/scripts/bridge-to-mainnet.sh @@ -5,6 +5,12 @@ set -e +# Require Bankr CLI +if ! command -v bankr >/dev/null 2>&1; then + echo "Bankr CLI not found. Install with: bun install -g @bankr/cli" >&2 + exit 1 +fi + AMOUNT="${1:?Usage: bridge-to-mainnet.sh }" echo "=== Bridging ETH to Mainnet ===" >&2 @@ -13,7 +19,7 @@ echo "From: Base" >&2 echo "To: Ethereum Mainnet" >&2 # Use Bankr to bridge -RESULT=$(~/clawd/skills/bankr/scripts/bankr.sh "Bridge $AMOUNT ETH from Base to Ethereum mainnet" 2>/dev/null) +RESULT=$(bankr prompt "Bridge $AMOUNT ETH from Base to Ethereum mainnet" 2>/dev/null) if echo "$RESULT" | grep -qi "success\|bridge\|complete\|transaction"; then echo "=== SUCCESS ===" >&2 diff --git a/erc-8004/scripts/register-http.sh b/erc-8004/scripts/register-http.sh index 6de646bb..1c7969e5 100755 --- a/erc-8004/scripts/register-http.sh +++ b/erc-8004/scripts/register-http.sh @@ -6,6 +6,12 @@ set -e +# Require Bankr CLI +if ! command -v bankr >/dev/null 2>&1; then + echo "Bankr CLI not found. Install with: bun install -g @bankr/cli" >&2 + exit 1 +fi + REGISTRATION_URL="${REGISTRATION_URL:?Error: REGISTRATION_URL environment variable required}" # Check for testnet flag @@ -42,7 +48,7 @@ console.log(selector + offset + len + data); echo "Registering on-chain..." >&2 # Submit via Bankr -RESULT=$(~/clawd/skills/bankr/scripts/bankr.sh "Submit this transaction on $CHAIN: {\"to\": \"$IDENTITY_REGISTRY\", \"data\": \"$CALLDATA\", \"value\": \"0\", \"chainId\": $CHAIN_ID}" 2>/dev/null) +RESULT=$(bankr prompt "Submit this transaction on $CHAIN: {\"to\": \"$IDENTITY_REGISTRY\", \"data\": \"$CALLDATA\", \"value\": \"0\", \"chainId\": $CHAIN_ID}" 2>/dev/null) if echo "$RESULT" | grep -qE "$EXPLORER/tx/0x[a-fA-F0-9]{64}"; then TX_HASH=$(echo "$RESULT" | grep -oE "$EXPLORER/tx/0x[a-fA-F0-9]{64}" | grep -oE '0x[a-fA-F0-9]{64}' | head -1) diff --git a/erc-8004/scripts/register-onchain.sh b/erc-8004/scripts/register-onchain.sh index 3c130ae6..8e9d4fec 100755 --- a/erc-8004/scripts/register-onchain.sh +++ b/erc-8004/scripts/register-onchain.sh @@ -14,6 +14,12 @@ set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# Require Bankr CLI +if ! command -v bankr >/dev/null 2>&1; then + echo "Bankr CLI not found. Install with: bun install -g @bankr/cli" >&2 + exit 1 +fi + # Check for testnet flag if [ "$1" = "--testnet" ] || [ "$1" = "-t" ]; then CHAIN="sepolia" @@ -56,7 +62,7 @@ echo "Registering on-chain (data URI)..." >&2 echo "Note: This will cost more gas than IPFS/HTTP due to larger calldata" >&2 # Submit via Bankr -RESULT=$(~/clawd/skills/bankr/scripts/bankr.sh "Submit this transaction on $CHAIN: {\"to\": \"$IDENTITY_REGISTRY\", \"data\": \"$CALLDATA\", \"value\": \"0\", \"chainId\": $CHAIN_ID}" 2>/dev/null) +RESULT=$(bankr prompt "Submit this transaction on $CHAIN: {\"to\": \"$IDENTITY_REGISTRY\", \"data\": \"$CALLDATA\", \"value\": \"0\", \"chainId\": $CHAIN_ID}" 2>/dev/null) if echo "$RESULT" | grep -qE "$EXPLORER/tx/0x[a-fA-F0-9]{64}"; then TX_HASH=$(echo "$RESULT" | grep -oE "$EXPLORER/tx/0x[a-fA-F0-9]{64}" | grep -oE '0x[a-fA-F0-9]{64}' | head -1) diff --git a/erc-8004/scripts/register.sh b/erc-8004/scripts/register.sh index 0d6b6cc7..b56509da 100755 --- a/erc-8004/scripts/register.sh +++ b/erc-8004/scripts/register.sh @@ -21,6 +21,12 @@ set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# Require Bankr CLI +if ! command -v bankr >/dev/null 2>&1; then + echo "Bankr CLI not found. Install with: bun install -g @bankr/cli" >&2 + exit 1 +fi + # Check for testnet flag if [ "$1" = "--testnet" ] || [ "$1" = "-t" ]; then CHAIN="sepolia" @@ -83,7 +89,7 @@ console.log(selector + offset + len + data); echo "Calldata: $CALLDATA" >&2 # Submit via Bankr -RESULT=$(~/clawd/skills/bankr/scripts/bankr.sh "Submit this transaction on $CHAIN: {\"to\": \"$IDENTITY_REGISTRY\", \"data\": \"$CALLDATA\", \"value\": \"0\", \"chainId\": $CHAIN_ID}" 2>/dev/null) +RESULT=$(bankr prompt "Submit this transaction on $CHAIN: {\"to\": \"$IDENTITY_REGISTRY\", \"data\": \"$CALLDATA\", \"value\": \"0\", \"chainId\": $CHAIN_ID}" 2>/dev/null) if echo "$RESULT" | grep -qE "$EXPLORER/tx/0x[a-fA-F0-9]{64}"; then TX_HASH=$(echo "$RESULT" | grep -oE "$EXPLORER/tx/0x[a-fA-F0-9]{64}" | grep -oE '0x[a-fA-F0-9]{64}' | head -1) diff --git a/erc-8004/scripts/update-profile.sh b/erc-8004/scripts/update-profile.sh index 45258d01..c3f97da8 100755 --- a/erc-8004/scripts/update-profile.sh +++ b/erc-8004/scripts/update-profile.sh @@ -5,6 +5,12 @@ set -e +# Require Bankr CLI +if ! command -v bankr >/dev/null 2>&1; then + echo "Bankr CLI not found. Install with: bun install -g @bankr/cli" >&2 + exit 1 +fi + AGENT_ID="${1:?Usage: update-profile.sh [--testnet]}" NEW_URI="${2:?Usage: update-profile.sh [--testnet]}" @@ -55,7 +61,7 @@ console.log(selector + id + offset + len + data); echo "Calldata: $CALLDATA" >&2 # Submit via Bankr -RESULT=$(~/clawd/skills/bankr/scripts/bankr.sh "Submit this transaction on $CHAIN: {\"to\": \"$IDENTITY_REGISTRY\", \"data\": \"$CALLDATA\", \"value\": \"0\", \"chainId\": $CHAIN_ID}" 2>/dev/null) +RESULT=$(bankr prompt "Submit this transaction on $CHAIN: {\"to\": \"$IDENTITY_REGISTRY\", \"data\": \"$CALLDATA\", \"value\": \"0\", \"chainId\": $CHAIN_ID}" 2>/dev/null) if echo "$RESULT" | grep -qE "$EXPLORER/tx/0x[a-fA-F0-9]{64}"; then TX_HASH=$(echo "$RESULT" | grep -oE "$EXPLORER/tx/0x[a-fA-F0-9]{64}" | grep -oE '0x[a-fA-F0-9]{64}' | head -1) diff --git a/veil/scripts/_common.sh b/veil/scripts/_common.sh index b606d8db..3803c8df 100755 --- a/veil/scripts/_common.sh +++ b/veil/scripts/_common.sh @@ -8,7 +8,7 @@ SDK_REPO="${VEIL_SDK_REPO:-$OPENCLAW_WORKSPACE/repos/veildotcash-sdk}" VEIL_DIR="$HOME/.clawdbot/skills/veil" VEIL_ENV="$VEIL_DIR/.env.veil" VEIL_ENV_EXTRA="$VEIL_DIR/.env" # optional (RPC_URL, etc) -BANKR_CONFIG="$HOME/.clawdbot/skills/bankr/config.json" +BANKR_CONFIG="${BANKR_CONFIG:-$HOME/.clawdbot/skills/bankr/config.json}" need_bin() { command -v "$1" >/dev/null 2>&1 || { echo "Missing required binary: $1" >&2; exit 1; } @@ -63,12 +63,22 @@ ensure_veil_env_perms() { [[ -f "$VEIL_ENV_EXTRA" ]] && chmod 600 "$VEIL_ENV_EXTRA" 2>/dev/null || true } -need_bankr_config() { - if [[ ! -f "$BANKR_CONFIG" ]]; then - echo "Bankr config not found at: $BANKR_CONFIG" >&2 - echo "Create it with your Bankr API key (starts with bk_)." >&2 - exit 1 +need_bankr() { + # Prefer Bankr CLI + if command -v bankr >/dev/null 2>&1; then + return 0 + fi + # Fall back to config file for curl-based scripts + if [[ -f "$BANKR_CONFIG" ]]; then + need_bin jq + need_bin curl + return 0 fi - need_bin jq - need_bin curl + echo "Bankr CLI not found. Install with: bun install -g @bankr/cli && bankr login" >&2 + exit 1 +} + +# Legacy alias +need_bankr_config() { + need_bankr } diff --git a/veil/scripts/veil-bankr-prompt.sh b/veil/scripts/veil-bankr-prompt.sh index 38690bde..1d8464f9 100755 --- a/veil/scripts/veil-bankr-prompt.sh +++ b/veil/scripts/veil-bankr-prompt.sh @@ -1,11 +1,12 @@ #!/usr/bin/env bash -# Minimal wrapper: submit a prompt to Bankr Agent API and return final response JSON. +# Submit a prompt to Bankr and return the response. +# Delegates to the Bankr CLI when available, falls back to curl. set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "$SCRIPT_DIR/_common.sh" -need_bankr_config +need_bankr PROMPT="$*" if [[ -z "$PROMPT" ]]; then @@ -13,6 +14,12 @@ if [[ -z "$PROMPT" ]]; then exit 1 fi +# CLI path (preferred) — need_bankr already verified one of these is available +if command -v bankr >/dev/null 2>&1; then + exec bankr prompt "$PROMPT" +fi + +# Curl fallback — config file was validated by need_bankr API_KEY=$(jq -r '.apiKey // empty' "$BANKR_CONFIG") API_URL=$(jq -r '.apiUrl // "https://api.bankr.bot"' "$BANKR_CONFIG") From 12f6a5f6a3404d69a2b7239487c28f0f7c2b5ef5 Mon Sep 17 00:00:00 2001 From: sidrisov Date: Sat, 7 Feb 2026 01:32:31 +0400 Subject: [PATCH 2/7] Rebrand README from Moltbot to OpenClaw and add missing skills - Rename to OpenClaw Skills Library (formerly Clawdbot), update repo URL to BankrBot/openclaw-skills - Add 5 missing skills to table: clanker, onchainkit, endaoment, ens-primary-name, veil - Update directory tree to list all 13 skill directories --- README.md | 64 +++++++++++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 3611c004..da501589 100644 --- a/README.md +++ b/README.md @@ -1,53 +1,53 @@ -# Moltbot Skills Library +# OpenClaw Skills Library -Public repository of skills for [Moltbot](https://github.com/BankrBot/moltbot-skills) (formerly Clawdbot) — including [Bankr](https://bankr.bot) skills and community-contributed skills from other providers. +Public repository of skills for [OpenClaw](https://github.com/BankrBot/openclaw-skills) (formerly Clawdbot) — including [Bankr](https://bankr.bot) skills and community-contributed skills from other providers. ## Structure Each top-level directory is a provider. Each subdirectory within a provider is an installable skill containing a `SKILL.md` and other skill related files. ``` -moltbot-skills/ -├── bankr/ -│ ├── SKILL.md -│ └── references/ -│ ├── token-trading.md -│ ├── leverage-trading.md -│ ├── polymarket.md -│ ├── automation.md -│ ├── token-deployment.md -│ └── ... -│ -├── base/ # Base (placeholder) -│ └── SKILL.md -├── neynar/ # Neynar (placeholder) -│ └── SKILL.md -├── qrcoin/ # QR Coin (community) -│ └── SKILL.md -└── zapper/ # Zapper (placeholder) - └── SKILL.md +openclaw-skills/ +├── bankr/ # Bankr AI trading agent +├── botchan/ # Onchain agent messaging +├── clanker/ # ERC20 token deployment +├── endaoment/ # Charity donations +├── ens-primary-name/ # ENS reverse resolution +├── erc-8004/ # Agent registration +├── onchainkit/ # Coinbase OnchainKit +├── veil/ # Privacy/shielded txns +├── qrcoin/ # QR code auctions +├── yoink/ # Capture-the-flag game +├── base/ # (placeholder) +├── neynar/ # (placeholder) +└── zapper/ # (placeholder) ``` ## Install Instructions -Give Moltbot the URL to this repo and it will let you choose which skill to install. +Give OpenClaw the URL to this repo and it will let you choose which skill to install. ``` -https://github.com/BankrBot/moltbot-skills +https://github.com/BankrBot/openclaw-skills ``` ## Available Skills -| Provider | Skill | Description | -| -------------------------- | --------------- | --------------------------------------------------------------------------------------------------------- | +| Provider | Skill | Description | +|----------|-------|-------------| | [bankr](https://bankr.bot) | [bankr](bankr/) | AI-powered crypto trading agent via natural language. Trade, manage portfolios, automate DeFi operations. | -| [8004.org](https://8004.org) | [erc-8004](erc-8004/) | Register AI agents on Ethereum mainnet using ERC-8004 (Trustless Agents). Get an agent NFT, build reputation. | -| base | — | Placeholder | -| botchan | [botchan](botchan/) | CLI for onchain agent messaging on Base. Explore agents, post to feeds, send DMs, store data permanently. | -| neynar | — | Placeholder | -| [qrcoin](https://qrcoin.fun) | [qrcoin](qrcoin/) | QR code auction platform on Base. Bid to display URLs on QR codes. | -| yoink | [yoink](yoink/) | Onchain capture-the-flag game on Base. | -| zapper | — | Placeholder | +| [8004.org](https://8004.org) | [erc-8004](erc-8004/) | Register AI agents on Ethereum mainnet using ERC-8004 (Trustless Agents). | +| botchan | [botchan](botchan/) | Onchain agent messaging on Base. Explore agents, post to feeds, send DMs. | +| [Clanker](https://clanker.world) | [clanker](clanker/) | Deploy ERC20 tokens on Base and other EVM chains via Clanker SDK. | +| [Coinbase](https://onchainkit.xyz) | [onchainkit](onchainkit/) | Build onchain apps with React components from Coinbase's OnchainKit. | +| [Endaoment](https://endaoment.org) | [endaoment](endaoment/) | Donate to charities onchain via Endaoment. Supports Base, Ethereum, Optimism. | +| [ENS](https://ens.domains) | [ens-primary-name](ens-primary-name/) | Set your primary ENS name on Base and other L2s. | +| neynar | — | Placeholder | +| [qrcoin](https://qrcoin.fun) | [qrcoin](qrcoin/) | QR code auction platform on Base. Bid to display URLs on QR codes. | +| [Veil Cash](https://veil.cash) | [veil](veil/) | Privacy and shielded transactions on Base via ZK proofs. | +| yoink | [yoink](yoink/) | Onchain capture-the-flag game on Base. | +| base | — | Placeholder | +| zapper | — | Placeholder | ## Contributing From 7cab725f6621adc9caafe64882330598d9f3f390 Mon Sep 17 00:00:00 2001 From: sidrisov Date: Sun, 8 Feb 2026 17:11:41 +0400 Subject: [PATCH 3/7] docs(bankr): add non-interactive login instructions for AI agents Add --url and --api-key flags documentation to SKILL.md for AI agents that cannot interact with terminal prompts. Update command reference table with the new login flag variants. --- bankr/SKILL.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/bankr/SKILL.md b/bankr/SKILL.md index f67c0d21..b15bf83e 100644 --- a/bankr/SKILL.md +++ b/bankr/SKILL.md @@ -62,6 +62,21 @@ If you already have an API key, select "Paste an existing Bankr API key" and ent bankr config set apiKey bk_YOUR_KEY_HERE ``` +#### Non-Interactive Login (for AI agents) + +If you cannot interact with terminal prompts, use these flags: + +**If the user needs to create an API key:** +1. Run `bankr login --url` — prints the dashboard URL +2. Present the URL to the user, ask them to generate a `bk_...` key +3. Run `bankr login --api-key bk_THE_KEY` + +**If the user already has an API key:** + +```bash +bankr login --api-key bk_YOUR_KEY_HERE +``` + ### Verify Setup ```bash @@ -75,7 +90,9 @@ bankr prompt "What is my balance?" | Command | Description | |---------|-------------| -| `bankr login` | Authenticate with the Bankr API | +| `bankr login` | Authenticate with the Bankr API (interactive) | +| `bankr login --url` | Print dashboard URL for API key generation | +| `bankr login --api-key ` | Login with an API key directly (non-interactive) | | `bankr logout` | Clear stored credentials | | `bankr whoami` | Show current authentication info | | `bankr prompt ` | Send a prompt to the Bankr AI agent | From e5f0e368ac6405a63d78e42afbba8baff65a00c0 Mon Sep 17 00:00:00 2001 From: sidrisov Date: Mon, 9 Feb 2026 16:57:02 +0400 Subject: [PATCH 4/7] docs(bankr): add conversation thread support for multi-turn prompts Document the new threadId parameter and CLI flags (--continue, --thread) that enable multi-turn conversations with the Bankr AI agent. --- bankr/SKILL.md | 24 +++++++++++++++++++++++- bankr/references/api-workflow.md | 12 ++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/bankr/SKILL.md b/bankr/SKILL.md index b15bf83e..628aafd1 100644 --- a/bankr/SKILL.md +++ b/bankr/SKILL.md @@ -96,6 +96,8 @@ bankr prompt "What is my balance?" | `bankr logout` | Clear stored credentials | | `bankr whoami` | Show current authentication info | | `bankr prompt ` | Send a prompt to the Bankr AI agent | +| `bankr prompt --continue ` | Continue the most recent conversation thread | +| `bankr prompt --thread ` | Continue a specific conversation thread | | `bankr status ` | Check the status of a running job | | `bankr cancel ` | Cancel a running job | | `bankr skills` | Show all Bankr AI agent skills with examples | @@ -153,6 +155,25 @@ bankr prompt echo 'Buy $50 of ETH on Base' | bankr prompt ``` +### Conversation Threads + +Continue a multi-turn conversation with the agent: + +```bash +# First prompt — starts a new thread automatically +bankr prompt "What is the price of ETH?" +# → Thread: thr_ABC123 + +# Continue the conversation (agent remembers the ETH context) +bankr prompt --continue "And what about BTC?" +bankr prompt -c "Compare them" + +# Resume any thread by ID +bankr prompt --thread thr_ABC123 "Show me ETH chart" +``` + +Thread IDs are automatically saved to config after each prompt. The `--continue` / `-c` flag reuses the last thread. + ### Manual Job Control For advanced use or long-running operations: @@ -438,9 +459,10 @@ bankr prompt "Compare ETH vs SOL" Bankr uses an asynchronous job-based API: -1. **Submit** — Send prompt, get job ID +1. **Submit** — Send prompt (with optional `threadId`), get job ID and thread ID 2. **Poll** — Check status every 2 seconds 3. **Complete** — Process results when done +4. **Continue** — Reuse `threadId` for multi-turn conversations The `bankr prompt` command handles this automatically. For manual job control, use `bankr status ` and `bankr cancel `. diff --git a/bankr/references/api-workflow.md b/bankr/references/api-workflow.md index 38a4fa47..f2a80c82 100644 --- a/bankr/references/api-workflow.md +++ b/bankr/references/api-workflow.md @@ -52,14 +52,24 @@ curl -X POST "https://api.bankr.bot/agent/prompt" \ -d '{"prompt": "What is my ETH balance?"}' ``` +**Continue a conversation:** +```bash +curl -X POST "https://api.bankr.bot/agent/prompt" \ + -H "X-API-Key: YOUR_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{"prompt": "And what about SOL?", "threadId": "thr_ABC123"}' +``` + **Request Body:** - **prompt** (string, required): The prompt to send to the AI agent (max 10,000 characters) +- **threadId** (string, optional): Continue an existing conversation thread. If omitted, a new thread is created. **Response (202 Accepted):** ```json { "success": true, "jobId": "job_abc123", + "threadId": "thr_XYZ789", "status": "pending", "message": "Job submitted successfully" } @@ -89,6 +99,7 @@ curl -X GET "https://api.bankr.bot/agent/job/job_abc123" \ { "success": true, "jobId": "job_abc123", + "threadId": "thr_XYZ789", "status": "completed", "prompt": "What is my ETH balance?", "response": "You have 0.5 ETH worth approximately $1,825.", @@ -158,6 +169,7 @@ curl -X POST "https://api.bankr.bot/agent/job/job_abc123/cancel" \ ### Standard Fields - **success**: Boolean, true if request succeeded - **jobId**: Unique job identifier +- **threadId**: Conversation thread ID (reuse to continue the conversation) - **status**: Current job status (`pending`, `processing`, `completed`, `failed`, `cancelled`) - **prompt**: Original user prompt - **createdAt**: ISO 8601 timestamp From 3c08cfd261bac9bd8583ffd7f21ac42572252108 Mon Sep 17 00:00:00 2001 From: sidrisov Date: Mon, 9 Feb 2026 22:37:46 +0400 Subject: [PATCH 5/7] docs(bankr): fix LLM gateway base URL and clarify API format config Remove /v1 suffix from gateway base URL and update API format docs to reflect automatic per-model configuration via bankr llm setup. --- bankr/SKILL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bankr/SKILL.md b/bankr/SKILL.md index 628aafd1..40e6500f 100644 --- a/bankr/SKILL.md +++ b/bankr/SKILL.md @@ -199,7 +199,7 @@ The [Bankr LLM Gateway](https://docs.bankr.bot/llm-gateway/overview) is a unifie - **High availability** — Automatic failover between Vertex AI and OpenRouter - **SDK compatible** — Works with OpenAI and Anthropic SDKs, no code changes needed -**Base URL:** `https://llm.bankr.bot/v1` +**Base URL:** `https://llm.bankr.bot` ### Available Models @@ -260,7 +260,7 @@ To use a Bankr model as your default in OpenClaw, add to `openclaw.json`: } ``` -The gateway also supports the Anthropic Messages API format. Change the `api` field in the provider config from `"openai-completions"` to `"anthropic-messages"` for Claude-native features like extended thinking. +The gateway supports both OpenAI and Anthropic API formats. When installed via `bankr llm setup openclaw`, Claude models are automatically configured with `api: "anthropic-messages"` per-model overrides, while all other models use the default `api: "openai-completions"`. ### Claude Code From a373de2c0d3e7c01e06be748f229049e9b8f002e Mon Sep 17 00:00:00 2001 From: sidrisov Date: Tue, 10 Feb 2026 23:44:05 +0400 Subject: [PATCH 6/7] docs(bankr): add REST API option, LLM gateway reference, and environment variables Restructure SKILL.md to present two integration paths (CLI and REST API), extract detailed LLM gateway docs into a dedicated reference file, and document environment variables and separate LLM key configuration. --- bankr/SKILL.md | 246 ++++++++++++++++--------- bankr/references/api-workflow.md | 8 +- bankr/references/error-handling.md | 15 ++ bankr/references/llm-gateway.md | 286 +++++++++++++++++++++++++++++ 4 files changed, 469 insertions(+), 86 deletions(-) create mode 100644 bankr/references/llm-gateway.md diff --git a/bankr/SKILL.md b/bankr/SKILL.md index 40e6500f..1734340b 100644 --- a/bankr/SKILL.md +++ b/bankr/SKILL.md @@ -14,11 +14,26 @@ metadata: # Bankr -Execute crypto trading and DeFi operations using natural language through the Bankr CLI. +Execute crypto trading and DeFi operations using natural language. Two integration options: -## Requirements +1. **Bankr CLI** (recommended) — Install `@bankr/cli` for a batteries-included terminal experience +2. **REST API** — Call `https://api.bankr.bot` directly from any language or tool -Install the Bankr CLI: +Both use the same API key and the same async job workflow under the hood. + +## Getting an API Key + +Before using either option, you need a Bankr API key: + +1. Visit [bankr.bot/api](https://bankr.bot/api) +2. **Sign up / Sign in** — Enter your email and the one-time passcode (OTP) sent to it +3. **Generate an API key** — Create a key with **Agent API** access enabled (the key starts with `bk_...`) + +Creating a new account automatically provisions **EVM wallets** (Base, Ethereum, Polygon, Unichain) and a **Solana wallet** — no manual wallet setup needed. + +## Option 1: Bankr CLI (Recommended) + +### Install ```bash bun install -g @bankr/cli @@ -30,38 +45,38 @@ Or with npm: npm install -g @bankr/cli ``` -## Quick Start - ### First-Time Setup ```bash -# Authenticate with Bankr (creates account if needed) +# Authenticate with Bankr (interactive — opens browser or paste key) bankr login # Verify your identity bankr whoami ``` -The `bankr login` command gives you two options: +The `bankr login` command gives you two choices: -#### Option A: Open the Bankr dashboard (recommended for new users) +**A) Open the Bankr dashboard** — The CLI opens [bankr.bot/api](https://bankr.bot/api) where you generate a key and paste it back. -The CLI opens [bankr.bot/api](https://bankr.bot/api) in your browser where you: +**B) Paste an existing API key** — Select "Paste an existing Bankr API key" and enter it directly. -1. **Sign up / Sign in** — Enter your email and the one-time passcode (OTP) sent to it -2. **Generate an API key** — Create a key with **Agent API** access enabled -3. **Paste the key** — Copy the `bk_...` key back into the CLI prompt +#### Separate LLM Gateway Key (Optional) -Creating a new account automatically provisions **EVM wallets** (Base, Ethereum, Polygon, Unichain) and a **Solana wallet** — no manual wallet setup needed. +If your LLM gateway key differs from your Bankr API key, you can set them separately. During interactive login the CLI will ask if you want a different LLM key. You can also pass it directly: -#### Option B: Paste an existing API key +```bash +bankr login --api-key bk_YOUR_KEY --llm-key YOUR_LLM_KEY +``` -If you already have an API key, select "Paste an existing Bankr API key" and enter it directly. You can also set it without the interactive flow: +Or set it via config: ```bash -bankr config set apiKey bk_YOUR_KEY_HERE +bankr config set llmKey YOUR_LLM_KEY ``` +When not set, the API key is used for both the agent API and the LLM gateway. + #### Non-Interactive Login (for AI agents) If you cannot interact with terminal prompts, use these flags: @@ -77,13 +92,92 @@ If you cannot interact with terminal prompts, use these flags: bankr login --api-key bk_YOUR_KEY_HERE ``` -### Verify Setup +#### Verify Setup ```bash bankr whoami bankr prompt "What is my balance?" ``` +## Option 2: REST API (Direct) + +No CLI installation required — call the API directly with `curl`, `fetch`, or any HTTP client. + +### Authentication + +All requests require an `X-API-Key` header: + +```bash +curl -X POST "https://api.bankr.bot/agent/prompt" \ + -H "X-API-Key: bk_YOUR_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{"prompt": "What is my ETH balance?"}' +``` + +### Quick Example: Submit → Poll → Complete + +```bash +# 1. Submit a prompt — returns a job ID +JOB=$(curl -s -X POST "https://api.bankr.bot/agent/prompt" \ + -H "X-API-Key: $BANKR_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{"prompt": "What is my ETH balance?"}') +JOB_ID=$(echo "$JOB" | jq -r '.jobId') + +# 2. Poll until terminal status +while true; do + RESULT=$(curl -s "https://api.bankr.bot/agent/job/$JOB_ID" \ + -H "X-API-Key: $BANKR_API_KEY") + STATUS=$(echo "$RESULT" | jq -r '.status') + [ "$STATUS" = "completed" ] || [ "$STATUS" = "failed" ] || [ "$STATUS" = "cancelled" ] && break + sleep 2 +done + +# 3. Read the response +echo "$RESULT" | jq -r '.response' +``` + +### Conversation Threads + +Every prompt response (and completed job) includes a `threadId`. Save it and pass it back to continue the conversation — the agent remembers context from earlier messages in the same thread. + +```bash +# Start a conversation — save the threadId from the response +curl -X POST "https://api.bankr.bot/agent/prompt" \ + -H "X-API-Key: $BANKR_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{"prompt": "What is the price of ETH?"}' +# → {"jobId": "job_abc", "threadId": "thr_XYZ", ...} + +# Continue it — pass threadId to maintain context +curl -X POST "https://api.bankr.bot/agent/prompt" \ + -H "X-API-Key: $BANKR_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{"prompt": "And what about SOL?", "threadId": "thr_XYZ"}' + +# Continue further — same threadId +curl -X POST "https://api.bankr.bot/agent/prompt" \ + -H "X-API-Key: $BANKR_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{"prompt": "Compare them", "threadId": "thr_XYZ"}' +``` + +Omit `threadId` to start a new conversation. The CLI equivalent is `bankr prompt --continue` (reuses last thread) or `bankr prompt --thread `. + +### API Endpoints Summary + +| Endpoint | Method | Description | +|----------|--------|-------------| +| `/agent/prompt` | POST | Submit a prompt (async, returns job ID) | +| `/agent/job/{jobId}` | GET | Check job status and results | +| `/agent/job/{jobId}/cancel` | POST | Cancel a running job | +| `/agent/sign` | POST | Sign messages/transactions (sync) | +| `/agent/submit` | POST | Submit raw transactions (sync) | + +For full API details (request/response schemas, job states, rich data, polling strategy), see: + +**Reference**: [references/api-workflow.md](references/api-workflow.md) | [references/sign-submit-api.md](references/sign-submit-api.md) + ## CLI Command Reference ### Core Commands @@ -93,6 +187,7 @@ bankr prompt "What is my balance?" | `bankr login` | Authenticate with the Bankr API (interactive) | | `bankr login --url` | Print dashboard URL for API key generation | | `bankr login --api-key ` | Login with an API key directly (non-interactive) | +| `bankr login --api-key --llm-key ` | Login with separate LLM gateway key | | `bankr logout` | Clear stored credentials | | `bankr whoami` | Show current authentication info | | `bankr prompt ` | Send a prompt to the Bankr AI agent | @@ -110,10 +205,21 @@ bankr prompt "What is my balance?" | `bankr config set ` | Set a config value | | `bankr --config ` | Use a custom config file path | -Valid config keys: `apiKey`, `apiUrl`, `llmUrl` +Valid config keys: `apiKey`, `apiUrl`, `llmKey`, `llmUrl` Default config location: `~/.bankr/config.json`. Override with `--config` or `BANKR_CONFIG` env var. +### Environment Variables + +| Variable | Description | +|----------|-------------| +| `BANKR_API_KEY` | API key (overrides stored key) | +| `BANKR_API_URL` | API URL (default: `https://api.bankr.bot`) | +| `BANKR_LLM_KEY` | LLM gateway key (falls back to `BANKR_API_KEY` if not set) | +| `BANKR_LLM_URL` | LLM gateway URL (default: `https://llm.bankr.bot`) | + +Environment variables override config file values. Config file values override defaults. + ### LLM Gateway Commands | Command | Description | @@ -192,61 +298,33 @@ bankr cancel job_abc123 ## LLM Gateway -The [Bankr LLM Gateway](https://docs.bankr.bot/llm-gateway/overview) is a unified API for Claude, Gemini, GPT, and other models. It provides: - -- **Multi-provider access** — Anthropic, Google, OpenAI, Moonshot AI, and Alibaba through one API -- **Cost tracking** — Full visibility into token usage and costs per request -- **High availability** — Automatic failover between Vertex AI and OpenRouter -- **SDK compatible** — Works with OpenAI and Anthropic SDKs, no code changes needed +The [Bankr LLM Gateway](https://docs.bankr.bot/llm-gateway/overview) is a unified API for Claude, Gemini, GPT, and other models — multi-provider access, cost tracking, automatic failover, and SDK compatibility through a single endpoint. **Base URL:** `https://llm.bankr.bot` -### Available Models - -| Model | Provider | Best For | -|-------|----------|----------| -| `claude-opus-4.6` | Anthropic | Most capable, advanced reasoning | -| `claude-sonnet-4.5` | Anthropic | Balanced speed and quality | -| `claude-haiku-4.5` | Anthropic | Fast, cost-effective | -| `gemini-3-pro` | Google | Long context (2M tokens) | -| `gemini-3-flash` | Google | High throughput | -| `gemini-2.5-pro` | Google | Long context, multimodal | -| `gemini-2.5-flash` | Google | Speed, high throughput | -| `gpt-5.2` | OpenAI | Advanced reasoning | -| `gpt-5.2-codex` | OpenAI | Code generation | -| `gpt-5-mini` | OpenAI | Fast, economical | -| `gpt-5-nano` | OpenAI | Ultra-fast, lowest cost | -| `kimi-k2.5` | Moonshot AI | Long-context reasoning | -| `qwen3-coder` | Alibaba | Code generation, debugging | +Uses your `llmKey` if configured, otherwise falls back to your API key. -```bash -# Fetch live model list from the gateway -bankr llm models -``` - -### Credits +### Quick Commands ```bash -# Check your LLM gateway credit balance -bankr llm credits +bankr llm models # List available models +bankr llm credits # Check credit balance +bankr llm setup openclaw --install # Install Bankr provider into OpenClaw +bankr llm setup opencode --install # Install Bankr provider into OpenCode +bankr llm setup claude # Print Claude Code env vars +bankr llm setup cursor # Cursor setup instructions +bankr llm claude # Launch Claude Code through gateway +bankr llm claude --model claude-opus-4.6 # Launch with specific model ``` -### OpenClaw Setup - -The fastest way to connect OpenClaw to the gateway: +### OpenClaw Provider Setup ```bash -# Auto-install Bankr provider into ~/.openclaw/openclaw.json +# Auto-install — writes provider config to ~/.openclaw/openclaw.json bankr llm setup openclaw --install ``` -This writes the full provider config (base URL, API key, all models) into your OpenClaw config. To preview without writing: - -```bash -bankr llm setup openclaw -``` - -To use a Bankr model as your default in OpenClaw, add to `openclaw.json`: +To use a Bankr model as your default, add to `openclaw.json`: ```json { @@ -260,31 +338,21 @@ To use a Bankr model as your default in OpenClaw, add to `openclaw.json`: } ``` -The gateway supports both OpenAI and Anthropic API formats. When installed via `bankr llm setup openclaw`, Claude models are automatically configured with `api: "anthropic-messages"` per-model overrides, while all other models use the default `api: "openai-completions"`. - -### Claude Code - -```bash -# Print env vars to add to your shell profile -bankr llm setup claude - -# Or launch Claude Code directly through the gateway -bankr llm claude -``` +### Direct SDK Usage -### OpenCode +The gateway works with standard OpenAI and Anthropic SDKs — just override the base URL: ```bash -# Auto-install Bankr provider into ~/.config/opencode/opencode.json -bankr llm setup opencode --install +# OpenAI-compatible +curl -X POST "https://llm.bankr.bot/v1/chat/completions" \ + -H "Authorization: Bearer $BANKR_LLM_KEY" \ + -H "Content-Type: application/json" \ + -d '{"model": "claude-sonnet-4.5", "messages": [{"role": "user", "content": "Hello"}]}' ``` -### Cursor +For full model list, provider config JSON shape, SDK examples (Python, TypeScript), all setup commands, and troubleshooting, see: -```bash -# Get step-by-step instructions with your API key -bankr llm setup cursor -``` +**Reference**: [references/llm-gateway.md](references/llm-gateway.md) ## Capabilities Overview @@ -464,7 +532,7 @@ Bankr uses an asynchronous job-based API: 3. **Complete** — Process results when done 4. **Continue** — Reuse `threadId` for multi-turn conversations -The `bankr prompt` command handles this automatically. For manual job control, use `bankr status ` and `bankr cancel `. +The `bankr prompt` command handles this automatically. When using the REST API directly, implement the poll loop yourself (see Option 2 above or the reference below). For manual job control via CLI, use `bankr status ` and `bankr cancel `. For details on the API structure, job states, polling strategy, and error handling, see: @@ -488,7 +556,7 @@ These endpoints return immediately (no polling required) and are ideal for: Common issues and fixes: -- **Authentication errors** → Run `bankr login` or check `bankr whoami` +- **Authentication errors** → Run `bankr login` or check `bankr whoami` (CLI), or verify your `X-API-Key` header (REST API) - **Insufficient balance** → Add funds or reduce amount - **Token not found** → Verify symbol and chain - **Transaction reverted** → Check parameters and balances @@ -684,12 +752,22 @@ bun install -g @bankr/cli ### Authentication Issues +**CLI:** ```bash # Check current auth bankr whoami # Re-authenticate bankr login + +# Check LLM key specifically +bankr config get llmKey +``` + +**REST API:** +```bash +# Test your API key +curl -s "https://api.bankr.bot/_health" -H "X-API-Key: $BANKR_API_KEY" ``` ### API Errors @@ -698,10 +776,10 @@ See [references/error-handling.md](references/error-handling.md) for comprehensi ### Getting Help -1. Check error message in CLI output -2. Run `bankr whoami` to verify auth +1. Check error message in CLI output or API response +2. Run `bankr whoami` to verify auth (CLI) or test with a curl to `/_health` (REST API) 3. Consult relevant reference document -4. Test with simple queries first (`bankr prompt "What is my balance?"`) +4. Test with simple queries first (`bankr prompt "What is my balance?"` or `POST /agent/prompt`) --- diff --git a/bankr/references/api-workflow.md b/bankr/references/api-workflow.md index f2a80c82..857ccf47 100644 --- a/bankr/references/api-workflow.md +++ b/bankr/references/api-workflow.md @@ -4,7 +4,7 @@ Understanding the asynchronous job pattern for Bankr API operations. **Source**: [Agent API Reference](https://www.notion.so/Agent-API-2e18e0f9661f80cb83ccfc046f8872e3) -## Using the Bankr CLI (Recommended) +## Option 1: Bankr CLI (Recommended) The Bankr CLI handles the full submit-poll-complete workflow automatically: @@ -25,7 +25,11 @@ bankr status bankr cancel ``` -The CLI manages authentication, job polling, status updates, and error handling out of the box. The raw API details below are provided for reference. +The CLI manages authentication, job polling, status updates, and error handling out of the box. + +## Option 2: REST API (Direct) + +Call the endpoints below directly using `curl`, `fetch`, or any HTTP client. All requests require an `X-API-Key` header with your Bankr API key. ## Core Pattern: Submit-Poll-Complete diff --git a/bankr/references/error-handling.md b/bankr/references/error-handling.md index a88f354a..277ce5f3 100644 --- a/bankr/references/error-handling.md +++ b/bankr/references/error-handling.md @@ -183,6 +183,9 @@ bankr login # Or set API key directly bankr config set apiKey bk_your_key_here +# Set separate LLM key (optional, falls back to API key) +bankr config set llmKey your_llm_key_here + # Verify bankr whoami ``` @@ -192,6 +195,18 @@ The CLI stores config at `~/.bankr/config.json`. You can view or update it: ```bash bankr config get bankr config set apiKey bk_new_key_here +bankr config set llmKey your_llm_key_here +``` + +### REST API Authentication +If using the API directly without the CLI: +```bash +# Test your API key +curl -s "https://api.bankr.bot/_health" -H "X-API-Key: $BANKR_API_KEY" + +# Use env vars +export BANKR_API_KEY=bk_your_key_here +export BANKR_LLM_KEY=your_llm_key_here # optional, for LLM gateway ``` ## User-Friendly Error Messages diff --git a/bankr/references/llm-gateway.md b/bankr/references/llm-gateway.md new file mode 100644 index 00000000..9ae7a379 --- /dev/null +++ b/bankr/references/llm-gateway.md @@ -0,0 +1,286 @@ +# LLM Gateway Reference + +The Bankr LLM Gateway is a unified API for Claude, Gemini, GPT, and other models. It provides multi-provider access, cost tracking, automatic failover, and SDK compatibility through a single endpoint. + +**Base URL:** `https://llm.bankr.bot` + +The gateway accepts both `https://llm.bankr.bot` and `https://llm.bankr.bot/v1` — it normalizes paths automatically. Works with both OpenAI and Anthropic API formats. + +## Authentication + +The gateway uses your **LLM key** for authentication. The key resolution order: + +1. `BANKR_LLM_KEY` environment variable +2. `llmKey` in `~/.bankr/config.json` +3. Falls back to your Bankr API key (`BANKR_API_KEY` / `apiKey`) + +Most users only need a single key for both the agent API and the LLM gateway. Set a separate LLM key only if your keys have different permissions or rate limits. + +### Setting the LLM Key + +**Via CLI:** +```bash +bankr login --llm-key YOUR_LLM_KEY # during login +bankr config set llmKey YOUR_LLM_KEY # after login +``` + +**Via environment variable:** +```bash +export BANKR_LLM_KEY=your_llm_key_here +``` + +**Verify:** +```bash +bankr config get llmKey +``` + +## Available Models + +| Model | Provider | Best For | +|-------|----------|----------| +| `claude-opus-4.6` | Anthropic | Most capable, advanced reasoning | +| `claude-opus-4.5` | Anthropic | Complex reasoning, architecture | +| `claude-sonnet-4.5` | Anthropic | Balanced speed and quality | +| `claude-haiku-4.5` | Anthropic | Fast, cost-effective | +| `gemini-3-pro` | Google | Long context (2M tokens) | +| `gemini-3-flash` | Google | High throughput | +| `gemini-2.5-pro` | Google | Long context, multimodal | +| `gemini-2.5-flash` | Google | Speed, high throughput | +| `gpt-5.2` | OpenAI | Advanced reasoning | +| `gpt-5.2-codex` | OpenAI | Code generation | +| `gpt-5-mini` | OpenAI | Fast, economical | +| `gpt-5-nano` | OpenAI | Ultra-fast, lowest cost | +| `kimi-k2.5` | Moonshot AI | Long-context reasoning | +| `qwen3-coder` | Alibaba | Code generation, debugging | + +```bash +# Fetch live model list from the gateway +bankr llm models +``` + +## Credits + +Check your LLM gateway credit balance: + +```bash +bankr llm credits +``` + +Returns your remaining USD credit balance. When credits are exhausted, gateway requests will fail with HTTP 402. + +## Tool Integrations + +### OpenClaw + +Auto-install the Bankr provider into your OpenClaw config: + +```bash +# Write config to ~/.openclaw/openclaw.json +bankr llm setup openclaw --install + +# Preview the config without writing +bankr llm setup openclaw +``` + +This writes the following provider config (with your key and all available models): + +```json +{ + "models": { + "providers": { + "bankr": { + "baseUrl": "https://llm.bankr.bot", + "apiKey": "your_key_here", + "api": "openai-completions", + "models": [ + { "id": "claude-sonnet-4.5", "name": "Claude Sonnet 4.5", "api": "anthropic-messages" }, + { "id": "claude-haiku-4.5", "name": "Claude Haiku 4.5", "api": "anthropic-messages" }, + { "id": "gemini-3-flash", "name": "Gemini 3 Flash" }, + { "id": "gpt-5.2", "name": "GPT 5.2" } + ] + } + } + } +} +``` + +Claude models are automatically configured with `"api": "anthropic-messages"` per-model overrides while all other models use the default `"api": "openai-completions"`. + +To use a Bankr model as your default in OpenClaw, add to `openclaw.json`: + +```json +{ + "agents": { + "defaults": { + "model": { + "primary": "bankr/claude-sonnet-4.5" + } + } + } +} +``` + +### Claude Code + +Two ways to use Claude Code with the gateway: + +**Option A: Launch directly (recommended)** + +```bash +# Launch Claude Code through the gateway +bankr llm claude + +# Pass any Claude Code flags through +bankr llm claude --model claude-sonnet-4.5 +bankr llm claude --allowedTools Edit,Write,Bash +bankr llm claude --resume +``` + +All arguments after `claude` are forwarded to the `claude` binary. The CLI sets `ANTHROPIC_BASE_URL` and `ANTHROPIC_AUTH_TOKEN` automatically from your config (using `llmKey` if set, otherwise `apiKey`). + +**Option B: Set environment variables** + +```bash +# Print the env vars to add to your shell profile +bankr llm setup claude +``` + +This outputs: +```bash +export ANTHROPIC_BASE_URL="https://llm.bankr.bot" +export ANTHROPIC_AUTH_TOKEN="your_key_here" +``` + +Add these to `~/.zshrc` or `~/.bashrc` so all Claude Code sessions use the gateway. + +### OpenCode + +```bash +# Auto-install Bankr provider into ~/.config/opencode/opencode.json +bankr llm setup opencode --install + +# Preview without writing +bankr llm setup opencode +``` + +### Cursor + +```bash +# Get step-by-step setup instructions +bankr llm setup cursor +``` + +This prints guided instructions for: +1. Enter your API key under **OpenAI API Key** +2. Enable **Override OpenAI Base URL** and set `https://llm.bankr.bot/v1` +3. Add model IDs (`claude-sonnet-4.5`, `gemini-3-flash`, etc.) + +**Note:** When Override Base URL is enabled, ALL model requests go through the gateway. Disable other models you don't need to avoid validation errors. + +## Direct SDK Usage + +The gateway is compatible with standard OpenAI and Anthropic SDKs — just override the base URL. + +### curl (OpenAI format) + +```bash +curl -X POST "https://llm.bankr.bot/v1/chat/completions" \ + -H "Authorization: Bearer $BANKR_LLM_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "claude-sonnet-4.5", + "messages": [{"role": "user", "content": "Hello"}] + }' +``` + +### curl (Anthropic format) + +```bash +curl -X POST "https://llm.bankr.bot/v1/messages" \ + -H "x-api-key: $BANKR_LLM_KEY" \ + -H "anthropic-version: 2023-06-01" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "claude-sonnet-4.5", + "max_tokens": 1024, + "messages": [{"role": "user", "content": "Hello"}] + }' +``` + +### OpenAI SDK (Python) + +```python +from openai import OpenAI + +client = OpenAI( + base_url="https://llm.bankr.bot/v1", + api_key="your_bankr_key", +) + +response = client.chat.completions.create( + model="claude-sonnet-4.5", + messages=[{"role": "user", "content": "Hello"}], +) +``` + +### OpenAI SDK (TypeScript) + +```typescript +import OpenAI from "openai"; + +const client = new OpenAI({ + baseURL: "https://llm.bankr.bot/v1", + apiKey: "your_bankr_key", +}); + +const response = await client.chat.completions.create({ + model: "gemini-3-flash", + messages: [{ role: "user", content: "Hello" }], +}); +``` + +### Anthropic SDK (Python) + +```python +from anthropic import Anthropic + +client = Anthropic( + base_url="https://llm.bankr.bot", + api_key="your_bankr_key", +) + +message = client.messages.create( + model="claude-sonnet-4.5", + max_tokens=1024, + messages=[{"role": "user", "content": "Hello"}], +) +``` + +## Troubleshooting + +### 401 Unauthorized +- Verify key is set: `bankr config get llmKey` or `echo $BANKR_LLM_KEY` +- Check for leading/trailing spaces +- Ensure the key hasn't expired + +### 402 Payment Required +- Credits exhausted: `bankr llm credits` shows $0.00 +- Top up credits at [bankr.bot/api](https://bankr.bot/api) + +### Model not found +- Use exact model IDs (e.g., `claude-sonnet-4.5`, not `claude-3-sonnet`) +- Check available models: `bankr llm models` + +### Claude Code not found +- `bankr llm claude` requires Claude Code to be installed separately +- Install: https://docs.anthropic.com/en/docs/claude-code + +### Slow responses +- Try `claude-haiku-4.5` or `gemini-3-flash` for faster responses +- The gateway has automatic failover — temporary slowness usually resolves itself + +--- + +**Documentation**: https://docs.bankr.bot/llm-gateway/overview +**Credit Balance**: `bankr llm credits` +**Model List**: `bankr llm models` From f1d228588badf124e929ef721149085b935c319a Mon Sep 17 00:00:00 2001 From: sidrisov Date: Tue, 10 Feb 2026 23:53:01 +0400 Subject: [PATCH 7/7] docs(bankr): shorten skill description and trim redundant sections Condense the skill description to ~400 chars (was 620), remove duplicated OpenClaw setup block, inline LLM key config instructions, and reduce verbosity across all four reference files. --- bankr/SKILL.md | 51 ++++-------------------------- bankr/references/api-workflow.md | 31 ++++++------------ bankr/references/error-handling.md | 16 ++-------- bankr/references/llm-gateway.md | 11 ++----- 4 files changed, 20 insertions(+), 89 deletions(-) diff --git a/bankr/SKILL.md b/bankr/SKILL.md index 1734340b..73332874 100644 --- a/bankr/SKILL.md +++ b/bankr/SKILL.md @@ -1,6 +1,6 @@ --- name: bankr -description: AI-powered crypto trading agent via natural language. Use when the user wants to trade crypto (buy/sell/swap tokens), check portfolio balances, view token prices, transfer crypto, manage NFTs, use leverage, bet on Polymarket, deploy tokens, set up automated trading strategies, submit raw transactions, execute calldata, or send transaction JSON. Supports Base, Ethereum, Polygon, Solana, and Unichain. Comprehensive capabilities include trading, portfolio management, market research, NFT operations, prediction markets, leverage trading, DeFi operations, automation, and arbitrary transaction submission. +description: AI-powered crypto trading agent and LLM gateway via natural language. Use when the user wants to trade crypto, check portfolio balances, view token prices, transfer crypto, manage NFTs, use leverage, bet on Polymarket, deploy tokens, set up automated trading, sign and submit raw transactions, or access LLM models through the Bankr LLM gateway funded by your Bankr wallet. Supports Base, Ethereum, Polygon, Solana, and Unichain. metadata: { "clawdbot": @@ -63,19 +63,7 @@ The `bankr login` command gives you two choices: #### Separate LLM Gateway Key (Optional) -If your LLM gateway key differs from your Bankr API key, you can set them separately. During interactive login the CLI will ask if you want a different LLM key. You can also pass it directly: - -```bash -bankr login --api-key bk_YOUR_KEY --llm-key YOUR_LLM_KEY -``` - -Or set it via config: - -```bash -bankr config set llmKey YOUR_LLM_KEY -``` - -When not set, the API key is used for both the agent API and the LLM gateway. +If your LLM gateway key differs from your API key, pass `--llm-key` during login or run `bankr config set llmKey YOUR_LLM_KEY` afterward. When not set, the API key is used for both. See [references/llm-gateway.md](references/llm-gateway.md) for full details. #### Non-Interactive Login (for AI agents) @@ -139,30 +127,24 @@ echo "$RESULT" | jq -r '.response' ### Conversation Threads -Every prompt response (and completed job) includes a `threadId`. Save it and pass it back to continue the conversation — the agent remembers context from earlier messages in the same thread. +Every prompt response includes a `threadId`. Pass it back to continue the conversation: ```bash -# Start a conversation — save the threadId from the response +# Start — the response includes a threadId curl -X POST "https://api.bankr.bot/agent/prompt" \ -H "X-API-Key: $BANKR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"prompt": "What is the price of ETH?"}' # → {"jobId": "job_abc", "threadId": "thr_XYZ", ...} -# Continue it — pass threadId to maintain context +# Continue — pass threadId to maintain context curl -X POST "https://api.bankr.bot/agent/prompt" \ -H "X-API-Key: $BANKR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"prompt": "And what about SOL?", "threadId": "thr_XYZ"}' - -# Continue further — same threadId -curl -X POST "https://api.bankr.bot/agent/prompt" \ - -H "X-API-Key: $BANKR_API_KEY" \ - -H "Content-Type: application/json" \ - -d '{"prompt": "Compare them", "threadId": "thr_XYZ"}' ``` -Omit `threadId` to start a new conversation. The CLI equivalent is `bankr prompt --continue` (reuses last thread) or `bankr prompt --thread `. +Omit `threadId` to start a new conversation. CLI equivalent: `bankr prompt --continue` (reuses last thread) or `bankr prompt --thread `. ### API Endpoints Summary @@ -317,27 +299,6 @@ bankr llm claude # Launch Claude Code through gateway bankr llm claude --model claude-opus-4.6 # Launch with specific model ``` -### OpenClaw Provider Setup - -```bash -# Auto-install — writes provider config to ~/.openclaw/openclaw.json -bankr llm setup openclaw --install -``` - -To use a Bankr model as your default, add to `openclaw.json`: - -```json -{ - "agents": { - "defaults": { - "model": { - "primary": "bankr/claude-sonnet-4.5" - } - } - } -} -``` - ### Direct SDK Usage The gateway works with standard OpenAI and Anthropic SDKs — just override the base URL: diff --git a/bankr/references/api-workflow.md b/bankr/references/api-workflow.md index 857ccf47..b5b1a683 100644 --- a/bankr/references/api-workflow.md +++ b/bankr/references/api-workflow.md @@ -4,36 +4,23 @@ Understanding the asynchronous job pattern for Bankr API operations. **Source**: [Agent API Reference](https://www.notion.so/Agent-API-2e18e0f9661f80cb83ccfc046f8872e3) -## Option 1: Bankr CLI (Recommended) +## Using the Bankr CLI -The Bankr CLI handles the full submit-poll-complete workflow automatically: +The CLI handles submit-poll-complete automatically. For installation and login, see the main [SKILL.md](../SKILL.md). ```bash -# Install -bun install -g @bankr/cli - -# Authenticate -bankr login - -# Submit a prompt (handles polling and completion automatically) -bankr prompt "What is my ETH balance?" - -# Check status of a specific job -bankr status - -# Cancel a running job -bankr cancel +bankr prompt "What is my ETH balance?" # submit + poll + display +bankr status # check a specific job +bankr cancel # cancel a running job ``` -The CLI manages authentication, job polling, status updates, and error handling out of the box. - -## Option 2: REST API (Direct) +## Using the REST API Directly -Call the endpoints below directly using `curl`, `fetch`, or any HTTP client. All requests require an `X-API-Key` header with your Bankr API key. +Call the endpoints below with `curl`, `fetch`, or any HTTP client. All requests require an `X-API-Key` header. -## Core Pattern: Submit-Poll-Complete +### Core Pattern: Submit-Poll-Complete -All Bankr operations follow this pattern: +All operations follow this pattern: ``` 1. SUBMIT → Send prompt, get job ID diff --git a/bankr/references/error-handling.md b/bankr/references/error-handling.md index 277ce5f3..bc60e0cf 100644 --- a/bankr/references/error-handling.md +++ b/bankr/references/error-handling.md @@ -190,24 +190,14 @@ bankr config set llmKey your_llm_key_here bankr whoami ``` -### Config File Location -The CLI stores config at `~/.bankr/config.json`. You can view or update it: -```bash -bankr config get -bankr config set apiKey bk_new_key_here -bankr config set llmKey your_llm_key_here -``` +Config is stored at `~/.bankr/config.json`. View current values with `bankr config get`. ### REST API Authentication -If using the API directly without the CLI: +If using the API directly without the CLI, test your key with: ```bash -# Test your API key curl -s "https://api.bankr.bot/_health" -H "X-API-Key: $BANKR_API_KEY" - -# Use env vars -export BANKR_API_KEY=bk_your_key_here -export BANKR_LLM_KEY=your_llm_key_here # optional, for LLM gateway ``` +Set `BANKR_API_KEY` (and optionally `BANKR_LLM_KEY` for the LLM gateway) as environment variables. ## User-Friendly Error Messages diff --git a/bankr/references/llm-gateway.md b/bankr/references/llm-gateway.md index 9ae7a379..d70669c0 100644 --- a/bankr/references/llm-gateway.md +++ b/bankr/references/llm-gateway.md @@ -166,16 +166,11 @@ bankr llm setup opencode ### Cursor ```bash -# Get step-by-step setup instructions +# Get step-by-step setup instructions with your API key bankr llm setup cursor ``` -This prints guided instructions for: -1. Enter your API key under **OpenAI API Key** -2. Enable **Override OpenAI Base URL** and set `https://llm.bankr.bot/v1` -3. Add model IDs (`claude-sonnet-4.5`, `gemini-3-flash`, etc.) - -**Note:** When Override Base URL is enabled, ALL model requests go through the gateway. Disable other models you don't need to avoid validation errors. +The setup adds your key as the OpenAI API Key, sets `https://llm.bankr.bot/v1` as the base URL override, and registers the available model IDs. When the base URL override is enabled, all model requests go through the gateway. ## Direct SDK Usage @@ -282,5 +277,3 @@ message = client.messages.create( --- **Documentation**: https://docs.bankr.bot/llm-gateway/overview -**Credit Balance**: `bankr llm credits` -**Model List**: `bankr llm models`