Cofounder

Import a Repo and Ship a Change

Connect your existing code to the company, work on it locally, and deploy a change.

Connect your existing codebase to the company so your agents can work on it locally and ship changes to your live app.

Steps

Pick Your Code Source Before Setup

For a new company with an existing GitHub repository, run cofounder company setup --repository-source github (MCP: company_setup_start with repository_source: "github"). Wait for setup to finish. Hosting and the database get set up without a starter repository. To upload a local folder instead, pick the local-folder option in Managed Setup.

Connect GitHub and Import

Tell your agent to import your repo. It runs cofounder repo import --wait or code_repository_import_start without a repository name, follows the returned call until it finishes, and gives you a link to connect GitHub.

  • If your agent's app supports MCP events, your agent listens for the returned step's resume_event before giving you the link, and resumes the import once GitHub access is ready. Otherwise, go back to your agent after connecting, or run the CLI command again.
  • Your agent selects a repository automatically only when the first page contains one repository you can write to and there are no more pages. Otherwise, choose one with cofounder repo import <owner/repo> --wait. Your agent follows page.next_cursor even after a short or empty page. To see more, use the repository paging options.
  • Review the suggested app folder and build settings, then run cofounder repo import continue --wait to set up the existing Vercel project for that app. Check progress with cofounder repo import status.

A standard single-app import doesn't need GitHub connected in Vercel. If an older company's import reports awaiting_vercel_link, follow the Git settings instructions it returns, then continue.

Empty repositories can finish importing too. Hosting defaults to Next.js, and no sandbox base is prepared. Push code to the default branch before deploying. For another framework or a sandbox base, rerun import and continue after the push, before deploying; see Bring Your Own Repository.

Importing does not deploy. Follow its next_steps to fix build or runtime errors, set up Vercel and Supabase, request missing secrets safely, and check the deployed app.

Clone and Look Around

Imported repositories can't get Cofounder SSH access. cofounder repo clone clones over HTTPS with short-lived tokens, which needs the Cofounder GitHub App installed on the repository. For desktop MCP work, use code_desktop_push_token_create instead. In a Cofounder sandbox, use its configured Git credentials. Inside the clone, cofounder repo status shows the production branch, the last production deploy, and every open PR.

Make the Change

Branch, commit, and push. A clone made with cofounder repo clone gets a fresh token from the CLI for each push. When a different agent takes over, repo handoff marks the branch for it.

Deploy

Your agent ships with hosting_deploy / cofounder hosting deploy / POST /cofounder-cli/v1/company/repository/deploy. It follows the rollout with hosting_deployments_get and checks hosting_deployments_readiness_get before calling it done.

If Something Goes Wrong

  • If GitHub approval is pending, ask your GitHub organization admin to approve access, then check again in the dashboard. The dashboard can find access that's already been approved. If the access link expires, retry the import to get a new one.
  • If the repo is in a different GitHub installation, finish connecting in the dashboard to give access to this repository. The import remembers that installation and keeps the company's existing GitHub connection for other repositories.
  • If the import never finishes, repo import status names what's blocking it, and cofounder code repository-import cancel --idempotency-key cancel-import-1 --wait cancels it. After an import, cofounder repo disconnect --wait brings back the previous managed repository if there was one. GitHub-first setup has no starter repo to bring back. Hosting and the database stay ready for another import.
  • If the deploy succeeded but the app shows errors, hosting_deployments_events has the build and runtime logs.
  • If the database schema is out of sync, cofounder database migrations list shows what's been applied, and database migrations apply runs what's pending.