Create a template as a starting point for new Relace repos
Make a Template Repo
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
template_repo_id
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}`);