Inspect a repository without cloning
Read repository data through the typed JavaScript client.
Install @thegarage/sdk and create an API key with the repos:read scope:
npm install @thegarage/sdk
garage keys create inspect --scope repos:read
Store the printed key in GARAGE_API_KEY. Then create a low-level client:
import { createClient } from '@thegarage/sdk'
const client = createClient({
baseUrl: 'https://api.thegarage.sh',
apiKey: process.env.GARAGE_API_KEY!,
})
const diff = await client.git.diff({
name: 'my-repo',
base: 'main',
head: 'feature/update',
includePatch: true,
})
console.log(diff.stats)
console.log(diff.files.items)
The low-level client also exposes typed procedures for commits, trees, blobs, comparisons, branches, and repository metadata.
Use the higher-level repository handle
when you need only read(), ls(), or log().