Skip to content

Cloud Binding Guide

The Cloud Binding (introduced in v0.4) enables cross-developer gene sharing. Publish your genes to a shared registry, discover genes created by others, and compete in a global Arena.

Developer A Cloud Developer B
┌──────────┐ ┌──────────────┐ ┌──────────┐
│ rotifer │ ── publish ──→ │ Supabase │ ←── search ─── │ rotifer │
│ CLI │ ←── search ─── │ ┌────────┐ │ ──→ install ──→ │ CLI │
│ │ ── arena ──→ │ │ Genes │ │ ←── arena ─── │ │
└──────────┘ │ │ Arena │ │ └──────────┘
│ │ Auth │ │
│ └────────┘ │
└──────────────┘
Terminal window
rotifer login

This opens your browser for GitHub OAuth authentication. After authorization, your credentials are stored locally at ~/.rotifer/credentials.json.

First, create and test your gene:

Terminal window
rotifer init my-project && cd my-project
rotifer wrap my-search --domain search.web
rotifer test my-search
rotifer compile my-search

Then publish:

Terminal window
rotifer publish my-search
Terminal window
# Browse all genes
rotifer search
# Search by keyword
rotifer search "web search"
# Filter by domain
rotifer search -d search.web
# Filter by fidelity
rotifer search --fidelity Native
Terminal window
rotifer install <gene-id>

The gene is downloaded to your local genes/ directory and is immediately ready for testing and Arena competition.

Compete with developers worldwide:

Terminal window
# Submit your gene to the global Arena
rotifer arena submit my-search --cloud
# View global rankings
rotifer arena list --cloud
# Watch live ranking changes
rotifer arena watch search.web --cloud

All cloud commands connect to https://rotifer-cloud.supabase.co by default.

For alternative deployments (e.g., self-hosted, regional):

Option 1: Environment variable

Terminal window
export ROTIFER_CLOUD_ENDPOINT=https://your-instance.supabase.co
export ROTIFER_CLOUD_ANON_KEY=your-anon-key

Option 2: Config file (~/.rotifer/cloud.json)

{
"endpoint": "https://your-instance.supabase.co",
"anonKey": "your-anon-key"
}

You can maintain connections to multiple cloud instances:

Terminal window
# Global endpoint (default)
rotifer publish my-gene
# China endpoint
rotifer publish my-gene --endpoint https://rotifer.cloud

The Cloud Binding uses a REST API built on Supabase PostgREST:

EndpointMethodDescription
/rest/v1/genesGETList/search genes
/rest/v1/genesPOSTPublish a gene
/rest/v1/genes?id=eq.{id}GETGet gene by ID
/rest/v1/arena_entriesGETList Arena rankings
/rest/v1/arena_entriesPOSTSubmit Arena entry
/storage/v1/object/gene-wasm/{path}POSTUpload WASM binary
/storage/v1/object/public/gene-wasm/{path}GETDownload WASM binary

Authentication is via Bearer token in the Authorization header.

FieldTypeDescription
idUUIDAuto-generated identifier
owner_idUUIDPublishing user’s ID
nametextGene name
domaintextFunctional domain
versiontextSemantic version
fidelitytextNative / Wrapped / Hybrid
phenotypejsonbFull phenotype metadata
wasm_pathtextStorage path for WASM binary
downloadsbigintDownload count
publishedbooleanVisibility flag
FieldTypeDescription
gene_idUUIDReference to gene
domaintextCompetition domain
fitness_valuefloatF(g) score
safety_scorefloatV(g) score
total_callsintegerEvaluation count
  • Row Level Security (RLS) — Users can only modify their own genes
  • PKCE OAuth — Secure token exchange (no client secrets in CLI)
  • WASM Storage — Public read, authenticated write
  • Input Validation — Server-side schema validation via PostgREST
Terminal window
rotifer login # Re-authenticate

The gene ID is a UUID. Make sure you’re using the full ID from rotifer search.

Large WASM files (>1MB) may take time to upload. Consider optimizing your gene’s bundle size by:

  • Minimizing dependencies
  • Using tree-shaking in the compilation pipeline
  • Splitting large genes into smaller, composable units