Skip to content

Development

Setup

bash
git clone https://github.com/vineethkrishnan/agent-sessions.git
cd agent-sessions
npm install
npm run build

Run Locally

bash
node dist/cli.js

Scripts

CommandDescription
npm run buildCompile TypeScript
npm run devWatch mode (recompile on change)
npm testRun all tests
npm run test:watchRun tests in watch mode
npm run test:covRun tests with coverage
npm run lintLint source files
npm run lint:fixLint and auto-fix
npm run lint:strictLint with zero warnings
npm run lint:dead-codeDetect dead code (knip)
npm run lint:duplicatesDetect code duplication (jscpd)
npm run analyzeRun all quality checks
npm run formatFormat with Prettier
npm run format:checkCheck formatting
npm run docs:devStart docs dev server
npm run docs:buildBuild docs for production
npm run docs:previewPreview built docs

Testing

Tests use Vitest and are co-located with source files as *.spec.ts.

bash
npm test              # Run once
npm run test:watch    # Watch mode
npm run test:cov      # With coverage report

Regenerating Screenshots

GIF recordings are created with VHS. Tape scripts live in vhs/ and output to docs/assets/.

bash
# Install VHS (macOS)
brew install vhs

# Regenerate all GIFs
for tape in vhs/*.tape; do vhs "$tape"; done

# Regenerate a specific one
vhs vhs/demo.tape

TIP

On macOS, set CHROME_PATH if VHS can't find Chrome:

bash
CHROME_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" vhs vhs/demo.tape

Commit Convention

Follows Conventional Commits:

feat(session): add fuzzy search filtering
fix(parser): handle array content format in JSONL
chore: update dependencies

Pre-commit hooks run Prettier and ESLint via Husky + lint-staged.

CI/CD

WorkflowTriggerDescription
CIPush/PR to mainLint, test (with coverage), build
Commit LintPRValidates PR title follows Conventional Commits
Code QualityPush/PR to mainDead code, duplication, strict types
SecurityPush/PR/weeklyCodeQL, dependency review, Trivy
ReleasePush to mainrelease-please, npm publish, docs deploy

Released under the MIT License.