codetyper-cli 0.1.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +284 -0
- package/dist/highlights-eq9cgrbb.scm +604 -0
- package/dist/highlights-ghv9g403.scm +205 -0
- package/dist/highlights-hk7bwhj4.scm +284 -0
- package/dist/highlights-r812a2qc.scm +150 -0
- package/dist/highlights-x6tmsnaa.scm +115 -0
- package/dist/index.js +104286 -0
- package/dist/injections-73j83es3.scm +27 -0
- package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
- package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
- package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
- package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
- package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
- package/package.json +100 -0
- package/src/version.json +3 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Carlos Gutierrez <carlos.gutierrez@carg.dev>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
# CodeTyper CLI
|
|
2
|
+
|
|
3
|
+
An AI-powered terminal coding agent with an interactive TUI. CodeTyper autonomously executes coding tasks using tool calls with granular permission controls and intelligent provider routing.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## How It Works
|
|
8
|
+
|
|
9
|
+
CodeTyper is an autonomous coding agent that runs in your terminal. You describe what you want to build or fix, and CodeTyper:
|
|
10
|
+
|
|
11
|
+
1. **Analyzes** your request and breaks it into steps
|
|
12
|
+
2. **Executes** tools (bash, read, write, edit) to accomplish the task
|
|
13
|
+
3. **Asks permission** before modifying files or running commands
|
|
14
|
+
4. **Learns** from your project to provide context-aware assistance
|
|
15
|
+
|
|
16
|
+
### Cascading Provider System
|
|
17
|
+
|
|
18
|
+
CodeTyper uses an intelligent provider routing system:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
User Request
|
|
22
|
+
|
|
|
23
|
+
v
|
|
24
|
+
[Detect Task Type] --> code_generation, bug_fix, refactoring, etc.
|
|
25
|
+
|
|
|
26
|
+
v
|
|
27
|
+
[Check Ollama Score] --> Quality score from past interactions
|
|
28
|
+
|
|
|
29
|
+
v
|
|
30
|
+
[Route Decision]
|
|
31
|
+
|
|
|
32
|
+
+-- High Score (85%+) --> Ollama Only (trusted)
|
|
33
|
+
|
|
|
34
|
+
+-- Low Score (40%-) --> Copilot Only (needs improvement)
|
|
35
|
+
|
|
|
36
|
+
+-- Medium Score --> Cascade Mode
|
|
37
|
+
|
|
|
38
|
+
v
|
|
39
|
+
[1. Ollama generates response]
|
|
40
|
+
|
|
|
41
|
+
v
|
|
42
|
+
[2. Copilot audits for issues]
|
|
43
|
+
|
|
|
44
|
+
v
|
|
45
|
+
[3. Update quality scores]
|
|
46
|
+
|
|
|
47
|
+
v
|
|
48
|
+
[Return best response]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Over time, CodeTyper learns which provider performs best for different task types.
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Clone and install
|
|
57
|
+
git clone https://github.com/your-username/codetyper-cli.git
|
|
58
|
+
cd codetyper-cli
|
|
59
|
+
bun install && bun run build && bun link
|
|
60
|
+
|
|
61
|
+
# Login to a provider
|
|
62
|
+
codetyper login copilot
|
|
63
|
+
|
|
64
|
+
# Start interactive chat
|
|
65
|
+
codetyper
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Features
|
|
69
|
+
|
|
70
|
+
### Interactive TUI
|
|
71
|
+
|
|
72
|
+
Full-screen terminal interface with real-time streaming responses.
|
|
73
|
+
|
|
74
|
+

|
|
75
|
+
|
|
76
|
+
**Key bindings:**
|
|
77
|
+
- `Enter` - Send message
|
|
78
|
+
- `Shift+Enter` - New line
|
|
79
|
+
- `/` - Open command menu
|
|
80
|
+
- `Ctrl+Tab` - Toggle interaction mode
|
|
81
|
+
- `Ctrl+T` - Toggle todo panel
|
|
82
|
+
- `Shift+Up/Down` - Scroll log panel
|
|
83
|
+
- `Ctrl+C` (twice) - Exit
|
|
84
|
+
|
|
85
|
+
### Command Menu
|
|
86
|
+
|
|
87
|
+
Press `/` to access all commands organized by category.
|
|
88
|
+
|
|
89
|
+

|
|
90
|
+
|
|
91
|
+
**Available Commands:**
|
|
92
|
+
|
|
93
|
+
| Category | Command | Description |
|
|
94
|
+
|----------|---------|-------------|
|
|
95
|
+
| General | `/help` | Show available commands |
|
|
96
|
+
| General | `/clear` | Clear conversation history |
|
|
97
|
+
| General | `/exit` | Exit the chat |
|
|
98
|
+
| Session | `/save` | Save current session |
|
|
99
|
+
| Session | `/context` | Show context information |
|
|
100
|
+
| Session | `/usage` | Show token usage statistics |
|
|
101
|
+
| Session | `/remember` | Save a learning about the project |
|
|
102
|
+
| Session | `/learnings` | Show saved learnings |
|
|
103
|
+
| Settings | `/model` | Select AI model |
|
|
104
|
+
| Settings | `/agent` | Select agent |
|
|
105
|
+
| Settings | `/mode` | Switch interaction mode |
|
|
106
|
+
| Settings | `/provider` | Switch LLM provider |
|
|
107
|
+
| Settings | `/status` | Show provider status |
|
|
108
|
+
| Settings | `/theme` | Change color theme |
|
|
109
|
+
| Settings | `/mcp` | Manage MCP servers |
|
|
110
|
+
| Account | `/whoami` | Show logged in account |
|
|
111
|
+
| Account | `/login` | Authenticate with provider |
|
|
112
|
+
| Account | `/logout` | Sign out from provider |
|
|
113
|
+
|
|
114
|
+
### Agent Mode with Diff View
|
|
115
|
+
|
|
116
|
+
When CodeTyper modifies files, you see a clear diff view of changes.
|
|
117
|
+
|
|
118
|
+

|
|
119
|
+
|
|
120
|
+
**Interaction Modes:**
|
|
121
|
+
- **Agent** - Full access, can modify files
|
|
122
|
+
- **Ask** - Read-only, answers questions
|
|
123
|
+
- **Code Review** - Review PRs and diffs
|
|
124
|
+
|
|
125
|
+
### Permission System
|
|
126
|
+
|
|
127
|
+
Granular control over what CodeTyper can do. Every file operation requires approval.
|
|
128
|
+
|
|
129
|
+

|
|
130
|
+
|
|
131
|
+
**Permission Scopes:**
|
|
132
|
+
- `[y]` Yes, this once
|
|
133
|
+
- `[s]` Yes, for this session
|
|
134
|
+
- `[a]` Always allow for this project
|
|
135
|
+
- `[g]` Always allow globally
|
|
136
|
+
- `[n]` No, deny this request
|
|
137
|
+
|
|
138
|
+
### Model Selection
|
|
139
|
+
|
|
140
|
+
Access to multiple AI models through GitHub Copilot.
|
|
141
|
+
|
|
142
|
+

|
|
143
|
+
|
|
144
|
+
**Available Models:**
|
|
145
|
+
- GPT-5, GPT-5-mini (Unlimited)
|
|
146
|
+
- GPT-5.2-codex, GPT-5.1-codex
|
|
147
|
+
- Grok-code-fast-1
|
|
148
|
+
- And more...
|
|
149
|
+
|
|
150
|
+
### Theme System
|
|
151
|
+
|
|
152
|
+
14+ built-in themes to customize your experience.
|
|
153
|
+
|
|
154
|
+

|
|
155
|
+
|
|
156
|
+
**Available Themes:**
|
|
157
|
+
default, dracula, nord, tokyo-night, gruvbox, monokai, catppuccin, one-dark, solarized-dark, github-dark, rose-pine, kanagawa, ayu-dark, cargdev-cyberpunk
|
|
158
|
+
|
|
159
|
+
## Providers
|
|
160
|
+
|
|
161
|
+
| Provider | Models | Auth Method | Use Case |
|
|
162
|
+
|----------|--------|-------------|----------|
|
|
163
|
+
| **GitHub Copilot** | GPT-5, Claude, Gemini | OAuth (device flow) | Cloud-based, high quality |
|
|
164
|
+
| **Ollama** | Llama, DeepSeek, Qwen, etc. | Local server | Private, offline, zero-cost |
|
|
165
|
+
|
|
166
|
+
### Cascade Mode
|
|
167
|
+
|
|
168
|
+
When both providers are available, CodeTyper can use them together:
|
|
169
|
+
|
|
170
|
+
1. **Ollama** processes the request first (fast, local)
|
|
171
|
+
2. **Copilot** audits the response for issues
|
|
172
|
+
3. Quality scores update based on audit results
|
|
173
|
+
4. Future requests route based on learned performance
|
|
174
|
+
|
|
175
|
+
Check provider status with `/status`:
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
═══ Provider Status ═══
|
|
179
|
+
|
|
180
|
+
Current Provider: copilot
|
|
181
|
+
Cascade Mode: Enabled
|
|
182
|
+
|
|
183
|
+
Ollama:
|
|
184
|
+
Status: ● Available
|
|
185
|
+
Quality Score: 72%
|
|
186
|
+
|
|
187
|
+
Copilot:
|
|
188
|
+
Status: ● Available
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Configuration
|
|
192
|
+
|
|
193
|
+
Settings are stored in `~/.config/codetyper/config.json`:
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"provider": "copilot",
|
|
198
|
+
"model": "auto",
|
|
199
|
+
"theme": "default",
|
|
200
|
+
"cascadeEnabled": true,
|
|
201
|
+
"maxIterations": 20,
|
|
202
|
+
"timeout": 30000
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Project Context
|
|
207
|
+
|
|
208
|
+
CodeTyper reads project-specific context from:
|
|
209
|
+
- `.github/` - GitHub workflows and templates
|
|
210
|
+
- `.codetyper/` - Project-specific rules and learnings
|
|
211
|
+
- `rules.md` - Custom instructions for the AI
|
|
212
|
+
|
|
213
|
+
## CLI Usage
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
# Start interactive TUI
|
|
217
|
+
codetyper
|
|
218
|
+
|
|
219
|
+
# Start with a prompt
|
|
220
|
+
codetyper "Create a REST API with Express"
|
|
221
|
+
|
|
222
|
+
# Continue last session
|
|
223
|
+
codetyper --continue
|
|
224
|
+
|
|
225
|
+
# Resume specific session
|
|
226
|
+
codetyper --resume <session-id>
|
|
227
|
+
|
|
228
|
+
# Use specific provider
|
|
229
|
+
codetyper --provider ollama
|
|
230
|
+
|
|
231
|
+
# Print mode (non-interactive)
|
|
232
|
+
codetyper --print "Explain this codebase"
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Tools
|
|
236
|
+
|
|
237
|
+
CodeTyper has access to these built-in tools:
|
|
238
|
+
|
|
239
|
+
| Tool | Description |
|
|
240
|
+
|------|-------------|
|
|
241
|
+
| `bash` | Execute shell commands |
|
|
242
|
+
| `read` | Read file contents |
|
|
243
|
+
| `write` | Create or overwrite files |
|
|
244
|
+
| `edit` | Find and replace in files |
|
|
245
|
+
| `todo-read` | Read current todo list |
|
|
246
|
+
| `todo-write` | Update todo list |
|
|
247
|
+
|
|
248
|
+
### MCP Integration
|
|
249
|
+
|
|
250
|
+
Connect external MCP (Model Context Protocol) servers for extended capabilities:
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
# In the TUI
|
|
254
|
+
/mcp
|
|
255
|
+
# Then add a new server
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## Development
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
# Watch mode
|
|
262
|
+
bun run dev
|
|
263
|
+
|
|
264
|
+
# Type check
|
|
265
|
+
bun run typecheck
|
|
266
|
+
|
|
267
|
+
# Build
|
|
268
|
+
bun run build
|
|
269
|
+
|
|
270
|
+
# Run tests
|
|
271
|
+
bun test
|
|
272
|
+
|
|
273
|
+
# Lint
|
|
274
|
+
bun run lint
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
## Documentation
|
|
278
|
+
|
|
279
|
+
- [Changelog](docs/CHANGELOG.md) - Version history and changes
|
|
280
|
+
- [Contributing](docs/CONTRIBUTING.md) - How to contribute
|
|
281
|
+
|
|
282
|
+
## License
|
|
283
|
+
|
|
284
|
+
MIT - See [LICENSE](LICENSE) for details.
|