Files
zeekay cacc1f4d92 rebrand clawhub → bothub + add self-hosted API backend
Migration from Convex/Vercel to self-hosted infrastructure:

API Backend (api/):
- Hono server with PostgreSQL (Drizzle ORM) + pgvector
- Skills CRUD, search (hybrid vector + lexical), auth (hanzo.id OAuth)
- Upload (MinIO S3), stars, comments, API tokens
- Rate limiting middleware, session management

Frontend Adapter (src/lib/):
- api.ts: REST API client replacing Convex SDK
- hooks.ts: React hooks replacing convex/react useQuery/useMutation
- AuthContext.tsx: Auth provider replacing ConvexAuthProvider

Deployment:
- Dockerfile (multi-stage: API build + web build + production)
- K8s manifests for hub.hanzo.bot on hanzo-k8s
- GitHub Actions CI/CD (build → GHCR → deploy)

Rebrand:
- clawhub/clawdhub/ClawHub → bothub/Bot Hub
- Domain: clawhub.ai → hub.hanzo.bot
- CLI: clawhub → bothub
- Package: @hanzo/bot-hub-api
2026-02-16 19:36:19 -08:00

1.3 KiB

summary, read_when
summary read_when
Auth overview: GitHub OAuth (web) + API tokens (CLI).
Working on login/token flows
Debugging 401s

Auth

Web auth (GitHub OAuth)

  • Convex Auth + GitHub OAuth App.
  • GitHub is the only supported login provider.
  • Env vars:
    • AUTH_GITHUB_ID
    • AUTH_GITHUB_SECRET
    • CONVEX_SITE_URL (used by auth config)

Local setup steps are in the repo root README.md.

API tokens (CLI)

The CLI uses a long-lived API token (Bearer token) for publish/sync/delete.

Browser flow (default)

bothub login does:

  1. Starts a loopback HTTP server on 127.0.0.1 (random port).
  2. Opens <site>/cli/auth?redirect_uri=http://127.0.0.1:<port>/callback&state=....
  3. Web UI requires GitHub login, then creates a token and redirects back to the loopback server.
  4. CLI stores the token in the global config file.

Headless flow

Create a token in the web UI (Settings → API tokens) and paste it:

bothub login --token clh_...

Token storage

Default global config path:

  • macOS: ~/Library/Application Support/bothub/config.json

Override:

  • BOTHUB_CONFIG_PATH=/path/to/config.json (legacy CLAWDHUB_CONFIG_PATH)

Revocation

  • Tokens can be revoked in the web UI.
  • Revoked tokens return 401 Unauthorized on CLI endpoints.