How ramananbuilds/anygate works
anygate is a CLI and visual launcher for configuring model providers, launching coding agents against selected models, and exposing local compatible API gateways. The principal workflow is provider setup, model selection, agent launch, and—optionally—gateway request routing to an upstream provider. Distinct branches cover provider/auth management, supported agent integrations, gateway serving, and the browser UI. Relationships are limited to README statements and the supplied source excerpts/index; some UI-to-backend and unsampled integration links are therefore omitted.
Main entry points: router.ts Request routing · launch.ts Shared launch support · server.ts Gateway server · provider-catalog.ts Provider catalog
Components 27
User entry points
- CLI commands
src/cli/index.ts - CLI handlers
src/cli.ts
Providers and auth
- Provider catalog
src/registry/provider-catalog.ts - Provider import
src/registry/loader/import-build.ts - Provider authentication
src/registry/provider-auth.ts - OpenCode OAuth
src/registry/opencode-auth.ts - Provider configuration
src/storage/config.ts
Agent launch
- Shared launch support
src/apps/shared/launch.ts - Claude integrations
src/apps/claude/desktop.ts - Codex app launch
src/apps/codex/app.ts - Gemini integrations
src/apps/gemini/launch.ts - Context sizing
src/apps/shared/context-window.ts - Cloud Code backend
src/apps/shared/cloud-code-backend.ts
API gateways
- Gateway setup
src/cli/server.ts - Gateway server
src/gateway/server/server.ts - Request routing
src/gateway/server/router.ts - Model catalog
src/gateway/server/models.ts - SDK provider factory
src/gateway/providers/provider-factory.ts - SDK adapter
src/gateway/adapters/sdk-adapter.ts - Anthropic proxy
src/gateway/proxy/anthropic-proxy.ts - OpenCode gateway
src/providers/opencode-gate.ts - Request trace log
src/apps/shared/trace-log.ts
Browser interface
- Visual launcher
src/ui/app/src/App.svelte - Launch selection
src/ui/app/src/routes/Apps.svelte - Server controls
src/ui/app/src/lib/stores/server.svelte.ts - UI API client
src/ui/app/src/lib/api/endpoints.ts
Other components
- User
Connections 27
- User → CLI commands: runs commands
- CLI commands → CLI handlers: dispatches
src/cli/index.ts - User → Provider catalog: configures providers
- Provider catalog → Provider configuration: stores configuration
- Provider import → Provider catalog: imports provider data
- Provider authentication → OpenCode OAuth: uses credentials
src/registry/provider-auth.ts - User → Shared launch support: selects model
- Shared launch support → Claude integrations: launches Claude
- Shared launch support → Codex app launch: launches Codex
- Shared launch support → Gemini integrations: launches Gemini
- Codex app launch → Context sizing: resolves context
src/apps/codex/app.ts - Codex app launch → Cloud Code backend: starts backend
src/apps/codex/app.ts - User → Gateway setup: starts gateway
- Gateway setup → Gateway server: starts server
src/cli/server.ts - Gateway server → Provider catalog: loads catalog
src/gateway/server/server.ts - Gateway server → Model catalog: builds catalog
src/gateway/server/server.ts - Gateway server → Request routing: starts routing
src/gateway/server/server.ts - Request routing → SDK provider factory: creates model
src/gateway/server/router.ts - Request routing → SDK adapter: streams response
src/gateway/server/router.ts - Request routing → Anthropic proxy: forwards requests
- SDK provider factory → OpenCode gateway: wraps Zen fetch
src/gateway/providers/provider-factory.ts - Request routing → Request trace log: writes traces
src/gateway/server/router.ts - User → Visual launcher: opens dashboard
- Visual launcher → Launch selection: shows launch route
src/ui/app/src/App.svelte - Launch selection → Shared launch support: requests launch
- Visual launcher → Server controls: tracks server
src/ui/app/src/App.svelte - Server controls → UI API client: calls endpoints
src/ui/app/src/lib/stores/server.svelte.ts