@jannael/glinter 1.0.0

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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +58 -0
  3. package/dist/index.js +1242 -0
  4. package/package.json +58 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Jannael
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,58 @@
1
+ # Glinter
2
+
3
+ Glinter is a high-performance, transparent Git wrapper built with **Bun**. It enhances the standard `git add` workflow with a beautiful, interactive CLI interface while acting as a seamless pass-through for all other Git commands.
4
+
5
+ ## Preview
6
+
7
+ <video src="https://github.com/user-attachments/assets/f488ac07-f36a-4a56-a533-9598c46596ed" controls="false" autoplay="true" loop="true" muted="true" style="max-width: 100%;">
8
+ Your browser does not support the video tag.
9
+ </video>
10
+
11
+
12
+ ## Features
13
+
14
+ - **Interactive `add`**: When you run `g add`, it presents a color-coded list of your modified, new, and deleted files. You can multi-select exactly what you want to stage using a GUI-like interface in your terminal.
15
+
16
+ - **Transparent Wrapper**: For every other command (like `commit`, `push`, `log`, or `status`), Glinter acts as a direct tunnel to Git. It preserves all original colors, formatting, and interactive features of the native Git CLI.
17
+
18
+ - **Safe by Default**: Automatically filters and prevents accidental staging of sensitive files: `.env` and `node_modules`.
19
+
20
+ - **Abbreviation**: You can use `g` instead of `git`.
21
+
22
+ ## How it works
23
+
24
+ Glinter is designed to be as "natural" as possible, meaning it shouldn't feel like a wrapper at all.
25
+
26
+ ### 1. The Transparent Proxy
27
+ In `src/index.ts`, Glinter uses `Bun.spawn` with `stdio: 'inherit'`. This is a low-level operation that connects the standard input, output, and error streams of the Git process directly to your terminal.
28
+ - **Result**: Git "knows" it's in a real terminal, so it correctly detects colors and allows for interactive prompts (like credential entry).
29
+
30
+ ### 2. Reliable Status Parsing
31
+ For the interactive `add` feature, Glinter runs `git status --porcelain`.
32
+ - **Why?**: Standard `git status` output is designed for humans and can change based on your Git version or system language. `--porcelain` is a machine-readable format that is consistent across all environments, making the file detection 100% reliable.
33
+
34
+ ### 3. Interactive Selection
35
+ Using the `@clack/prompts` library, Glinter transforms the raw status data into a selectable list.
36
+ - The selection logic uses Bun's high-speed shell to execute the final `git add` command, correctly escaping filenames to handle spaces and special characters.
37
+
38
+ ## Installation
39
+
40
+ To use Glinter as your primary Git interface (e.g., using the command `g`):
41
+
42
+ ```bash
43
+ npm install -g @jannael/glinter
44
+ ```
45
+
46
+ ### For Development
47
+
48
+ 1. **Clone the repo**
49
+ 2. **Install dependencies**: `bun install`
50
+ 3. **Link the binary**: `bun link`
51
+
52
+ now you can simply run:
53
+ ```bash
54
+ g add # Opens the interactive selector
55
+ g add <file> # Runs standard git add <file>
56
+ g status # Runs standard git status
57
+ g push # Runs standard git push
58
+ ```