A CLI tool to parse and analyze codebases, generating agent specifications in agents.md
npm install asl-parserA powerful CLI tool to parse and analyze codebases, generating comprehensive agent specifications in agents.md.
``bash`
npm install -g asl-parser
Use the asl command from anywhere:
`bash`
asl parse ./
`bash`
npm install asl-parser
Use via npx:
`bash`
npx asl parse ./
Parse the current directory:
`bash`
asl parse
Or specify a custom path:
`bash`
asl parse ./my-project
Options:
| Option | Description | Default |
|--------|-------------|---------|
| -o, --output | Output file name | agents.md |
Example with custom output:
`bash`
asl parse ./ -o my-agents.md
Analyze a prompt to identify impacted files, functions, and lines. Results print to terminal only—no file created.
`bash`
asl prompt "Add authentication to the login function"
With custom path:
`bash`
asl prompt "Update the API endpoint handler" ./my-project`
RAG Search
Search codebase using natural language:bash`
asl rag "your search query"`
Examples:
bashbash asl rag "authentication"`
asl rag "database connection" -p ./src
asl rag "error handling" -k 20`
Options:bash`
-p, --path – Codebase path (default: .)
-k, --topk – Number of results (default: 10)
Returns: Relevant code sections with line numbers and relevance scores.
What It Does:
- Extracts keywords, function names, file paths, and tech terms from your prompt
- Scans the codebase for relevant files, functions, and classes
- Prints a focused impact report to the terminal
Output Includes:
- Files affected and relevance scores
- Functions/classes impacted
- Specific line numbers (e.g., L42, L87)
- File metadata (extension, line count)
Benefits:
- Save tokens by analyzing only relevant code sections
- Quickly identify what needs to be changed
- See impacted functions and classes at a glance
- Get specific line numbers for pinpoint edits
The parse command generates an agents.md file containing:
- Summary Statistics – Total files, lines of code, and file sizes
- Files by Extension – Breakdown of file types in your codebase
- File Analysis – Detailed breakdown for each file:
- File paths and sizes
- Code vs. comment line counts
- Detected classes and functions
- Agent Specifications – Structured JSON data ready for AI agents
✨ Multi-Language Support – JavaScript, TypeScript, Python, Java, C++, Go, Rust, and more
🔍 Smart Detection – Automatically detects functions and classes in code files
📊 Comprehensive Docs – Generates markdown documentation and structured JSON output
⚡ Impact Analysis – Prompt-based impact analysis to identify affected files and lines without full codebase scans
🚀 Auto-Ignored Directories – Skips common directories like node_modules, .git, dist, and more
🔍 RAG Search – Natural language code search without API keys
| Language | Extensions |
|----------|-----------|
| JavaScript/TypeScript | .js, .jsx, .ts, .tsx |.py
| Python | |.java
| Java | |.c
| C/C++ | , .cpp, .h |.go
| Go | |.rs
| Rust | |.rb
| Ruby | |.php
| PHP | |.swift
| Swift | |.kt
| Kotlin | |
| And more... | — |
The following directories are automatically skipped during analysis:
- node_modules, vendor.git
- , .vscode, .idea.next
- , .nuxtdist
- , build, target.cache
- , coverage__pycache__
- , bin, obj
bash
asl rag "how does rag works"
>>🔍 RAG Search: "how does rag works"
📚 Indexing codebase...
✅ Indexed 114 code sections
✅ Found 10 relevant sections:
📍 Query: "how does rag works"
1. 📄 lib\commands\rag-command.js
Lines 181-200 | Relevance: 30%
process.exit(1);
... }
2. 📄 lib\rag\minimal-rag.js
Lines 1-20 | Relevance: 22%
// src/rag/minimal-rag.js
...Drop-in RAG module for asl-parser
3. 📄 lib\commands\rag-command.js
Lines 1-20 | Relevance: 15%
// lib/rag-command.js
...Simple RAG search command for asl-parser
4. 📄 lib\commands\rag-command.js
Lines 166-185 | Relevance: 15%
console.log(chalk.white(
${snippet}...));
console.log...5. 📄 lib\commands\rag-command.js
Lines 16-35 | Relevance: 14%
...st CODE_EXTENSIONS = [
6. 📄 lib\commands\rag-command.js
Lines 196-204 | Relevance: 11%
rag.displayResults(results, query);
...
7. 📄 lib\rag\minimal-rag.js
Lines 76-95 | Relevance: 7%
}
...
8. 📄 lib\promptAnalyzer.js
Lines 31-50 | Relevance: 4%
});
...
9. 📄 lib\promptAnalyzer.js
Lines 91-110 | Relevance: 4%
if (filePath.includes(term) || fileName.includes(term)) {
s...
10. 📄 lib\promptAnalyzer.js
Lines 106-125 | Relevance: 4%
/**
...Score how relevant a function/class is to the prompt
``