@riflo/ryte 1.1.1 → 1.1.3
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/README.md +42 -12
- package/package.json +1 -1
- package/src/ai.js +7 -3
- package/src/index.js +14 -11
- package/src/prompt.js +3 -1
package/README.md
CHANGED
|
@@ -12,22 +12,22 @@
|
|
|
12
12
|
|
|
13
13
|

|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Writing meaningful commit messages shouldn't feel like extra work. But in fast-paced teams, it often does.
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
**ryte** is your CLI companion that **bridges** the gap between "coding" and "documenting". It reads your git diffs, understands the context of your changes, and generates professional, semantic-compliant messages in seconds.
|
|
17
|
+
**RYTE** is your AI-powered CLI companion that **bridges** the gap between "coding" and "documenting". It reads your git diffs, understands the context of your changes, and generates professional, semantic-compliant messages in seconds.
|
|
20
18
|
|
|
21
19
|
### Core Value
|
|
22
|
-
- **
|
|
23
|
-
- **
|
|
24
|
-
- **
|
|
25
|
-
- **
|
|
20
|
+
- **Stay in Flow**: No context switching. Pure terminal workflow.
|
|
21
|
+
- **Structured by Default**: Clean Conventional Commits automatically.
|
|
22
|
+
- **Context-Aware**: Understands diffs and branch intent.
|
|
23
|
+
- **Human-in-the-Loop**: Accept, edit, or regenerate — your call.
|
|
26
24
|
|
|
27
25
|
---
|
|
28
26
|
|
|
29
27
|
## ⚡ Quick Start
|
|
30
28
|
|
|
29
|
+
> ⚡ **TL;DR**: `git add .` → `ryte c` → **done.**
|
|
30
|
+
|
|
31
31
|
```bash
|
|
32
32
|
# 1. Install globally
|
|
33
33
|
npm install -g @riflo/ryte
|
|
@@ -79,6 +79,18 @@ One command. Same diff. Clean history.
|
|
|
79
79
|
|
|
80
80
|
---
|
|
81
81
|
|
|
82
|
+
## 🧑💻 Built for Developers Who Care
|
|
83
|
+
|
|
84
|
+
If your git history looks like:
|
|
85
|
+
- `fix`
|
|
86
|
+
- `update`
|
|
87
|
+
- `asdf`
|
|
88
|
+
- `final-final-real`
|
|
89
|
+
|
|
90
|
+
**RYTE is for you.**
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
82
94
|
## Installation
|
|
83
95
|
|
|
84
96
|
### Via NPM (Recommended)
|
|
@@ -145,6 +157,8 @@ Introduces a complete JWT-based authentication system, including login, registra
|
|
|
145
157
|
3. **Generation**: Crafts a semantic message (feat, fix, chore, etc.) based on the actual logic changes.
|
|
146
158
|
4. **Interaction**: Presents a TUI (Terminal UI) for you to review and finalize the entry.
|
|
147
159
|
|
|
160
|
+
The result? **AI assistance without surrendering control.**
|
|
161
|
+
|
|
148
162
|
---
|
|
149
163
|
|
|
150
164
|
## Why Not Just Use GitHub Copilot?
|
|
@@ -156,6 +170,7 @@ Fair question. Here's an honest comparison:
|
|
|
156
170
|
| Works natively in terminal | ❌ | ✅ |
|
|
157
171
|
| Diff-aware (reads what you actually changed) | ❌ | ✅ |
|
|
158
172
|
| Enforces Conventional Commits format | ❌ | ✅ |
|
|
173
|
+
| Works with any editor | ❌ | ✅ |
|
|
159
174
|
| No IDE required | ❌ | ✅ |
|
|
160
175
|
| Free tier available | ❌ | ✅ (via Groq) |
|
|
161
176
|
| BYOK (Bring Your Own Key) | ❌ | ✅ |
|
|
@@ -185,7 +200,7 @@ We understand that sending code to an external API is a sensitive decision. Here
|
|
|
185
200
|
|
|
186
201
|
## Configuration
|
|
187
202
|
|
|
188
|
-
**
|
|
203
|
+
**RYTE** requires an API key to function. We support high-performance LLM providers like Groq and OpenAI.
|
|
189
204
|
|
|
190
205
|
### Groq (Recommended - Free & Instant)
|
|
191
206
|
Get your free key at [console.groq.com](https://console.groq.com/keys).
|
|
@@ -212,14 +227,26 @@ export OPENAI_API_KEY="sk-..."
|
|
|
212
227
|
|
|
213
228
|
We believe that **every commit should be written right**. A clean git history is not just about aesthetics; it's about debuggability, revertability, and understanding the "why" behind the code months after it was written.
|
|
214
229
|
|
|
230
|
+
*Your future self will thank you.*
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## ⭐ Why Developers Love It
|
|
235
|
+
|
|
236
|
+
- **No more “wip” commits**: No more generic, lazy history.
|
|
237
|
+
- **Cleaner PR reviews**: Reviewers understand the *why* instantly.
|
|
238
|
+
- **Better team collaboration**: Professional communication by default.
|
|
239
|
+
- **Future-proof project history**: Debug and revert with confidence.
|
|
240
|
+
|
|
215
241
|
---
|
|
216
242
|
|
|
217
243
|
## Roadmap
|
|
218
244
|
|
|
219
|
-
- [ ] **
|
|
220
|
-
- [ ] **
|
|
221
|
-
- [ ] **
|
|
245
|
+
- [ ] **GitHub Action**: Automate commit linting and PR generation in CI/CD.
|
|
246
|
+
- [ ] **Custom Rulesets**: Define your own organization-specific commit styles.
|
|
247
|
+
- [ ] **Ticket Integration**: Automatic JIRA / Linear / GitHub Issues syncing.
|
|
222
248
|
- [ ] **Local LLM Support**: Support for Ollama/Llama.cpp for offline-only environments.
|
|
249
|
+
- [ ] **Context-Aware Radius**: Analyze importing files to suggest impact warnings.
|
|
223
250
|
|
|
224
251
|
---
|
|
225
252
|
|
|
@@ -243,6 +270,9 @@ A: No. It only sends the `git diff` of your staged changes. It automatically ign
|
|
|
243
270
|
**Q: Is it free?**
|
|
244
271
|
A: The tool itself is free. If you use Groq, the API usage is currently free. If you use OpenAI, you pay for what you use (extremely cheap, ~$0.01 for dozens of commits).
|
|
245
272
|
|
|
273
|
+
**Q: Can I use this in a private company repository?**
|
|
274
|
+
A: **Yes.** RYTE only sends the staged diff to your configured AI provider using your own API key (BYOK). No code or credentials are ever stored by RYTE itself.
|
|
275
|
+
|
|
246
276
|
---
|
|
247
277
|
|
|
248
278
|
Developed with ❤️ by **Riflo**
|
package/package.json
CHANGED
package/src/ai.js
CHANGED
|
@@ -44,9 +44,13 @@ export async function generateAIResponse(messages) {
|
|
|
44
44
|
if (response.status === 429) {
|
|
45
45
|
// Rate limited — parse retry-after header or use exponential backoff
|
|
46
46
|
const retryAfter = parseInt(response.headers.get("retry-after") || "15", 10);
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
const waitSeconds = retryAfter + 1;
|
|
48
|
+
|
|
49
|
+
for (let i = waitSeconds; i > 0; i--) {
|
|
50
|
+
process.stdout.write(`\r\x1b[33m⚠ Rate limit hit. Waiting ${i}s before retry (${attempt}/${MAX_RETRIES})...\x1b[0m`);
|
|
51
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
52
|
+
}
|
|
53
|
+
process.stdout.write("\r" + " ".repeat(80) + "\r"); // Clear the line
|
|
50
54
|
continue;
|
|
51
55
|
}
|
|
52
56
|
|
package/src/index.js
CHANGED
|
@@ -22,8 +22,11 @@ function editInteractively(initialText) {
|
|
|
22
22
|
const tmpFile = path.join(os.tmpdir(), `ryte_edit_${Date.now()}.txt`);
|
|
23
23
|
fs.writeFileSync(tmpFile, initialText, "utf-8");
|
|
24
24
|
|
|
25
|
-
const
|
|
26
|
-
|
|
25
|
+
const defaultEditor = process.platform === "win32" ? "notepad" : "vim";
|
|
26
|
+
const editor = process.env.EDITOR || defaultEditor;
|
|
27
|
+
|
|
28
|
+
console.log(`\n\x1b[33m💡 Tip: Don't forget to SAVE (Ctrl+S) before closing the editor!\x1b[0m`);
|
|
29
|
+
console.log(`Opening in ${editor}... Close the editor to save.`);
|
|
27
30
|
try {
|
|
28
31
|
execSync(`${editor} ${tmpFile}`, { stdio: "inherit" });
|
|
29
32
|
const result = fs.readFileSync(tmpFile, "utf-8").trim();
|
|
@@ -128,15 +131,15 @@ async function main() {
|
|
|
128
131
|
await handlePR();
|
|
129
132
|
} else {
|
|
130
133
|
console.log(`
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
\x1b[
|
|
139
|
-
\x1b[90mv1.1.
|
|
134
|
+
\x1b[1;38;5;39m██████╗ \x1b[1;38;5;63m██╗ ██╗\x1b[1;38;5;129m████████╗\x1b[1;38;5;161m███████╗\x1b[0m
|
|
135
|
+
\x1b[1;38;5;39m██╔══██╗\x1b[1;38;5;63m╚██╗ ██╔╝\x1b[1;38;5;129m╚══██╔══╝\x1b[1;38;5;161m██╔════╝\x1b[0m
|
|
136
|
+
\x1b[1;38;5;39m██████╔╝\x1b[1;38;5;63m ╚████╔╝ \x1b[1;38;5;129m ██║ \x1b[1;38;5;161m█████╗ \x1b[0m
|
|
137
|
+
\x1b[1;38;5;39m██╔══██╗\x1b[1;38;5;63m ╚██╔╝ \x1b[1;38;5;129m ██║ \x1b[1;38;5;161m██╔══╝ \x1b[0m
|
|
138
|
+
\x1b[1;38;5;39m██║ ██║\x1b[1;38;5;63m ██║ \x1b[1;38;5;129m ██║ \x1b[1;38;5;161m███████╗\x1b[0m
|
|
139
|
+
\x1b[1;38;5;39m╚═╝ ╚═╝\x1b[1;38;5;63m ╚═╝ \x1b[1;38;5;129m ╚═╝ \x1b[1;38;5;161m╚══════╝\x1b[0m
|
|
140
|
+
|
|
141
|
+
\x1b[1;38;5;46m[ THE AI-POWERED GIT INFRASTRUCTURE ]\x1b[0m
|
|
142
|
+
\x1b[90mv1.1.3 | by Riflo\x1b[0m
|
|
140
143
|
|
|
141
144
|
\x1b[33mCOMMANDS:\x1b[0m
|
|
142
145
|
\x1b[32mryte c\x1b[0m Generate semantic commit from diff
|
package/src/prompt.js
CHANGED
|
@@ -15,7 +15,9 @@ RULES:
|
|
|
15
15
|
6. Scope: If the diff is localized, infer a scope (e.g., "auth", "ui", "config").
|
|
16
16
|
7. Body (Optional): If the change is complex, add a brief body after 1 blank line to explain technical nuances.
|
|
17
17
|
8. Context: If a branch name or ticket is provided, incorporate it into the scope or footer if applicable.
|
|
18
|
-
9. Anti-
|
|
18
|
+
9. Anti-Hallucination: Documentation files (like README.md) often contain example commit messages (e.g., "feat(auth): ..."). DO NOT assume these examples are the topic of the current change.
|
|
19
|
+
10. Logical Validation: Your suggested <scope> must be derived from actual modified logic in the diff, not from text inside code blocks, comments, or examples within a documentation file.
|
|
20
|
+
11. If only README.md or docs are changed, the type MUST be "docs" and the scope should relate to the documentation structure (e.g., "readme", "config", "intro"), NOT the example code inside it.
|
|
19
21
|
|
|
20
22
|
Example:
|
|
21
23
|
feat(ui): add loading state to checkout button
|