Cofounder

Database

Query your app's database, change rows and schema, ship functions, try changes on a branch, set up social sign-in, and move files in and out of storage.

Your app runs on a Supabase database that Cofounder manages. Your agent queries it, changes its schema, deploys functions, and manages files, all through your Cofounder login. You never handle database passwords or keys.

Your agent works on the company's default database and on production unless you name another database or a branch.

Query It

Ask your agent a question about your data and it runs the query:

cofounder database query "select count(*) from profiles"

Queries are read-only; statements that change data are rejected. Use migrations for schema changes.

For row changes, use structured JSON operations with cofounder database execute. This runs as the database service role and bypasses row-level security (RLS). Update and delete operations require equality filters and return the affected rows. Select limits above 1000 are clamped to 1000.

cofounder database execute --operation select --table profiles --column id --limit 20
cofounder database execute --operation update --table profiles --filters '{"id":"profile-123"}' --values '{"display_name":"Ada Lovelace"}' --yes

Inspect and Verify

Use cofounder database schema get to list tables and columns, then cofounder database types generate after schema changes. Check security or performance findings with cofounder database advisors list --kind security and service health with cofounder database status get. Query logs with cofounder database logs query using ClickHouse SQL against the unified logs table. Filter with source = '<source>', such as source = 'postgres_logs', and use log_attributes['key'] for nested fields. Query windows can span at most 24 hours. Omit both start and end to query only the last minute, and add a LIMIT clause to bound the result rows.

Change the Schema

Your agent writes migrations, commits them to your repository, and applies them. Only migrations committed to the repository run, never files on someone's machine. Production is the default target. Your agent can apply to staging first and preview a run without changing anything. Every deploy also runs migrations (see Deploy).

Try Changes on a Branch

A branch is a separate copy of your database for trying changes without touching production. A branch can be tied to a branch of your repository. Your agent can query, migrate, deploy functions, set secrets, and manage storage on a branch. Branches are billed under the company's existing database billing.

Preview changes with cofounder database branches diff --branch <name> before merging. Merge applies the branch's migrations to the parent project. Merge and reset run asynchronously, so poll cofounder database branches get --branch <name> for status. Reset discards the branch's changes and restores its schema to production.

cofounder database branches diff --branch feature
cofounder database branches merge --branch feature --yes
cofounder database branches get --branch feature
cofounder database branches reset --branch feature --yes

Deploy Functions and Their Secrets

Edge Functions are server code that runs next to your database. Your agent deploys the function committed to your repository under a given name, to staging or production. Local files aren't read. Deploys take a moment, and your agent waits for the result. A function with no committed source, or one Supabase rejects, fails with the reason. Success confirms that Supabase lists the deployed version. If confirmation fails or deployment is interrupted, inspect the function before requesting another deployment: the upload may already have completed. A function can be set to accept calls without an auth token.

Your agent can set function secrets, and listing them shows names only, never values.

Delete one deployed function with cofounder database functions delete --function-slug <name> --environment staging or use prod for the managed database's production project. The function source stays in your repository, so you can deploy it again later. The command returns already_absent only after the selected project confirms the slug is missing.

To enter a secret yourself, open Settings → Secrets in the dashboard and use Edge Function secrets under the database. Your agent gives you the link, with the database already selected, and confirms the names after you save.

Set Up Social Sign-In

Let your app's users sign in with an account they already have. Supported providers: bitbucket, discord, facebook, figma, github, google, kakao, linkedin_oidc, notion, slack, slack_oidc, spotify, twitch, twitter, x, and zoom. Use x for X's current OAuth 2.0 sign-in. twitter is its legacy OAuth 1.0a one. LinkedIn uses linkedin_oidc and Slack's OIDC sign-in uses slack_oidc. Apple, Azure, GitLab, Keycloak, and WorkOS aren't supported yet.

  1. Your agent checks which providers are on and which have credentials.
  2. It sends you a setup link. The link opens sign-in setup on the Secrets page with the database, the provider, and any branch already selected.
  3. You register the callback URL with your OAuth app and save the client ID and secret on that page. Never paste a secret into chat or put one in a link.
  4. Your agent turns sign-in on. Saving credentials doesn't change whether sign-in is on, and your agent can turn it off again.

Changing one provider keeps saved credentials, other providers, and email/password and SMTP settings. Your agent sees whether a secret is set, never its value. It reads the settings back after a change but doesn't test a sign-in. Sign-in email redirects and SMTP are set up under cofounder email auth.

Move Files In and Out of Storage

Storage holds your app's files, organized in buckets. Paths look like ss:///<bucket>/<path>.

Create a bucket before uploading files. Buckets are private by default. Use --public only when anyone with an object URL should be able to download it. You can limit upload sizes with --file-size-limit in bytes and restrict file types with repeatable --allowed-mime-type flags.

cofounder database storage buckets create --bucket-id avatars --file-size-limit 1048576 --allowed-mime-type image/png

An existing bucket name returns a conflict and leaves its settings unchanged.

cofounder database storage cp ./logo.png ss:///public/brand/logo.png --content-type image/png
cofounder database storage ls ss:///public/brand
  • Your agent copies one file at a time, up to 50 MiB, in either direction.
  • An existing file isn't overwritten unless your agent asks for that.
  • Moving a file stays within one bucket.

Delete a bucket only after removing the files you intend to delete. A nonempty bucket is refused without deleting any files. A missing bucket returns an error. If a create or delete result is unclear, use cofounder database storage ls with the same --resource and --branch before deciding whether to retry.

cofounder database storage buckets delete --bucket-id avatars

Commands

MCPCLIAPI

Pass --resource with a database's name or id to use another database, and --branch <name> to work on a branch. Check migrations list or branches get before retrying an apply or a branch delete with an unclear result. functions deploy --no-verify-jwt deploys a function that accepts calls without an auth token. Over MCP, database_storage_transfer returns a signed link to upload or download with.