Documentation Index
Fetch the complete documentation index at: https://docs.relace.ai/llms.txt
Use this file to discover all available pages before exploring further.
If you have a base repo as a starting point for your agent, it’s recommended to turn it into a template Relace repo.
Make a Template Repo
Create a Relace repo from your base codebase and save the repo_id:import { Relace } from "@relace-ai/relace";
const client = new Relace({ apiKey: "YOUR_API_KEY" });
const templateRepo = await client.repo.create({
source: {
type: "git",
url: "https://github.com/relace-ai/vite-template",
branch: "main"
},
auto_index: true // Required for semantic search
});
const templateRepoId = templateRepo.repo_id;
console.log(`Template repository created with ID: ${templateRepoId}`);
Create Repo from Relace Template
Now you can use the saved template_repo_id to quickly create new Relace repos:import { Relace } from "@relace-ai/relace";
const client = new Relace({ apiKey: "YOUR_API_KEY" });
const newRepo = await client.repo.create({
source: {
type: "relace",
repo_id: templateRepoId,
},
auto_index: true, // Required for semantic search
metadata: {} // Optional: add any custom properties
});
console.log(`New repository created with ID: ${newRepo.repo_id}`);
Repo creation with a Relace template is nearly instantaneous, as you no longer pay the latency cost of transferring these base files over the network.