| 262 | } |
| 263 | |
| 264 | async function cmdStatus(port: number): Promise<void> { |
| 265 | try { |
| 266 | const data = (await queryProxy("/health?full=true", port)) as Record<string, unknown>; |
| 267 | console.log(`\nClawRouter Status (port ${port})\n`); |
| 268 | console.log(` Status: ${data.status}`); |
| 269 | console.log(` Payment Chain: ${data.paymentChain}`); |
| 270 | console.log(` EVM Wallet: ${data.wallet}`); |
| 271 | if (data.solana) console.log(` Solana Wallet: ${data.solana}`); |
| 272 | console.log(` Balance: ${data.balance ?? "unknown"}`); |
| 273 | if (data.isLow) console.log(` ⚠ Balance is low`); |
| 274 | if (data.isEmpty) console.log(` ⚠ Balance is empty — using free models`); |
| 275 | if (data.upstreamProxy) console.log(` Upstream Proxy: ${data.upstreamProxy}`); |
| 276 | console.log(); |
| 277 | } catch { |
| 278 | console.error(`✗ Cannot connect to ClawRouter on port ${port}`); |
| 279 | console.error(` Is the proxy running? Start with: npx @blockrun/clawrouter`); |
| 280 | process.exit(1); |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | async function cmdWallet(port: number): Promise<void> { |
| 285 | try { |