Overview
Enabling your AI agent to work on full existing code projects unlocks a new set of capabilities. This guide explains how to give your AI agent access to entire codebases, allowing it to make changes and run projects end-to-end like a human engineer.Using Code Mounts
While you can use normal shell exec commands to clone a public GitHub repository, Runloop provides a more powerful feature calledCodeMounts
. This allows you to mount a repository into your Devbox at a specific path.
Creating a Devbox with a Code Mount
Connecting to Private GitHub Repositories
To enable your Devbox to interact with private GitHub repositories, you need to provide proper authentication credentials. Runloop offers several methods to achieve this.Using Code Mounts with GitHub Token
When you create a Devbox with a Code Mount, Runloop automatically sets up theGH_TOKEN
environment variable and credential cache for you. This authenticates all command-line tools in your Devbox with your GitHub token. This allows your AI agent to use Github and open authenticated pull requests using the gh
cli tool.
Manually Configuring Your Devbox for GitHub
Alternatively, you can configure your Devbox manually using thesetup_commands
argument:
- Creates a new Devbox
- Sets the
GH_TOKEN
environment variable with your GitHub token - Configures Git to use the credential cache
- Stores your GitHub token in the Git credential cache for one hour
Adjust the
--timeout
value in the git config command to change how long the credentials are cached.Best Practices for Token Security
- Use tokens with the minimum required permissions for your tasks.
- Regularly rotate your GitHub tokens.
- Never commit or push files containing your tokens to version control.
- Use environment variables when possible to avoid exposing tokens in command-line arguments.