Connecting GitHub to a Bash.tv Space
This guide shows how to let the Bash bot read and save code in your GitHub repository. Do these steps once for each space.
What you need
- A GitHub account
- A Bash.tv space that you own
- A GitHub repository. An empty one is fine. If you don’t have one yet, make it at https://github.com/new.
How to read the screenshots
The screenshots use colored boxes to show what to do:
- 🟧 Orange: click or type here. The number matches the step in this guide.
- 🟨 Yellow: optional.
- 🟩 Green: already set correctly. Just check it and leave it as is.
Part 1: Create a token on GitHub
A token is like a password that only works for the repos and actions you pick.
- Go to GitHub → profile picture → Settings → Developer settings → Personal access tokens → Fine-grained tokens. Direct link: https://github.com/settings/personal-access-tokens/new (You can also click the “Create one in GitHub” link in the Bash form shown in Part 2.)
-
Click Generate new token. The New fine-grained personal access token page opens.

- Token name: something you’ll recognize, like
Bash - <space name>. Description is optional. - Resource owner: choose your own account, or the organization that owns the repo.
-
Expiration: choose how long it should work. 30 or 90 days is a safe choice. When it expires, follow this guide again. Avoid No expiration.

- Repository access: choose Only select repositories, click Select repositories, and pick the repo or repos this space should use.
-
Permissions: click + Add permissions, then add these under Repositories:

Permission Setting Needed? Contents Read and write Required. Lets the bot read and save code Metadata Read-only Added automatically Pull requests Read and write Optional. Lets the bot open pull requests - Click Generate token.
- Copy the token now. It starts with
github_pat_, and GitHub only shows it once.
Never paste the token into the Bash chat. Everyone watching the space can see the chat. Paste it only into the form in Part 2.
Part 2: Add the token to your Bash space
-
Open your space’s Settings → API keys and choose GitHub. The Add GitHub key form opens.

- Key: paste the
github_pat_...token. - Tips for the bot (optional): a short note, for example
Use for the repo YourName/YourRepo. -
More options: you don’t need to change anything. The defaults should look like this:

Field Value Name GitHubAddress 1 api.github.com→ Bearer tokenAddress 2 github.com→ Username and passwordUsername x-access-tokenSend it differently to each address ✅ checked - Click Add key.
Part 3: Ask the bot to check it
Send the bot a message in your space, for example:
GitHub is connected. My repo is https://github.com/YourName/YourRepo. Please check that it works.
The bot will check that:
- the key appears in the space’s key list,
- it can see the repo, including private ones,
- it can download (clone) the repo,
- it can push a change back to the repo.
The bot never sees the token itself. Bash adds it automatically whenever the bot talks to GitHub.
Troubleshooting
| Problem | Fix |
|---|---|
| The bot says no key is connected | Make sure you clicked Add key in this space’s settings. |
| “Not Found” (404) for a private repo | That repo wasn’t chosen under Repository access. Edit the token on GitHub and add the repo. |
| The bot can read but can’t push (403) | Set Contents to Read and write on the token. |
| It stopped working after a while | The token probably expired. Make a new one (Part 1) and replace the key (Part 2). |
An SSH address (git@github.com:...) doesn’t work |
Bash changes it to HTTPS automatically. Using https://github.com/... also works. |
Quick checklist
- Repo exists on GitHub
- Fine-grained token created
- Only the needed repos selected
- Contents: Read and write
- Token pasted into Add GitHub key (not the chat)
- Defaults left as they are under More options
- Add key clicked
- Bot confirmed it can clone and push