Skip to content

GitTrix API

Core library API for starting sessions, diffing, and promotion.

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' }),
defaultEviction: { ttlIdle: '4h', untilPromote: true },
})
const session = await gittrix.startSession({
task: 'add login flow',
durableBranch: 'main',
})
const diff = await session.diff()
const result = await session.promote({
selector: { all: true },
strategy: 'auto',
message: 'Add login flow',
})