Caffeine builds and runs your app so you never have to think about code. But the code is real — a complete, working Motoko backend and React frontend — and you own it. GitHub Export is how you take possession of it. Beyond ownership, it gives you a living record of your app's development: every time you export after a change, another commit is added, and over time your repository becomes a readable history of what you built and why. For developers who want to inspect, extend, or fork the code, it is the bridge between Caffeine and their existing workflow.
GitHub Export lets you push your Caffeine app's source code to a GitHub repository. Once connected, you can save your code at any time — and every new export adds a commit, giving you a full history of how your app has evolved.
GitHub Import goes in the opposite direction: it lets you pull code from your connected repository back into Caffeine, so changes made outside the platform can be brought into your project.
What you need:
- A GitHub account
- A Caffeine project with at least one draft (a version of your app that the AI has built and deployed)
Connecting your GitHub account
GitHub Export uses a GitHub App to access your account securely. The app requests only the permissions needed to create and update a repository on your behalf.
To connect:
- Open your project and click the project name button in the chat header to open the actions menu.
- Select Export to GitHub from the menu.
- In the dialog that opens, click Export to GitHub.
- A GitHub authorization window opens. Follow the prompts to install the Caffeine GitHub App on your personal GitHub account.
- Once authorized, the window closes automatically and your first export begins immediately.
You only need to go through this setup once. After that, your GitHub account stays connected across all your projects.
What gets exported
When you export a project, Caffeine sends the following to GitHub:
- All source files for your app — the backend (Motoko) and frontend (React/TypeScript)
- Your project's specification file (
spec.md), which describes what the app does - All image and asset files used by the app
The export reflects the current state of your draft — the latest version the AI has generated.
Commit messages
Each export creates one commit in your repository. For your first export, the commit message is Initial commit — Exported from Caffeine. For subsequent exports, Caffeine uses AI to write a short, descriptive commit message based on your recent conversation and the changes in the specification — so the commit history reads like a meaningful log of what you asked for and what changed.
The commit author is set to your Caffeine username.
Repository visibility
When setting up your export, you can choose whether the GitHub repository is public or private.
- Public and private repositories can be created on any plan.
The visibility setting applies to the repository as a whole and can be changed later directly in GitHub.
Importing code from GitHub
GitHub Import lets you pull code from a GitHub repository into your Caffeine project. There are two ways to use it:
Pull from your connected repository — if your project is connected to a repository through GitHub Export, Import from GitHub pulls from that repository. This is useful when you have edited files locally or merged a branch and want to bring those changes back into Caffeine.
Import any repository — if your project is not connected to a repository, you can type any repository that the Caffeine GitHub App can access, without exporting from Caffeine first. 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, a subscription invoice, or a domain purchase. A saved card alone doesn't count. This is the same rule as for ZIP uploads; see Who can use this. Without it, the import fails with "Uploading code requires a paid plan or at least one payment, such as a top-up." The repository must follow Caffeine's project structure. The first time you import, Caffeine asks you to install and authorize the Caffeine GitHub App in a popup.
Each import costs $0.25, charged when Caffeine accepts it, before it builds your code. If your balance can't cover it, Caffeine refuses the import, tells you that you don't have enough to import code, and posts a message in your chat saying you've used all your balance. Imports are free on a Government plan and for accounts that pay for Caffeine domains from their balance. See What an import costs.
How to import from GitHub:
- Click the project name button in the chat header to open the actions menu.
- Select Import from GitHub from the menu.
- 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. If you leave this blank, Caffeine imports from the default branch.
- Click Import from GitHub.
The import runs in the background, and Caffeine posts a message in your chat when it starts. The dialog shows a progress screen while the import is underway. When the import succeeds, the dialog closes automatically and your chat shows that a new draft is ready. If the import fails, the dialog shows an error message with a Back button so you can adjust your settings and try again. You cannot start a new AI build while an import is in progress, but you can otherwise continue using the platform normally.
Frequently asked questions
Does GitHub Export happen automatically whenever a new build completes?
No. Each export is triggered manually. After a new build, open the project actions menu, choose Export to GitHub, and click Sync to GitHub to push the updated code. Caffeine does not automatically sync to your GitHub repository.
Can I connect the same GitHub account to multiple Caffeine projects?
Yes. Once you authorize the Caffeine GitHub App on your GitHub account, it applies to all your projects. Each project gets its own repository.
Can I export to a repository that belongs to a GitHub organization?
The Caffeine GitHub App must be installed on the specific account or organization you want to export to. During authorization, GitHub gives you the option to choose which account to install the app on. If you want to export to an organization, select that organization during the installation step.
Does exporting to GitHub affect my live app?
No. GitHub Export is a copy of your source code — it has no effect on your deployed app. Your live app continues running regardless of whether you export or not.
What happens if I delete the GitHub repository?
Your Caffeine app is unaffected — it runs on Caffeine's infrastructure, not GitHub. The next time you export, Caffeine will create a new repository with the same name (or prompt you to choose a new name).
Can I import code back from GitHub into Caffeine?
Yes. If your project already has a connected GitHub repository, click the project name button in the chat header, open the actions menu, and select Import from GitHub to pull code from that repository. If your project is not connected to a repository, you can import any repository that the Caffeine GitHub App can access — choose Import from GitHub and enter it 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. See Syncing your Project with GitHub for step-by-step instructions.
Can I host the exported code myself, outside of Caffeine?
There is nothing in the licensing that prevents you from doing so — you own the code. That said, there are a few practical hurdles to be aware of.
First, Caffeine apps run on the Internet Computer (ICP), so self-hosting means deploying to ICP — not to a conventional cloud provider like AWS or Vercel. The exported code does not include a dfx.json configuration file (the ICP deployment manifest), so you would need to add that and configure it manually before deployment.
Second, some Caffeine runtime services are not available outside of Caffeine's environment. File storage, for example, runs through Caffeine's managed infrastructure — an app deployed independently would need to replace that with its own storage solution.
Caffeine is building dedicated tools to make it easier to get your project files onto your local machine. The first piece of this is a download API that the Caffeine CLI will use to clone your project directly — fetching all your source files and assets in one step. This tooling is not yet publicly available, but it is actively in development. When it ships, it will be announced here.
In short: self-hosting is possible and permitted, but requires manual adaptation work by someone comfortable with ICP development tooling. Dedicated local tooling is on the way.