Quickstart
Prerequisites
Section titled “Prerequisites”- Node.js >= 20
- pnpm >= 9
Install
Section titled “Install”npm install baselineos @baselineos/govern @baselineos/protocol-coreInitialize
Section titled “Initialize”import { Baseline } from 'baselineos';
const baseline = new Baseline({ projectRoot: process.cwd(), knowledge: ['./docs', './specs'],});
await baseline.init();Run a task
Section titled “Run a task”const task = await baseline.run({ title: 'Generate compliance report', description: 'Produce a compliance report for Q2 exports', priority: 'high', requiredCapabilities: ['compliance'], acceptanceCriteria: [ { description: 'Report covers all origin criteria', type: 'automated' }, { description: 'Evidence bundle exported', type: 'automated' }, ],});
const result = await task.wait();console.log('Status:', result.status);console.log('Artifacts:', result.artifacts.length);Run a compliance check
Section titled “Run a compliance check”import { BaselineGovernSystem } from '@baselineos/govern';
const govern = new BaselineGovernSystem();
const check = await govern.compliance.check('AFCFTA-ROO', { originCountry: 'GH', destinationCountry: 'NG', localValuePercentage: 55, hasCertificateOfOrigin: true,});
console.log('Compliant:', check.compliance?.compliant);Export and verify evidence
Section titled “Export and verify evidence”const bundle = govern.getEvidenceBundle(check.compliance!.id);// Bundle contains: policy, evaluation, approvals, audit trailbaseline verify --evidence ./evidence.json --audit-trail ./audit.jsonStart the API server
Section titled “Start the API server”baseline serve --api --port 3141The server exposes REST endpoints at http://localhost:3141/api/* and a WebSocket stream at /api/stream.
Next steps
Section titled “Next steps”- Configuration — Customize Baseline for your project
- Layer Overview — Understand the 7-layer architecture
- CLI Commands — Full command reference