Connect a GitHub organization to Teleport so developers and coding agents can use Git and the GitHub CLI from a beam without putting a personal access token or SSH key in it. This guide uses HTTPS, which supports both Git operations and GitHub API calls. An SSH-only integration can clone and push over SSH, but it cannot run tsh gh.
Install the client tools and sign in
Beams is a Teleport project and uses official Teleport client tools.
The client tools include tsh to sign in and run commands, and tctl to administer your cluster if you have permission.
Cluster: example.beams.run. Edit this example to use your cluster name.
Install version 18.11.10 of the client:
Download and open the macOS installer, then follow its instructions.
curl -O https://cdn.teleport.dev/teleport-tools-18.11.10.pkg
open teleport-tools-18.11.10.pkgFor Linux x86-64, download and install the client tools:
curl -O https://cdn.teleport.dev/teleport-v18.11.10-linux-amd64-bin.tar.gz
tar -xzf teleport-v18.11.10-linux-amd64-bin.tar.gz
sudo ./teleport/installFor Windows x86-64, run these commands in PowerShell. Add the extraction directory ($env:LOCALAPPDATA\Teleport) to your user PATH to use tsh in future terminals; the last command adds it to this terminal's PATH.
Invoke-WebRequest -Uri https://cdn.teleport.dev/teleport-v18.11.10-windows-amd64-bin.zip -OutFile teleport.zip
Expand-Archive -Path teleport.zip -DestinationPath "$env:LOCALAPPDATA\Teleport" -Force
$env:Path += ";$env:LOCALAPPDATA\Teleport"Follow the official client tools install guide for other versions and architectures.
Check that you’re running v18.11.10 of the client with tsh version.
tsh versionI sign in without a password (e.g. a passkey).
tsh login --proxy='example.beams.run' --auth=passwordlessI have a password & MFA set up for my account:
Replace you@example.com with your Teleport username.
tsh login --proxy='example.beams.run' --user=you@example.comI sign in with SSO (e.g. Okta, GitHub, SAML).
tsh login --proxy='example.beams.run'Use Teleport 19.0 clients and a cluster that supports GitHub over HTTPS. Install Git wherever you run Git commands and the GitHub CLI (gh) wherever you run tsh gh. You do not need to run gh auth login for this workflow.
1. Connect your GitHub organization
If your organization is already connected over HTTPS, skip to signing in. Otherwise, use either the Teleport Web UI or tctl to create and install a GitHub App.
Set up in the Web UI
Sign in to the Teleport Web UI as an administrator who can manage integrations and roles. You also need a GitHub organization owner or someone who can install and approve the GitHub App for the selected repositories.
- In the Teleport Web UI, go to Integrations → New Integration → GitHub Access and enter your GitHub organization name. Choose HTTPS if asked which protocol to enable.
- Select Create GitHub App on GitHub and confirm the app creation. Use a GitHub App, not a GitHub OAuth App. The guided setup supplies the callback URL and proposes permissions for repository contents, issues, and pull requests. Review these permissions before accepting them.
- Install the app on your organization. Choose Only select repositories and add the repositories your team needs. Creating the app alone does not grant access to any repository.
- Back in Teleport, assign the GitHub access role from the setup to the people who need it, through your usual Teleport role mapping. The role’s
github_permissionsmust include your organization.
Set up with tctl
Run this from an interactive terminal on a workstation with a browser. Sign in to Teleport with an account that can create integrations and Git servers, such as one with the editor role. Sign in to GitHub as an organization owner. If the organization is on GitHub Enterprise, your cluster also needs Teleport Enterprise.
Replace my-org with your GitHub organization. Use --dry-run to see the planned steps without making changes, then run the command without it to start setup:
tctl integrations github add --org=my-org --dry-run
tctl integrations github add --org=my-orgFollow the browser prompts to create the GitHub App, review its permissions, and install it on the repositories you want to connect. tctl creates the Teleport configuration and saves the app credentials for you. The app name defaults to your cluster name. If that name is taken, add --app-name=my-org-teleport with a name that is available on GitHub.
Once setup is complete, grant users a Teleport role whose github_permissions includes my-org. Then have them follow the sign-in steps below and check that the organization appears in tsh git ls.
Teleport decides who can use the integration. GitHub then checks both what the app can do on the installed repositories and what the signed-in GitHub user can do there. Granting the Teleport role does not grant write access to a repository or bypass branch protection.
2. Sign in and authorize GitHub
From the workstation where you signed in to Teleport, list the organizations you can access and authorize the one you want. Replace my-org and my-repo throughout this guide with your organization and repository names.
tsh git ls
tsh git login --github-org=my-orgComplete the GitHub authorization in your browser using the account that has access to the repository. If a command inside a beam prints an authorization URL instead of opening a browser, open it on your workstation, finish signing in, and retry. If your Teleport session has expired, sign in to Teleport again first.
Inside the beam, verify which GitHub account Teleport is using and that it can see the repository:
tsh gh --github-org=my-org -- api /user --jq .login
tsh gh --github-org=my-org -- repo view my-org/my-repoIf there is only one organization available, you can omit --github-org. Put it before -- when you need it. Everything after -- is passed to gh.
3. Clone or connect an existing checkout
Clone with tsh git clone, then use ordinary Git commands. Teleport configures the remote to use a teleport:// URL so future fetches and pushes continue to go through Teleport.
tsh git clone https://github.com/my-org/my-repo.git
cd my-repo
git remote -v
git fetch originIf you already have an HTTPS checkout of this repository, run the following from its root instead of cloning again:
tsh git config update
git remote -v
git fetch originCheck that the remote you intend to push to uses teleport://. If your organization is SSH-only, use tsh git clone git@github.com:my-org/my-repo.git instead; ask your administrator to enable HTTPS if you need tsh gh.
4. Commit, push, and open a pull request
Git commit authorship is separate from GitHub sign-in. If your beam does not have a Git author configured, set one for this checkout. Use an email address associated with your GitHub account or its GitHub-provided no-reply address.
git config user.name 'Your Name'
git config user.email 'you@example.com'
git switch -c docs/update-readmeEdit README.md, review the diff, and push the branch. Substitute the file you actually changed if it is not README.md:
git diff -- README.md
git add README.md
git commit -m 'Update the README'
git push -u origin HEAD
tsh gh --github-org=my-org -- pr create -R my-org/my-repo \
--head docs/update-readme --title 'Update the README' --body 'Describe the change here.'Use the same commands when directing a coding agent: tell it to use tsh gh -- for GitHub and leave the Teleport remote in place. For example, it can look up issues without changing the repository:
tsh gh --github-org=my-org -- issue list -R my-org/my-repo --search 'documentation'Troubleshoot access
- The organization is missing from
tsh git ls: Check that you signed in to the intended Teleport cluster and that your role grants access to that organization. - The organization is visible, but the repository is not: Check your GitHub account with
tsh gh -- api /user, then ask the GitHub organization owner to verify that the app is installed on that repository and that your account has access. - You can clone but cannot push or open a pull request: Check the app’s write permissions, your GitHub permissions, and the repository’s rules. If fetch or push prompts for GitHub credentials directly, check that the HTTPS remote was converted with
tsh git config update. - An older integration only supports SSH: An administrator must use a GitHub App for HTTPS and enable
httpson both the GitHub integration and its Git server configuration. An OAuth App used for the older SSH setup is not enough.
Review GitHub activity
Administrators can look in Audit → Audit Log for GitHub authorization (git.login), starts of recorded activity (git.session.chunk), and Git operations (git.command). API calls made by tsh gh are distinct from Git operations: where GitHub recording is available, look for git.http_request inside the recording rather than as a standalone audit event. With recording access and the session ID, use tsh play --format=json SESSION_ID to inspect recorded events.