Skip to content

Getting started

Install GitTrix, create your first session, and run your first promotion.

Terminal window
bun install
import { GitTrix } from '@gittrix/core'
import { LocalDurableAdapter, LocalEphemeralAdapter } from '@gittrix/adapter-local'
const gittrix = new GitTrix({
durable: new LocalDurableAdapter({ path: '/path/to/repo' }),
ephemeral: new LocalEphemeralAdapter({ baseDir: '/tmp/gittrix' }),
})
const session = await gittrix.startSession({ task: 'first task', durableBranch: 'main' })
const agent = session.forAgent()
await agent.write('README.md', new TextEncoder().encode('hello from session\n'))
await agent.commit('docs: test session write')
const result = await session.promote({
selector: { all: true },
strategy: 'auto',
message: 'Apply first session changes',
})

Promotion is human-controlled and is the only route to durable history.