Skip to content

Commit 12b8fee

Browse files
committed
docs: Reorganize Usage section to highlight power features
Major restructuring of Usage section to put promptext's unique capabilities front and center: Changes: - Renamed "Basic Usage" → "Usage" and "Advanced Usage" merged in - Lead with "Smart Context Building" showcasing -r and --max-tokens - Show real-world examples: auth, database, API, bug investigation - Consolidated quick commands into cleaner subsection - Added "Token Budget Output" subsection for budget exceeded display - Removed duplicate Output Formats subsection (kept main section) The new flow immediately demonstrates what makes promptext powerful: relevance filtering + token budgeting = smart AI context. Users now see the killer features first, not buried in "Advanced" section.
1 parent f3fb25e commit 12b8fee

File tree

1 file changed

+32
-62
lines changed

1 file changed

+32
-62
lines changed

README.md

Lines changed: 32 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -82,84 +82,54 @@ promptext automatically checks for new releases once per day and notifies you wh
8282
- **Bug Investigation**: Let AI analyze related files together with proper context
8383
- **API Integration**: Generate structured code context for AI-powered development tools
8484

85-
## Basic Usage
85+
## Usage
8686

87-
```bash
88-
# Current directory to clipboard (PTX format)
89-
prx
90-
91-
# Specific directory
92-
prx /path/to/project
93-
94-
# Filter by extensions
95-
prx -e .go,.js,.ts
96-
97-
# Summary only (file list, token counts)
98-
prx -i
87+
### Smart Context Building (The Power Features)
9988

100-
# Output to file (format auto-detected from extension)
101-
prx -o context.ptx # PTX format
102-
prx -o context.toon # PTX format (backward compatibility)
103-
prx -o context.md # Markdown
104-
prx -o project.xml # XML
105-
106-
# Explicit format specification
107-
prx -f ptx -o context.txt # PTX: readable code blocks
108-
prx -f toon-strict -o small.txt # TOON v1.3: maximum compression
109-
prx -f markdown -o context.md # Standard Markdown
110-
prx -f xml -o project.xml # XML structure
89+
```bash
90+
# Find authentication-related files within token budget
91+
prx -r "auth login OAuth session" --max-tokens 10000
11192

112-
# Exclude patterns (comma-separated)
113-
prx -x "test/,vendor/" --verbose
93+
# Get database layer for Claude Haiku (8K limit)
94+
prx -r "database SQL postgres migration" --max-tokens 8000 -o db-context.ptx
11495

115-
# Preview file selection without processing
116-
prx --dry-run -e .go
96+
# API routes for GPT-4 analysis
97+
prx -r "api routes handlers middleware" --max-tokens 15000
11798

118-
# Suppress output (useful in scripts)
119-
prx -q -o output.ptx
99+
# Bug investigation: error handling code only
100+
prx -r "error exception handler logging" --max-tokens 5000 -e .go,.js
120101
```
121102

122-
## Advanced Usage
123-
124-
### Relevance Filtering
103+
**How relevance scoring works:**
104+
- Filename match: 10 points
105+
- Directory path match: 5 points
106+
- Import statement match: 3 points
107+
- Content match: 1 point
125108

126-
Rank files by keyword frequency:
109+
### Quick Commands
127110

128111
```bash
129-
# Authentication-related files
130-
prx --relevant "auth login OAuth session"
131-
132-
# Database layer
133-
prx -r "database SQL postgres migration"
134-
135-
# API endpoints
136-
prx -r "api routes handlers middleware"
137-
```
138-
139-
**Scoring algorithm:**
140-
- Filename match: 10 points per occurrence
141-
- Directory path match: 5 points per occurrence
142-
- Import statement match: 3 points per occurrence
143-
- Content match: 1 point per occurrence
144-
145-
Files ranked by total score. Ties broken by file size (smaller first).
146-
147-
### Token Budget Control
112+
# Current directory to clipboard
113+
prx
148114

149-
Enforce context window limits:
115+
# Specific directory with extension filter
116+
prx /path/to/project -e .go,.js,.ts
150117

151-
```bash
152-
# Claude 3 Haiku limit
153-
prx --max-tokens 8000
118+
# Output to file (format auto-detected)
119+
prx -o context.ptx # PTX (default)
120+
prx -o context.md # Markdown
121+
prx -o project.xml # XML
154122

155-
# Combined relevance + budget
156-
prx -r "api routes handlers" --max-tokens 5000
123+
# Summary only (file list, token counts)
124+
prx -i
157125

158-
# Cost optimization for iterative queries
159-
prx --max-tokens 3000 -o quick-context.ptx
126+
# Preview file selection
127+
prx --dry-run -r "auth"
160128
```
161129

162-
When budget exceeded, output shows inclusion/exclusion breakdown:
130+
### Token Budget Output
131+
132+
When `--max-tokens` is set and exceeded, promptext shows exactly what was included and excluded:
163133

164134
```
165135
╭───────────────────────────────────────────────╮

0 commit comments

Comments
 (0)