You have 10 projects. Each uses similar patterns.
You to Cursor: "Use the auth pattern from my-api project"
Cursor: "I don't have access to that project."
AI assistants forget everything outside the current project. devmem fixes that.
# Index your projects
devmem index ~/projects/my-api
devmem index ~/projects/my-frontend
# Search across everything
devmem search "authentication"
# 12 functions across 3 projects
# Export context for any AI
devmem export -o ~/context.md- Quick Start
- Features
- Commands
- Use Cases
- AI Integration
- Supported Languages
- Architecture
- Development
- Contributing
- License
npm install -g devmem-cli
devmem index ~/projects/my-api # Index a project
devmem search "authentication" # Search across all indexed projects
devmem export -o ~/context.md # Export for AI assistants| Feature | Description |
|---|---|
| Project Indexing | Scan projects for functions, classes, patterns |
| Semantic Search | Find code by description, not just names |
| Cross-Project | Reference patterns from any indexed project |
| AI Export | Generate markdown context for Cursor, Claude, ChatGPT |
| Multi-Language | TypeScript, JavaScript, Python, Go, Rust, Java |
| Smart Extraction | Captures functions, classes, interfaces |
| Local Storage | All data stays on your machine |
devmem index ~/projects/my-api
devmem index ~/projects/my-app -n "main-app" --exclude "test,spec"| Flag | Description |
|---|---|
-n, --name |
Custom project name |
-r, --recursive |
Index subdirectories |
--exclude |
Exclude patterns (comma-separated) |
devmem search "auth" # Keyword search
devmem search "validate" -p my-api # Limit to project
devmem search "Controller" -t class # Filter by typeFound 5 result(s):
1. validateJWT
my-api > src/auth/jwt.ts
Type: function | Relevance: 100.00
async function validateJWT(token: string): Promise<User> {
const decoded = jwt.verify(token, SECRET);
return await User.findById(decoded.userId);
}
devmem show 1 # Show complete function/class from search resultsdevmem listIndexed Projects:
- my-api 47 files Indexed Feb 01, 2026
- my-frontend 123 files Indexed Feb 01, 2026
devmem update my-api # Update one project
devmem update # Update alldevmem export -o ./context.md # All projects
devmem export -p my-api -o ./api-ctx.md # Specific projectdevmem statsProjects: 5 | Files: 342 | Functions: 1,247 | Classes: 156
devmem remove my-api # Removes from index, not from disk# In a new project — find your proven auth pattern
devmem search "JWT authentication"
devmem show 3 > auth.ts # Copy to new projectdevmem export -o ~/cursor-context.md
# In Cursor:
# 1. Attach cursor-context.md to chat
# 2. Ask: "Use the auth pattern from my-api"
# Cursor now sees all your codedevmem search "formatDate"
# Shows all date functions across all projectsdevmem export -p main-app -o ./docs/codebase-overview.md
# New devs can see all patterns, classes, functions instantlydevmem index ~/projects/*
devmem export -o ~/cursor-context.md
# Attach to chat -> reference any projectdevmem export -o ~/ai-context.md
# Paste contents into conversation# Track AI costs when using exported context
aitoken stats
# Save index commands
runbook set index-all "devmem update"
runbook set export "devmem export -o ~/context.md"| Language | Extensions |
|---|---|
| TypeScript | .ts, .tsx |
| JavaScript | .js, .jsx |
| Python | .py |
| Go | .go |
| Rust | .rs |
| Java | .java |
┌─────────────────────────────────────────┐
│ devmem-cli │
├──────────────┬──────────────────────────┤
│ CLI Layer │ Export Engine │
│ (Commander) │ (Markdown generator) │
├──────────────┴──────────────────────────┤
│ Code Parser & Keyword Extractor │
│ (functions, classes, interfaces) │
├─────────────────────────────────────────┤
│ SQLite Search Index │
│ ~/.devmem/index.db │
└─────────────────────────────────────────┘
All data stays on your machine. Nothing is sent anywhere.
- All data local — nothing sent to cloud
- Your code stays private — indexed on your machine only
- You control what gets exported to AI
git clone https://github.com/brian-mwirigi/devmem-cli.git
cd devmem-cli
npm install
npm run build
npm link
devmem index ./src
devmem search "Database"Contributions welcome! Please open an issue or submit a PR.