Repos is now in Public Beta! Reach out to us at
info@relace.ai if you have any questions or need help with the integration.
Relace Repos is designed to be the source control for your coding agent. You will likely need to integrate with GitHub if you want to support collaboration with human developers.
There are two ways to set up a GitHub integration with Relace depending on whether you want to link to personal GitHub repos or to user repos via your GitHub app.
Link Personal GitHub Repos
You can provision access to repos belonging to you or your organization with the Relace GitHub App. Go to GitHub settings on the Relace dashboard and choose the “Use Your Own Repos” option.
In the GitHub app installation flow, you can either allow full access or select specific repos to give Relace.
Link Your GitHub App
To give Relace access to your users’ GitHub repos, you need to maintain your own GitHub app. You can find documentation on creating GitHub Apps in the GitHub documentation.
Once you’ve registered and created your app, go to GitHub settings on the Relace dashboard and choose the “Use Your GitHub App” option.
We’ll use the credentials you provide to pull relevant repos from users on your behalf.
Sync to Relace from GitHub
You can now initialize a Relace Repo by providing a url to a GitHub repo that Relace has been authorized to use.
import { Relace } from "@relace-ai/relace";
const client = new Relace({ apiKey: "YOUR_API_KEY" });
const repo = await client.repo.create({
source: {
type: "git",
url: "https://github.com/relace-ai/vite-template",
branch: "main"
},
metadata: {} // Optional: add any custom properties
});
console.log(`Repository created with ID: ${repo.repo_id}`);
If the Relace Repo has not diverged from the GitHub source, you can sync the two in a similar way.
import { Relace } from "@relace-ai/relace";
const client = new Relace({ apiKey: "YOUR_API_KEY" });
const repo = await client.repo.update(repoId, {
source: {
type: "git",
url: "https://github.com/relace-ai/vite-template",
branch: "main"
}
});
console.log(`Repository updated: ${repo.repo_id}`);
Reverse synchronization (pushing changes from Relace Repos back to GitHub) is
not currently supported but will be available in an upcoming release.
For more details on the GitHub related operations, see the API reference.