A lightweight TypeScript CLI tool that translates GitHub PR history into context for coding agents.
ylog creates a structured history of your repository by:
- Fetching PR data via the GitHub API (using Octokit)
- Summarizing each PR with AI (Ollama or Anthropic Claude)
- Storing the results in a SQLite database with optional
.ylogcontext files
This allows code generation tools and LLMs to understand why your code looks the way it does, not just what it contains.
# Install globally
npm install -g @graphite/ylog
# Or use npx
npx @graphite/ylog init
# Initialize with a config file
ylog init
# Fetch and summarize all PRs
ylog sync
# Query PR history
ylog show --author alice
ylog show --area src/auth
ylog show --format json
# Regenerate context files
ylog generate src/auth- Node.js 20+
- GitHub Personal Access Token (PAT) with
reposcope - AI provider: Ollama (local) or Anthropic Claude (API key)
ylog supports multiple ways to provide your GitHub token:
-
Environment variable (recommended):
export GITHUB_TOKEN=ghp_your_token_here -
Use existing
ghCLI token:gh auth login # if not already authenticated ylog sync # automatically uses gh token
-
Config file:
{ "github": { "token": "ghp_your_token_here" } } -
CLI flag:
ylog sync --github-token ghp_your_token_here
ylog uses a ylog.config.js or ylog.config.json file in your repository root:
// ylog.config.js
export default {
github: {
repo: 'owner/repo', // Auto-detected from git remote
token: 'ghp_...', // Optional, uses hierarchy above
throttleRpm: 100 // GitHub API rate limit
},
ai: {
provider: 'ollama', // 'ollama' | 'anthropic'
model: 'llama3.1:latest',
endpoint: 'http://localhost:11434', // Ollama only
apiKey: 'sk-...', // Anthropic only
maxTokens: 100
},
concurrency: 10,
outputDir: '.ylog',
generateContextFiles: true, // Create .ylog files for human browsing
contextFileThreshold: 3, // Min PRs to generate .ylog
historyMonths: 6,
diffMaxBytes: 1048576
};See the design document for full details.
Complete documentation is available in the docs/ directory, built with Nextra.
To view the documentation locally:
cd docs
npm install
npm run devThe documentation will be available at http://localhost:3000
See CONTRIBUTING.md for development guidelines.
MIT