Adding more features
This commit is contained in:
188
llms.txt
188
llms.txt
@@ -33,6 +33,8 @@ lua/codetyper/
|
||||
├── health.lua # Health check for :checkhealth
|
||||
├── tree.lua # Project tree logging (.coder/tree.log)
|
||||
├── logs_panel.lua # Standalone logs panel UI
|
||||
├── cost.lua # LLM cost tracking with persistent history
|
||||
├── credentials.lua # Secure credential storage (API keys, models)
|
||||
├── llm/
|
||||
│ ├── init.lua # LLM interface, provider selection
|
||||
│ ├── claude.lua # Claude API client (Anthropic)
|
||||
@@ -68,7 +70,14 @@ The plugin automatically creates and maintains a `.coder/` folder in your projec
|
||||
|
||||
```
|
||||
.coder/
|
||||
└── tree.log # Project structure, auto-updated on file changes
|
||||
├── tree.log # Project structure, auto-updated on file changes
|
||||
├── cost_history.json # LLM cost tracking history (persistent)
|
||||
├── brain/ # Knowledge graph storage
|
||||
│ ├── nodes/ # Learning nodes by type
|
||||
│ ├── indices/ # Search indices
|
||||
│ └── deltas/ # Version history
|
||||
├── agents/ # Custom agent definitions
|
||||
└── rules/ # Project-specific rules
|
||||
```
|
||||
|
||||
## Key Features
|
||||
@@ -115,7 +124,49 @@ auto_index = true -- disabled by default
|
||||
|
||||
Real-time visibility into LLM operations with token usage tracking.
|
||||
|
||||
### 6. Event-Driven Scheduler
|
||||
### 6. Cost Tracking
|
||||
|
||||
Track LLM API costs across sessions:
|
||||
|
||||
- **Session tracking**: Monitor current session costs in real-time
|
||||
- **All-time tracking**: Persistent history in `.coder/cost_history.json`
|
||||
- **Per-model breakdown**: See costs by individual model
|
||||
- **50+ models**: Built-in pricing for GPT, Claude, O-series, Gemini
|
||||
|
||||
Cost window keymaps:
|
||||
- `q`/`<Esc>` - Close window
|
||||
- `r` - Refresh display
|
||||
- `c` - Clear session costs
|
||||
- `C` - Clear all history
|
||||
|
||||
### 7. Automatic Ollama Fallback
|
||||
|
||||
When API rate limits are hit (e.g., Copilot free tier), the plugin:
|
||||
1. Detects the rate limit error
|
||||
2. Checks if local Ollama is available
|
||||
3. Automatically switches provider to Ollama
|
||||
4. Notifies user of the provider change
|
||||
|
||||
### 8. Credentials Management
|
||||
|
||||
Store API keys securely outside of config files:
|
||||
|
||||
```vim
|
||||
:CoderAddApiKey
|
||||
```
|
||||
|
||||
**Features:**
|
||||
- Interactive prompts for provider, API key, model, endpoint
|
||||
- Stored in `~/.local/share/nvim/codetyper/configuration.json`
|
||||
- Supports all providers: Claude, OpenAI, Gemini, Copilot, Ollama
|
||||
- Switch providers at runtime with `:CoderSwitchProvider`
|
||||
|
||||
**Credential priority:**
|
||||
1. Stored credentials (via `:CoderAddApiKey`)
|
||||
2. Config file settings (`require("codetyper").setup({...})`)
|
||||
3. Environment variables (`OPENAI_API_KEY`, etc.)
|
||||
|
||||
### 9. Event-Driven Scheduler
|
||||
|
||||
Prompts are treated as events, not commands:
|
||||
|
||||
@@ -143,7 +194,7 @@ scheduler = {
|
||||
}
|
||||
```
|
||||
|
||||
### 7. Tree-sitter Scope Resolution
|
||||
### 10. Tree-sitter Scope Resolution
|
||||
|
||||
Prompts automatically resolve to their enclosing function/method/class:
|
||||
|
||||
@@ -158,7 +209,7 @@ end
|
||||
For replacement intents (complete, refactor, fix), the entire scope is extracted
|
||||
and sent to the LLM, then replaced with the transformed version.
|
||||
|
||||
### 8. Intent Detection
|
||||
### 11. Intent Detection
|
||||
|
||||
The system parses prompts to detect user intent:
|
||||
|
||||
@@ -173,7 +224,7 @@ The system parses prompts to detect user intent:
|
||||
| optimize | optimize, performance, faster | replace |
|
||||
| explain | explain, what, how, why | none |
|
||||
|
||||
### 9. Tag Precedence
|
||||
### 12. Tag Precedence
|
||||
|
||||
Multiple tags in the same scope follow "first tag wins" rule:
|
||||
- Earlier (by line number) unresolved tag processes first
|
||||
@@ -182,33 +233,114 @@ Multiple tags in the same scope follow "first tag wins" rule:
|
||||
|
||||
## Commands
|
||||
|
||||
### Main Commands
|
||||
- `:Coder open` - Opens split view with coder file
|
||||
- `:Coder close` - Closes the split
|
||||
- `:Coder toggle` - Toggles the view
|
||||
- `:Coder process` - Manually triggers code generation
|
||||
All commands can be invoked via `:Coder {subcommand}` or dedicated aliases.
|
||||
|
||||
### Ask Panel
|
||||
- `:CoderAsk` - Open Ask panel
|
||||
- `:CoderAskToggle` - Toggle Ask panel
|
||||
- `:CoderAskClear` - Clear chat history
|
||||
### Core Commands
|
||||
| Command | Alias | Description |
|
||||
|---------|-------|-------------|
|
||||
| `:Coder open` | `:CoderOpen` | Open coder split view |
|
||||
| `:Coder close` | `:CoderClose` | Close coder split view |
|
||||
| `:Coder toggle` | `:CoderToggle` | Toggle coder split view |
|
||||
| `:Coder process` | `:CoderProcess` | Process last prompt in coder file |
|
||||
| `:Coder status` | - | Show plugin status and configuration |
|
||||
| `:Coder focus` | - | Switch focus between coder/target windows |
|
||||
| `:Coder reset` | - | Reset processed prompts |
|
||||
| `:Coder gitignore` | - | Force update .gitignore |
|
||||
|
||||
### Agent Mode
|
||||
- `:CoderAgent` - Open Agent panel
|
||||
- `:CoderAgentToggle` - Toggle Agent panel
|
||||
- `:CoderAgentStop` - Stop running agent
|
||||
### Ask Panel (Chat Interface)
|
||||
| Command | Alias | Description |
|
||||
|---------|-------|-------------|
|
||||
| `:Coder ask` | `:CoderAsk` | Open Ask panel |
|
||||
| `:Coder ask-toggle` | `:CoderAskToggle` | Toggle Ask panel |
|
||||
| `:Coder ask-close` | - | Close Ask panel |
|
||||
| `:Coder ask-clear` | `:CoderAskClear` | Clear chat history |
|
||||
|
||||
### Transform
|
||||
- `:CoderTransform` - Transform all tags
|
||||
- `:CoderTransformCursor` - Transform at cursor
|
||||
- `:CoderTransformVisual` - Transform selection
|
||||
### Agent Mode (Autonomous Coding)
|
||||
| Command | Alias | Description |
|
||||
|---------|-------|-------------|
|
||||
| `:Coder agent` | `:CoderAgent` | Open Agent panel |
|
||||
| `:Coder agent-toggle` | `:CoderAgentToggle` | Toggle Agent panel |
|
||||
| `:Coder agent-close` | - | Close Agent panel |
|
||||
| `:Coder agent-stop` | `:CoderAgentStop` | Stop running agent |
|
||||
|
||||
### Utility
|
||||
- `:CoderIndex` - Open coder companion
|
||||
- `:CoderLogs` - Toggle logs panel
|
||||
- `:CoderType` - Switch Ask/Agent mode
|
||||
- `:CoderTree` - Refresh tree.log
|
||||
- `:CoderTreeView` - View tree.log
|
||||
### Agentic Mode (IDE-like Multi-file Agent)
|
||||
| Command | Alias | Description |
|
||||
|---------|-------|-------------|
|
||||
| `:Coder agentic-run <task>` | `:CoderAgenticRun <task>` | Run agentic task |
|
||||
| `:Coder agentic-list` | `:CoderAgenticList` | List available agents |
|
||||
| `:Coder agentic-init` | `:CoderAgenticInit` | Initialize .coder/agents/ and .coder/rules/ |
|
||||
|
||||
### Transform Commands (Inline Tag Processing)
|
||||
| Command | Alias | Description |
|
||||
|---------|-------|-------------|
|
||||
| `:Coder transform` | `:CoderTransform` | Transform all /@ @/ tags in file |
|
||||
| `:Coder transform-cursor` | `:CoderTransformCursor` | Transform tag at cursor |
|
||||
| - | `:CoderTransformVisual` | Transform selected tags (visual mode) |
|
||||
|
||||
### Project & Index Commands
|
||||
| Command | Alias | Description |
|
||||
|---------|-------|-------------|
|
||||
| - | `:CoderIndex` | Open coder companion for current file |
|
||||
| `:Coder index-project` | `:CoderIndexProject` | Index entire project |
|
||||
| `:Coder index-status` | `:CoderIndexStatus` | Show project index status |
|
||||
|
||||
### Tree & Structure Commands
|
||||
| Command | Alias | Description |
|
||||
|---------|-------|-------------|
|
||||
| `:Coder tree` | `:CoderTree` | Refresh .coder/tree.log |
|
||||
| `:Coder tree-view` | `:CoderTreeView` | View .coder/tree.log |
|
||||
|
||||
### Queue & Scheduler Commands
|
||||
| Command | Alias | Description |
|
||||
|---------|-------|-------------|
|
||||
| `:Coder queue-status` | `:CoderQueueStatus` | Show scheduler/queue status |
|
||||
| `:Coder queue-process` | `:CoderQueueProcess` | Manually trigger queue processing |
|
||||
|
||||
### Processing Mode Commands
|
||||
| Command | Alias | Description |
|
||||
|---------|-------|-------------|
|
||||
| `:Coder auto-toggle` | `:CoderAutoToggle` | Toggle automatic/manual processing |
|
||||
| `:Coder auto-set <mode>` | `:CoderAutoSet <mode>` | Set mode (auto/manual) |
|
||||
|
||||
### Memory & Learning Commands
|
||||
| Command | Alias | Description |
|
||||
|---------|-------|-------------|
|
||||
| `:Coder memories` | `:CoderMemories` | Show learned memories |
|
||||
| `:Coder forget [pattern]` | `:CoderForget [pattern]` | Clear memories |
|
||||
|
||||
### Brain Commands (Knowledge Graph)
|
||||
| Command | Alias | Description |
|
||||
|---------|-------|-------------|
|
||||
| - | `:CoderBrain [action]` | Brain management (stats/commit/flush/prune) |
|
||||
| - | `:CoderFeedback <type>` | Give feedback (good/bad/stats) |
|
||||
|
||||
### LLM Statistics & Feedback
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `:Coder llm-stats` | Show LLM provider accuracy stats |
|
||||
| `:Coder llm-feedback-good` | Report positive feedback |
|
||||
| `:Coder llm-feedback-bad` | Report negative feedback |
|
||||
| `:Coder llm-reset-stats` | Reset LLM accuracy stats |
|
||||
|
||||
### Cost Tracking
|
||||
| Command | Alias | Description |
|
||||
|---------|-------|-------------|
|
||||
| `:Coder cost` | `:CoderCost` | Show LLM cost estimation window |
|
||||
| `:Coder cost-clear` | - | Clear session cost tracking |
|
||||
|
||||
### Credentials Management
|
||||
| Command | Alias | Description |
|
||||
|---------|-------|-------------|
|
||||
| `:Coder add-api-key` | `:CoderAddApiKey` | Add/update LLM provider credentials |
|
||||
| `:Coder remove-api-key` | `:CoderRemoveApiKey` | Remove provider credentials |
|
||||
| `:Coder credentials` | `:CoderCredentials` | Show credentials status |
|
||||
| `:Coder switch-provider` | `:CoderSwitchProvider` | Switch active provider |
|
||||
|
||||
### UI Commands
|
||||
| Command | Alias | Description |
|
||||
|---------|-------|-------------|
|
||||
| `:Coder type-toggle` | `:CoderType` | Show Ask/Agent mode switcher |
|
||||
| `:Coder logs-toggle` | `:CoderLogs` | Toggle logs panel |
|
||||
|
||||
## Configuration Schema
|
||||
|
||||
|
||||
Reference in New Issue
Block a user