Once your GitHub account is connected, you can export your project and keep it in sync as your app evolves.
Exporting for the first time
If you haven't connected GitHub yet, follow the steps in GitHub Export – Overview & Setup first.
When you complete the GitHub authorization flow, your first export is queued automatically. Caffeine shows a confirmation dialog titled "Export queued" with a message confirming your code will be synced to GitHub within a few minutes. The repository is created and the initial commit is pushed in the background.
Choosing a repository name:
Before the first export, you can type a name for the repository. The field is pre-filled with a sanitized version of your project name. Repository names can only contain lowercase letters, numbers, and hyphens, and must be 100 characters or fewer.
Exporting again after changes
Every time the AI builds a new version of your app, you can push that version to GitHub:
- Click the project name button in the chat header to open the actions menu.
- Select Export to GitHub.
- Click Sync to GitHub.
After you click, Caffeine queues the export and shows a confirmation dialog titled "Queued for export to GitHub" with the message "Your changes will typically be exported to GitHub within 5 minutes." This means the export has been accepted but is not yet complete — it runs in the background while you keep working. Caffeine also posts a message in your chat confirming the export has been queued, along with the repository URL. When the export finishes, another message appears in chat to confirm it completed successfully. If something goes wrong, you will also see a message in chat explaining what happened with a prompt to try again.
While an export or import is in progress
When a GitHub export or import is running, the GitHub settings panel shows a spinning indicator and the message "Export to GitHub is in progress…" or "Import from GitHub is in progress…". The action buttons — Sync to GitHub, Disconnect, and Import from GitHub — are disabled while the operation is running, so you cannot accidentally start a second one at the same time.
Once the operation finishes, the indicator disappears and the buttons become active again. You do not need to keep the panel open — the status is tracked on Caffeine's side, so it reflects accurately even if you close and reopen the settings.
Caffeine pushes a new commit to the main branch of your repository. No new branch is created — all commits go to main. If the new build produced no file changes compared to the previous export, no commit is created.
Each export creates a single commit. For subsequent exports, Caffeine automatically writes a commit message that summarizes what changed, based on your recent conversation and the updated specification. This means your commit history gives a readable account of how the app developed.
Branch and repository structure
All exports target the main branch. Caffeine does not create separate feature branches or tags.
The files in the repository are organized exactly as Caffeine generates them:
- Backend code is in
src/backend/ - Frontend code is in
src/frontend/ - The app specification is at
src/spec.md - Image and asset files are in
frontend/public/assets/
Exporting to an existing repository
If you type the name of a repository that already exists in your GitHub account, Caffeine will push a new commit on top of the existing history rather than creating a new repository. This is useful if you want to maintain continuity with a repository you've already been working with.
What happens in GitHub
Each export creates one commit in your repository. You can view the full commit history in GitHub — including the AI-written commit messages — to see how your app has changed over time. The code in the repository is standard Motoko (backend) and React/TypeScript (frontend), so you can browse, clone, or fork it like any other GitHub repository.
Keeping your repository up to date
Caffeine does not automatically push to your personal GitHub repository when a new build completes. Each sync is triggered manually by clicking Sync to GitHub. If you want to keep GitHub in sync with your latest build, remember to push after each session.
Importing code from GitHub
There are two ways to import from GitHub:
Round-trip import — if your project is connected to a GitHub repository (because you exported it), Import from GitHub pulls code back from that repository. This is useful when you have edited the exported code directly in GitHub and want to bring those changes back.
Import any repository — if your project is not connected to a repository, you can import any repository that the Caffeine GitHub App can access, without a prior export. This works for a new empty project as well as an existing one. See Downloading and Uploading Your Project Code for how to start an empty project.
GitHub Import needs a paid plan or at least one payment on your account, such as a top-up. See Who can use this. Each import costs $0.25. The repository must follow Caffeine's project structure. See What an import costs. The first time you import, Caffeine asks you to install and authorize the Caffeine GitHub App in a popup.
To import:
- Click the project name button in the chat header to open the actions menu.
- Select Import from GitHub.
- If your project is not connected to a repository, enter it in the GitHub repository field as
owner/repoor a GitHub URL. - Optionally, enter a git ref — a branch name, tag, or commit hash — to import from a specific point in the repository history. Leave this field blank to import from the default branch.
- Click Import from GitHub to start the process.
Import runs in the background and typically takes a few minutes. When you trigger an import, Caffeine immediately posts a message in your project chat to confirm it has started (for example, Importing main from https://github.com/owner/repo...). The dialog shows a progress screen while the import is underway. When the import succeeds, the dialog closes automatically and your chat shows a confirmation message (for example, Import from GitHub from https://github.com/owner/repo complete, draft version 7 created.). If the import fails, the dialog shows an error message with a Back button so you can adjust your settings and try again — and your chat also shows a message describing what went wrong.
Frequently asked questions
Why did my export not create a commit?
If the current build is identical to the last export — no files changed — Caffeine skips the commit. This can happen if you triggered an export twice without running a new build in between.
Can I push to a branch other than `main`?
No. All exports commit to the main branch. Branch selection is not currently supported.
Can I control the commit message?
No. For subsequent exports, Caffeine writes the commit message automatically based on your recent conversation and specification changes. For the initial export, the message is always Initial commit — Exported from Caffeine.
The repository name I want is already taken in my GitHub account. What happens?
If you type the name of an existing repository, Caffeine pushes a new commit on top of that repository's existing history instead of creating a new one. Make sure this is what you intend before confirming.
I exported to the wrong repository. Can I change it?
You can disconnect GitHub Export and reconnect it, then type a different repository name during setup. This will create a new repository with the full history exported again from scratch. The old repository remains in your GitHub account — you can delete it there manually.
Does my commit history in GitHub persist if I rebuild the app in Caffeine?
Yes. Each export adds a commit on top of the existing history. Rebuilding your app in Caffeine does not reset or affect your GitHub repository until you manually push a new export.
Can I import code from a GitHub repository I did not export from Caffeine?
Yes, as long as your project is not connected to a repository. Choose Import from GitHub and enter any repository that the Caffeine GitHub App can access, as owner/repo or a GitHub URL. GitHub Import needs a paid plan or at least one payment on your account, and costs $0.25 per import. If your project is connected to a repository through GitHub Export, Import from GitHub pulls from that repository; to import a different one, disconnect first.
What happens after a successful import?
A new draft is created with the imported code and begins deploying automatically. The import dialog closes on its own and your chat shows a confirmation message with the new draft version number.