Getting Started with livectx
livectx generates intelligent, AI-friendly context files from your codebase. Unlike simple file aggregators, it uses LLM to analyze your code and generate structured context that helps AI assistants understand your project.
What you'll get
Two files: CONTEXT.md with your codebase snapshot and SYSTEM_PROMPT.md with tailored AI instructions.
Installation
From Go
If you have Go installed:
$ go install github.com/skridlevsky/livectx@latestFrom Releases
Download the latest binary for your platform from GitHub Releases.
Build from Source
$ git clone https://github.com/skridlevsky/livectx.git$ cd livectx && make buildQuick Start
1. Set your API key
livectx uses LLM APIs to analyze your code. Set one of these environment variables:
$ export ANTHROPIC_API_KEY=sk-ant-...or
$ export OPENROUTER_API_KEY=sk-or-...2. Validate your setup (optional)
Check that everything is configured correctly:
$ livectx validateAdd --check-api to also test API connectivity:
$ livectx validate --check-api3. Generate context
Navigate to your project and run:
$ cd your-project && livectx generateThis creates two files:
- CONTEXT.md — AI-analyzed codebase snapshot with project summary, tech stack detection, key files identified and described, prioritized file contents, and file tree.
- SYSTEM_PROMPT.md — Tailored AI assistant instructions with project overview, coding conventions, architecture patterns, and suggested reading order.
4. Use with AI
Add the generated files to your AI conversation. The AI assistant will now understand your codebase structure, conventions, and key files.
What the Output Looks Like
SYSTEM_PROMPT.md
# MyProject AI Assistant System Prompt
You are an AI assistant specialized in helping developers work with the **myproject** codebase.
## Project Overview
A Next.js e-commerce platform with real-time inventory management and Stripe integration.
## Tech Stack
- **Framework**: Next.js 15 (App Router)
- **Database**: PostgreSQL with Prisma ORM
- **Payments**: Stripe
- **Styling**: Tailwind CSS
## Key Files to Understand
1. `app/api/products/route.ts` — Product CRUD API
2. `lib/stripe.ts` — Stripe integration helpers
3. `prisma/schema.prisma` — Database schema
## Coding Conventions
- Use TypeScript strict mode
- Prefer server components when possible
- Use Zod for API validationCONTEXT.md
# MyProject Context
## File Tree
```
myproject/
├── app/
│ ├── api/
│ │ └── products/
│ │ └── route.ts
│ ├── layout.tsx
│ └── page.tsx
├── lib/
│ ├── stripe.ts
│ └── db.ts
└── prisma/
└── schema.prisma
```
## Key Files
### app/api/products/route.ts
Product API with CRUD operations...
```typescript
import { NextResponse } from 'next/server'
import { prisma } from '@/lib/db'
// ... file contents
```