Skip to content
Source
Sign inSign up

Import with your agent

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:

1. Connect GitHub one time

If GitHub sync in Connected accounts shows Connected, and Access has repo and read:org, skip this step.

  1. Open Connected accounts.
  2. Under GitHub sync, tick Private repositories too.
  3. Click Connect GitHub for sync.
  4. 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/NAME is 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, --owner and --name.
  • --issues copies the issues and pull requests. They show at once.
  • --sync keeps 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
  • accounts shows your GitHub user, and each organization that you can import.
  • list shows each repository. [x] marks the ones that start imports: not forks, and not here already.
  • start --repo api --repo web imports only those repositories.
  • Without --org, the commands use your own GitHub user.
  • When someone else has the name of the organization here, list tells you what happens. start stops 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
  • status shows the git import and the import of the issues and pull requests, with the reason of a failure.
  • retry starts a failed import again. You must be an admin of the repository.
  • run shows each item of your Import everything run. --retry-failed starts each failed item again, and --dismiss marks the run as seen.

Over MCP

The MCP server has a tool for each command. REST has the same routes: see /llms.txt.

srcMCP tool
src importimport_repo
src import statusget_import_status
src import retryretry_import
src import github accountslist_github_import_accounts
src import github listget_github_import_plan
src import github startstart_github_import
src import everything --planget_import_everything_plan
src import everythingstart_import_everything
src import runget_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.