switchyard

For agents: this page is markdown at https://switchyard.so/docs/ways-in-and-out.md; every page is listed in llms.txt.

Import, move off GitHub and export

Bring a private repository into Switchyard from GitHub, GitLab, Bitbucket or any Git host, move a project that follows GitHub so that Switchyard hosts it, and take a project's whole history out again.

You will have: a project whose main lives in Switchyard, and a way to clone its whole history with your own credentials. Works with: the board, yard, MCP (yard_leave_github, yard_git_credentials), REST (POST /v1/projects, POST /v1/projects/{project}/leave-github, POST /v1/projects/{project}/main/credentials).

Switchyard works three ways with GitHub: a project can follow a GitHub repository and merge there (connect a GitHub repository), be copied from one once and live in Switchyard, or never touch GitHub at all.

Before you start

Copy a private GitHub repository once

On the board, open new project, choose copy a GitHub repository once, and name it as owner/name.

yard init --import-github acme/web --name acme-web

REST: POST /v1/projects with { "id": "acme-web", "importGithub": "acme/web" }.

Switchyard reads the repository through the App's installation, with a key that lasts an hour and is never kept. Main comes first, so tasks can start at once, and its history copies behind it. Nothing is written back to GitHub, and the repository is not claimed: another project may still follow it.

Import from GitLab, Bitbucket or any Git host

On the board, choose import from a git url, paste the https URL, and paste the access token under access token.

yard init --import https://gitlab.com/acme/web.git --import-token-stdin < token.txt

--import-token-stdin reads the access token from standard input, so it stays out of your shell history. Add --import-username when your host needs the user the key belongs to: a Bitbucket app password, or a Gitea or Forgejo access token.

REST: POST /v1/projects with { "id": "acme-web", "importUrl": "https://gitlab.com/acme/web.git", "importToken": "<token>" }, and importUsername when needed. Without it, Switchyard sends oauth2 to GitLab, x-token-auth to Bitbucket (x-bitbucket-api-token-auth for an Atlassian API key) and x-access-token to any other host.

The access token is used for this one copy and kept nowhere: not with the project, not in a log, and not in an error message. So the whole history comes in the one fetch, and a large repository takes longer to be ready than a GitHub copy. If the copy is cut short, create the project again with the access token.

An access token is sent only over https, and only to the host the URL names.

Move a project off GitHub

A project that follows a GitHub repository can stop following it and keep everything: main and its whole history, every task, setting, rule and the project's history of actions. Switchyard hosts it from then on.

What changes:

It is final: to follow a repository again, create a new project that follows it.

Before you start — Stop pushes to GitHub

Switchyard copies GitHub's main one last time when it moves the project. A commit pushed to GitHub after that read stays on GitHub. Archive the repository on GitHub, or lock main with branch protection, so nothing lands there during the move.

If a commit still lands, the answer warns first and names each commit that stayed on GitHub. Fetch them from GitHub and push them to the project's Switchyard remote to keep them.

Step 1 — Pause merging

yard pause --reason "moving off GitHub"

A merge on its way lands on GitHub first, so Switchyard moves a project only while merging is paused and the merge queue has nothing under way. MCP: yard_pause.

Step 2 — Move it

On the board, open the project's settings, then GitHub connection, and choose move off GitHub. The board pauses merging first when it is not paused, so Step 1 is needed only from yard or MCP.

yard project leave-github --confirm acme-web

Switchyard reads GitHub's main once more, so a commit pushed straight to GitHub before the move is kept, then stops following. It prints what changes, starting with the last commit it copied, and reads GitHub's main once more after the move to tell you whether anything landed there in between. MCP: yard_leave_github. REST: POST /v1/projects/{project}/leave-github.

It is a person's act in a browser. From a yard sign-in or an agent signed in over MCP, Switchyard answers approval_required with the settings page, where you do it.

Step 3 — Resume merging

yard resume

MCP: yard_resume.

Export a project

Main's whole history clones from Switchyard with a read key that lasts an hour. Anyone in the project may make one.

On the board, open the project's settings, then clone main from Switchyard, and choose make a read key.

yard fetch

Or by hand, with the key from POST /v1/projects/{project}/main/credentials (MCP: yard_git_credentials):

git -c http.extraHeader="Authorization: Bearer $SWITCHYARD_READ_KEY" clone <gitRemote>

Git also takes the key as a password, with x-access-token as the user. A project copied shallow first holds its whole history once the history copy behind main is done; yard status shows how far it is.

If something goes wrong

What you seeWhat to do
the Git host refused the key Switchyard sentMake an access token that can read the repository, and import again; send --import-username for a Bitbucket app password or a Gitea or Forgejo access token.
the rules name check ci, which runs on GitHub ActionsGive the check a command, so it runs on Switchyard's check machines, or take it out of the rules. A change to .yard/rules.toml merges like any other: resume merging, merge it, pause again, then move the project.
your GitHub account cannot read owner/nameAsk someone who can read the repository to create the project, or import it by URL with an access token of your own.
merging is not pausedPause merging, then move the project again.
the merge queue is not quiet yetNothing was changed. Wait a moment while the merge queue drains, then ask again.
could not read … on GitHub one last timeNothing was changed. Ask again once GitHub answers.