Skip to content

brian-mwirigi/devmem-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

devmem-cli

Cross-project code memory for AI coding assistants

npm version  npm downloads  license  TypeScript  Node.js

Give AI assistants memory across ALL your projects

DocumentationnpmIssues


Why devmem-cli?

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

Table of Contents


Quick Start

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

Features

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

Commands

devmem index — Index a project

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 — Find code

devmem search "auth"                    # Keyword search
devmem search "validate" -p my-api      # Limit to project
devmem search "Controller" -t class     # Filter by type
Found 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 — View full code

devmem show 1    # Show complete function/class from search results

devmem list — List indexed projects

devmem list
Indexed Projects:

- my-api         47 files   Indexed Feb 01, 2026
- my-frontend   123 files   Indexed Feb 01, 2026

devmem update — Re-index

devmem update my-api    # Update one project
devmem update           # Update all

devmem export — Export for AI

devmem export -o ./context.md              # All projects
devmem export -p my-api -o ./api-ctx.md    # Specific project

devmem stats — Usage statistics

devmem stats
Projects: 5 | Files: 342 | Functions: 1,247 | Classes: 156

devmem remove — Remove from index

devmem remove my-api    # Removes from index, not from disk

Use Cases

Consistent Patterns Across Projects

# In a new project — find your proven auth pattern
devmem search "JWT authentication"
devmem show 3 > auth.ts    # Copy to new project

Give Cursor Cross-Project Context

devmem 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 code

Find Forgotten Code

devmem search "formatDate"
# Shows all date functions across all projects

Onboarding New Devs

devmem export -p main-app -o ./docs/codebase-overview.md
# New devs can see all patterns, classes, functions instantly

AI Integration

Cursor

devmem index ~/projects/*
devmem export -o ~/cursor-context.md
# Attach to chat -> reference any project

Claude / ChatGPT

devmem export -o ~/ai-context.md
# Paste contents into conversation

Works with the CLI toolchain

# 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"

Supported Languages

Language Extensions
TypeScript .ts, .tsx
JavaScript .js, .jsx
Python .py
Go .go
Rust .rs
Java .java

Architecture

┌─────────────────────────────────────────┐
│              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.


Privacy

  • All data local — nothing sent to cloud
  • Your code stays private — indexed on your machine only
  • You control what gets exported to AI

Development

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"

Contributing

Contributions welcome! Please open an issue or submit a PR.

License

MIT


Built by Brian Munene Mwirigi

npmDocsIssues

About

Cross-project code memory for AI coding assistants. Index projects, search patterns, export context.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors