Skip to content

Commit e4eb604

Browse files
committed
docs: add README for npm packages
1 parent 586a235 commit e4eb604

3 files changed

Lines changed: 138 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# @codeindex/adapter-typescript
2+
3+
**TypeScript/JavaScript language adapter for codeindex** — Uses ts-morph for full AST parsing.
4+
5+
## Features
6+
7+
- Full TypeScript and JavaScript support
8+
- JSX/TSX support
9+
- Interface, type alias, enum extraction
10+
- Generic type parameter support
11+
- Doc comment extraction
12+
13+
## Supported Extensions
14+
15+
- `.ts` — TypeScript files
16+
- `.tsx` — TypeScript JSX files
17+
- `.js` — JavaScript files
18+
- `.jsx` — JavaScript JSX files
19+
20+
## Usage
21+
22+
```typescript
23+
import { TypeScriptAdapter } from "@codeindex/adapter-typescript"
24+
25+
const adapter = new TypeScriptAdapter()
26+
27+
const parsed = await adapter.parseFile("src/auth/service.ts", "/project")
28+
// Returns: { filePath, language: "typescript", symbols, imports, exports }
29+
```
30+
31+
## License
32+
33+
MIT — See [main repo](https://github.com/zorrong/codeindex)

packages/cli/README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# @codeindex/cli
2+
3+
**Vectorless, reasoning-based code index for AI context retrieval.**
4+
5+
> Cut your AI coding costs by 95%. `codeindex` gives AI exactly the context it needs — nothing more.
6+
7+
## Quick Start
8+
9+
```bash
10+
# Install
11+
npm install -g @codeindex/cli
12+
13+
# Setup (one-time)
14+
codeindex setup
15+
16+
# Index your project
17+
cd your-project
18+
codeindex index .
19+
20+
# Query!
21+
codeindex query "How does authentication work?"
22+
```
23+
24+
## Commands
25+
26+
| Command | Description |
27+
|---------|-------------|
28+
| `codeindex setup` | Global configuration (API Key, Provider) |
29+
| `codeindex init [path]` | Initialize project |
30+
| `codeindex index [path]` | Build/rebuild index |
31+
| `codeindex query "<text>"` | Query the index |
32+
| `codeindex update [path]` | Incremental update |
33+
| `codeindex status [path]` | Check index health |
34+
| `codeindex serve [path]` | HTTP server for IDE integration |
35+
36+
## Features
37+
38+
- **Token Efficient**~2KB response instead of 50KB+
39+
- **Vectorless** — Uses LLM reasoning, not embeddings
40+
- **Multi-Language** — TypeScript, Python, Go, Rust, Java, C#, C++, PHP, Swift
41+
- **IDE Integration** — HTTP API for VSCode, JetBrains, Neovim, Claude Code
42+
43+
## IDE Integration
44+
45+
### Claude Code
46+
```bash
47+
curl -s -X POST http://localhost:3131/query \
48+
-d '{"query": "$1", "maxTokens": 3000}' | jq -r '.context'
49+
```
50+
51+
### Cursor / Windsurf
52+
Add to `.cursorrules`:
53+
```
54+
When you need context, run:
55+
curl -s -X POST http://localhost:3131/query -d '{"query": "YOUR_QUESTION"}'
56+
```
57+
58+
## License
59+
60+
MIT — See [main repo](https://github.com/zorrong/codeindex)

packages/core/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# @codeindex/core
2+
3+
**Core engine for codeindex** — Tree index, retrieval logic, and interfaces.
4+
5+
## What is this?
6+
7+
The core package provides:
8+
- **TreeBuilder** — Build hierarchical index from parsed files
9+
- **TreeTraversal** — LLM-powered traversal to find relevant context
10+
- **FileScanner** — File discovery with gitignore support
11+
- **LanguageAdapter interface** — Standard interface for language parsers
12+
13+
## Usage
14+
15+
```typescript
16+
import { IndexManager, TreeTraversal } from "@codeindex/core"
17+
18+
const manager = new IndexManager({
19+
projectRoot: "/path/to/project",
20+
llmClient,
21+
adapters: [typescriptAdapter]
22+
})
23+
24+
await manager.build()
25+
const result = await traversal.traverse("How does auth work?")
26+
```
27+
28+
## For Package Authors
29+
30+
To add support for a new language, implement the `LanguageAdapter` interface:
31+
32+
```typescript
33+
interface LanguageAdapter {
34+
readonly language: SupportedLanguage
35+
readonly fileExtensions: string[]
36+
37+
supports(filePath: string): boolean
38+
parseFile(filePath: string, projectRoot: string): Promise<ParsedFile>
39+
resolveImport(importPath: string, fromFile: string, projectRoot: string): Promise<string | null>
40+
}
41+
```
42+
43+
## License
44+
45+
MIT — See [main repo](https://github.com/zorrong/codeindex)

0 commit comments

Comments
 (0)