For the complete documentation index, see llms.txt. A markdown version of this page is at /guides/github-access/index.md.

Give a workstation access to GitHub

Clone and push a private GitHub repository from a workstation with git, using a personal access token that no program on the workstation can read.

Clone and push a private GitHub repository from a workstation with git, using a personal access token that no program on the workstation can read. Ringleader adds the token to requests for GitHub as they leave the workstation, so the workstation never holds it. Use this when you want your code, or your coding agent’s work, in a repository you own.

Prerequisites

  • Ringleader installed, with the Ringleader application running.
  • A running workstation on your computer, labeled role: agent. The examples use a workstation named my-git-box; replace it with yours. To create one, follow the Quickstart and use your own name. Then run rl workstation label my-git-box role=agent -n local. A cloud workstation needs an Edge, as Providers and where the key is added describes, so this guide is for a workstation on your computer.
  • A GitHub personal access token that can read and write the repository.

Add your token and Git identity

Store the token in a Secret, then apply one file. The file adds the token to every workstation with the label. It also installs git and sets the name and email on your commits.

  1. Store the token in a Secret named github-pat:

    rl secret create github-pat -n local --from-string token=<your-token>
  2. Save this as my-git.yaml, with your own name and email. The Integration holds the token. The WorkstationConfig installs git and writes your identity:

    apiVersion: workstations.ringleader.dev/v1
    kind: Integration
    metadata:
      name: my-github
      namespace: local
    spec:
      type: httpProxy
      selector:
        matchLabels:
          role: agent
      httpProxy:
        vendor: github
        credentialRef:
          name: github-pat
          key: token
    ---
    apiVersion: workstations.ringleader.dev/v1
    kind: WorkstationConfig
    metadata:
      name: my-git-identity
      namespace: local
    spec:
      selector:
        matchLabels:
          role: agent
      devtools:
        - name: git
      toolconfigs:
        - id: git
          name: git
          config:
            userName: Your Name
            userEmail: you@example.com

    The workstation can use your token

    Every program in the workstation, your coding agent included, can use GitHub with the access your token has, though none can read the token. Create a token that reaches only the repositories you need, and keep the Integration behind a label, as this file does.
  3. Apply the file. It reaches the workstations that carry the label now and the ones you create later:

    rl apply -f my-git.yaml
  4. Wait until the workstation has applied it:

    rl workstation wait my-git-box --for Configured --timeout 10m -n local

    The command returns once the workstation’s Configured condition is True.

Clone and push a private repository

Clone the repository, commit a change and push it from the workstation’s shell over HTTPS, with no password prompt.

  1. Open a shell on the workstation:

    rl shell my-git-box -n local
  2. Clone your repository. The clone finishes without asking for a password:

    git clone https://github.com/your-org/your-app.git
  3. Change into the repository’s folder:

    cd your-app
  4. Create a file to commit, since a fresh clone has no changes:

    echo "test" >> push-test.txt
  5. Stage the file:

    git add push-test.txt
  6. Commit the file. The commit carries your name and email:

    git commit -m "Try a push from my workstation"
  7. Push the commit. The push finishes without asking for a password:

    git push

Troubleshoot

  • If the clone fails with an authentication error, check that the Integration reached the workstation. Run rl workstation get-resolved-configuration my-git-box -n local and look for integration-my-github under appliedConfigs. If it’s missing, the workstation doesn’t carry the label role: agent.

Next steps