Move from GitHub / Import
Import from GitHub with your agent
You have many repositories on GitHub, and you do not want to fill in a web form for each one. Tell your coding agent to move them: it runs src import, or the import tools over MCP.
4 min read
The agent never asks you for a GitHub token. It uses the GitHub connection that you save on the web one time.
You need:
- An agent that uses your own login. See Set up your coding agent or Connect over MCP. The import refuses an agent session token and a scoped token.
1. Connect GitHub one time
If GitHub sync in Connected accounts shows Connected, and Access has repo and read:org, skip this step.
- Open Connected accounts.
- Under GitHub sync, tick Private repositories too.
- Click Connect GitHub for sync.
- On GitHub, let TanStack Source read your organizations and your repositories.
The import reads your organizations and your private repositories, so it needs this access. The connection turns on no sync by itself. Source keeps it until you disconnect it.
Without this connection, the agent stops and shows you a link:
GitHub is not connected. Connect GitHub at https://source.tanstack.com/auth/github?importAll=1&next=%2Fimport%2Fgithub%2Feverything, then try again.
Open the link, allow access on GitHub, then tell the agent to go on. You get the same link when the connection cannot read your organizations or your private repositories, or when GitHub refused it.
2. Tell your agent
Write what you want in your own words. For example:
Move my GitHub organization acme to TanStack Source, with the issues and pull requests.
Import my GitHub repositories api and web from acme into my account, and keep them private.
The agent reads the TanStack Source skill, and runs the src import commands for you.
Done
Your agent moved your repositories, and src import status or src import run shows each one as done. See Follow the imports, and retry.
Next: point your clones at the forge.
The src import commands
You can run these commands yourself too.
One repository
src import acme/api
src import acme/api --issues --sync
src import https://gitlab.com/acme/tools.git --public
OWNER/NAMEis a repository on GitHub. A public one needs no connection, unless you add--issues.- The new repository is private, under your account, with the name of the source. Change that with
--public,--ownerand--name. --issuescopies the issues and pull requests. They show at once.--synckeeps the repository in sync with GitHub after the import. See Sync with GitHub.- A URL on another git host imports only a public repository. For a private one, use the web form: see Import from another git host.
A GitHub organization
src import github accounts
src import github list --org acme
src import github start --org acme --issues
accountsshows your GitHub user, and each organization that you can import.listshows each repository.[x]marks the ones thatstartimports: not forks, and not here already.start --repo api --repo webimports only those repositories.- Without
--org, the commands use your own GitHub user. - When someone else has the name of the organization here,
listtells you what happens.startstops unless you add--confirm-squat. See If the name is taken here.
Everything at once
src import everything --plan
src import everything --leave-out acme/old-experiment
--plan shows what comes over and starts nothing. Without it, the run copies your repositories, the organizations that you own, your profile and your stars, as Import everything from GitHub does. --leave-out keeps one repository on GitHub.
Follow the imports, and retry
src import status acme/api
src import retry acme/api
src import run
src import run --retry-failed
statusshows the git import and the import of the issues and pull requests, with the reason of a failure.retrystarts a failed import again. You must be an admin of the repository.runshows each item of your Import everything run.--retry-failedstarts each failed item again, and--dismissmarks the run as seen.
Over MCP
The MCP server has a tool for each command. REST has the same routes: see /llms.txt.
| src | MCP tool |
|---|---|
src import | import_repo |
src import status | get_import_status |
src import retry | retry_import |
src import github accounts | list_github_import_accounts |
src import github list | get_github_import_plan |
src import github start | start_github_import |
src import everything --plan | get_import_everything_plan |
src import everything | start_import_everything |
src import run | get_import_run, retry_import_run, dismiss_import_run |
What stays on the web
- Connect GitHub: GitHub shows its consent screen in a browser.
- A private repository on another git host: its token goes into the web form, never through your agent.