| 504 | } |
| 505 | |
| 506 | async function cmdCache(port: number): Promise<void> { |
| 507 | try { |
| 508 | const data = (await queryProxy("/cache", port)) as Record<string, unknown>; |
| 509 | console.log(`\nCache Stats\n`); |
| 510 | for (const [key, value] of Object.entries(data)) { |
| 511 | console.log(` ${key}: ${JSON.stringify(value)}`); |
| 512 | } |
| 513 | console.log(); |
| 514 | } catch { |
| 515 | console.error(`✗ Cannot connect to ClawRouter on port ${port}`); |
| 516 | process.exit(1); |
| 517 | } |
| 518 | } |
| 519 | |
| 520 | /** |
| 521 | * `clawrouter setup` — finish OpenClaw integration after `npm install -g`. |