gent-cli 1.4.0 → 1.6.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.
- package/README.md +64 -238
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,316 +1,142 @@
|
|
|
1
|
-
# Gent CLI
|
|
1
|
+
# Gent CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> A modern, Git-like version control CLI with built-in cloud authentication and global user identity management.
|
|
4
|
+
|
|
5
|
+
Gent is a lightweight version control system that feels exactly like Git but handles user identity automatically through the cloud. No more configuring user.name and user.email for every repository!
|
|
4
6
|
|
|
5
7
|
## Features
|
|
6
8
|
|
|
7
|
-
- **
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **Commit History** - Browse commit logs with detailed information
|
|
9
|
+
- **Cloud Authentication**: Login once, work everywhere. Your identity follows you across projects.
|
|
10
|
+
- **Git-like Experience**: Familiar commands (init, add, commit, status, log, branch, checkout).
|
|
11
|
+
- **Zero Configuration**: gent init is silent and auto-detects your authenticated user profile.
|
|
12
|
+
- **Global Identity**: Commits are automatically authored with your cloud profile.
|
|
13
|
+
- **Secure**: Tokens stored securely in your home directory.
|
|
13
14
|
|
|
14
15
|
## Installation
|
|
15
16
|
|
|
16
17
|
```bash
|
|
17
|
-
|
|
18
|
-
cd apps/Cli
|
|
19
|
-
|
|
20
|
-
# Install dependencies
|
|
21
|
-
npm install
|
|
22
|
-
|
|
23
|
-
# Link globally (optional)
|
|
24
|
-
npm link
|
|
18
|
+
npm install -g gent-cli
|
|
25
19
|
```
|
|
26
20
|
|
|
27
|
-
##
|
|
21
|
+
## Authentication
|
|
28
22
|
|
|
29
|
-
|
|
23
|
+
Gent uses a global authentication system. You only need to login once.
|
|
30
24
|
|
|
31
|
-
Create
|
|
25
|
+
### Create an Account
|
|
32
26
|
|
|
33
27
|
```bash
|
|
34
|
-
gent
|
|
28
|
+
gent register
|
|
35
29
|
```
|
|
36
30
|
|
|
37
|
-
|
|
31
|
+
### Login
|
|
38
32
|
|
|
39
33
|
```bash
|
|
40
|
-
gent
|
|
34
|
+
gent login
|
|
35
|
+
# or
|
|
36
|
+
gent login -e user@example.com -p YourPassword
|
|
41
37
|
```
|
|
42
38
|
|
|
43
39
|
### Check Status
|
|
44
40
|
|
|
45
|
-
View the current state of your working tree:
|
|
46
|
-
|
|
47
41
|
```bash
|
|
48
|
-
gent
|
|
42
|
+
gent whoami
|
|
49
43
|
```
|
|
50
44
|
|
|
51
|
-
|
|
45
|
+
### Logout
|
|
52
46
|
|
|
53
47
|
```bash
|
|
54
|
-
gent
|
|
48
|
+
gent logout
|
|
55
49
|
```
|
|
56
50
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
Add files to the staging area:
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
# Add specific files
|
|
63
|
-
gent add file1.js file2.js
|
|
64
|
-
|
|
65
|
-
# Add all files
|
|
66
|
-
gent add --all
|
|
67
|
-
gent add .
|
|
68
|
-
```
|
|
51
|
+
## Usage
|
|
69
52
|
|
|
70
|
-
###
|
|
53
|
+
### 1. Initialize a Repository
|
|
71
54
|
|
|
72
|
-
|
|
55
|
+
Just like Git, gent init is silent and sets up a new repository in your current directory. It automatically uses your logged-in identity for configuration.
|
|
73
56
|
|
|
74
57
|
```bash
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
# Interactive (will prompt for message)
|
|
79
|
-
gent commit
|
|
58
|
+
gent init
|
|
59
|
+
# Output: Initialized empty Gent repository in /path/to/project
|
|
80
60
|
```
|
|
81
61
|
|
|
82
|
-
|
|
62
|
+
### 2. Check Status
|
|
63
|
+
|
|
64
|
+
See which files are modified or untracked.
|
|
83
65
|
|
|
84
66
|
```bash
|
|
85
|
-
gent
|
|
67
|
+
gent status
|
|
86
68
|
```
|
|
87
69
|
|
|
88
|
-
###
|
|
70
|
+
### 3. Stage Files
|
|
89
71
|
|
|
90
|
-
|
|
72
|
+
Add files to the staging area.
|
|
91
73
|
|
|
92
74
|
```bash
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
# Show specific number of commits
|
|
97
|
-
gent log -n 5
|
|
98
|
-
|
|
99
|
-
# Compact oneline format
|
|
100
|
-
gent log --oneline
|
|
75
|
+
gent add filename.js
|
|
76
|
+
# or add all files
|
|
77
|
+
gent add .
|
|
101
78
|
```
|
|
102
79
|
|
|
103
|
-
###
|
|
80
|
+
### 4. Commit Changes
|
|
104
81
|
|
|
105
|
-
|
|
82
|
+
Create a commit. Gent automatically fetches your name and email from your global login session.
|
|
106
83
|
|
|
107
84
|
```bash
|
|
108
|
-
gent
|
|
85
|
+
gent commit -m "Initial commit"
|
|
86
|
+
# Output: [main a1b2c3d] Initial commit
|
|
87
|
+
# Author: Your Name <your.email@example.com>
|
|
109
88
|
```
|
|
110
89
|
|
|
111
|
-
|
|
90
|
+
### 5. View History
|
|
112
91
|
|
|
113
|
-
|
|
114
|
-
gent branch feature-name
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
Delete a branch:
|
|
92
|
+
See your commit history.
|
|
118
93
|
|
|
119
94
|
```bash
|
|
120
|
-
gent
|
|
95
|
+
gent log
|
|
96
|
+
# or compact view
|
|
97
|
+
gent log --oneline
|
|
121
98
|
```
|
|
122
99
|
|
|
123
|
-
|
|
100
|
+
## Branching
|
|
124
101
|
|
|
125
|
-
|
|
102
|
+
Manage branches just like you're used to.
|
|
126
103
|
|
|
127
104
|
```bash
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
Create and switch to a new branch:
|
|
105
|
+
# Create and switch to a new branch
|
|
106
|
+
gent checkout -b feature-login
|
|
132
107
|
|
|
133
|
-
|
|
134
|
-
gent
|
|
135
|
-
```
|
|
108
|
+
# List branches
|
|
109
|
+
gent branch
|
|
136
110
|
|
|
137
|
-
|
|
111
|
+
# Switch back to main
|
|
112
|
+
gent checkout main
|
|
138
113
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
├── src/
|
|
142
|
-
│ ├── index.js # Main entry point
|
|
143
|
-
│ ├── commands/ # Command implementations
|
|
144
|
-
│ │ ├── init.js # Initialize repository
|
|
145
|
-
│ │ ├── status.js # Show status
|
|
146
|
-
│ │ ├── add.js # Stage files
|
|
147
|
-
│ │ ├── commit.js # Create commits
|
|
148
|
-
│ │ ├── log.js # View history
|
|
149
|
-
│ │ ├── branch.js # Manage branches
|
|
150
|
-
│ │ └── checkout.js # Switch branches
|
|
151
|
-
│ └── utils/ # Utility modules
|
|
152
|
-
│ ├── constants.js # Application constants
|
|
153
|
-
│ ├── fileSystem.js # File operations
|
|
154
|
-
│ └── helpers.js # Helper functions
|
|
155
|
-
├── package.json # Dependencies and scripts
|
|
156
|
-
└── README.md # Documentation
|
|
114
|
+
# Delete a branch
|
|
115
|
+
gent branch -d feature-login
|
|
157
116
|
```
|
|
158
117
|
|
|
159
118
|
## Repository Structure
|
|
160
119
|
|
|
161
|
-
|
|
120
|
+
Gent creates a .gent directory in your project root:
|
|
162
121
|
|
|
163
122
|
```
|
|
164
123
|
.gent/
|
|
165
|
-
├── config.json
|
|
166
|
-
├──
|
|
167
|
-
├──
|
|
168
|
-
|
|
169
|
-
├── objects/ # File objects (future use)
|
|
170
|
-
└── refs/ # Branch references
|
|
171
|
-
├── heads/ # Branch pointers
|
|
172
|
-
└── tags/ # Tag references
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
## Configuration
|
|
176
|
-
|
|
177
|
-
Gent stores configuration in `.gent/config.json`:
|
|
178
|
-
|
|
179
|
-
```json
|
|
180
|
-
{
|
|
181
|
-
"user": {
|
|
182
|
-
"name": "Your Name",
|
|
183
|
-
"email": "your.email@example.com"
|
|
184
|
-
},
|
|
185
|
-
"repository": {
|
|
186
|
-
"name": "project-name",
|
|
187
|
-
"description": "Project description",
|
|
188
|
-
"created": "2025-11-06T00:00:00.000Z"
|
|
189
|
-
}
|
|
190
|
-
}
|
|
124
|
+
├── config.json # Project configuration
|
|
125
|
+
├── objects/ # Stored file contents
|
|
126
|
+
├── refs/ # Branch pointers
|
|
127
|
+
└── HEAD # Current branch reference
|
|
191
128
|
```
|
|
192
129
|
|
|
193
|
-
|
|
130
|
+
Your authentication tokens are stored globally in ~/.gent/auth.json.
|
|
194
131
|
|
|
195
|
-
|
|
132
|
+
## Contributing
|
|
196
133
|
|
|
197
|
-
|
|
198
|
-
# Dependencies
|
|
199
|
-
node_modules/
|
|
200
|
-
|
|
201
|
-
# Build outputs
|
|
202
|
-
dist/
|
|
203
|
-
build/
|
|
204
|
-
|
|
205
|
-
# Environment files
|
|
206
|
-
.env
|
|
207
|
-
.env.local
|
|
208
|
-
|
|
209
|
-
# Logs
|
|
210
|
-
*.log
|
|
211
|
-
|
|
212
|
-
# OS files
|
|
213
|
-
.DS_Store
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
## Command Reference
|
|
217
|
-
|
|
218
|
-
| Command | Description | Options |
|
|
219
|
-
|---------|-------------|---------|
|
|
220
|
-
| `gent init` | Initialize repository | `-y, --yes` Skip prompts |
|
|
221
|
-
| `gent status` | Show working tree status | `-s, --short` Short format |
|
|
222
|
-
| `gent add <files>` | Stage files | `-A, --all` Stage all files |
|
|
223
|
-
| `gent commit` | Record changes | `-m <msg>` Message, `-a` Stage all |
|
|
224
|
-
| `gent log` | Show commit history | `-n <num>` Limit, `--oneline` Compact |
|
|
225
|
-
| `gent branch [name]` | Manage branches | `-d <name>` Delete, `-a` List all |
|
|
226
|
-
| `gent checkout <branch>` | Switch branches | `-b` Create new |
|
|
227
|
-
| `gent help [command]` | Show help | |
|
|
228
|
-
|
|
229
|
-
## Dependencies
|
|
230
|
-
|
|
231
|
-
- **commander** - CLI framework
|
|
232
|
-
- **chalk** - Terminal styling
|
|
233
|
-
- **inquirer** - Interactive prompts
|
|
234
|
-
- **ora** - Elegant terminal spinners
|
|
235
|
-
- **boxen** - Create boxes in terminal
|
|
236
|
-
- **date-fns** - Date formatting utilities
|
|
237
|
-
|
|
238
|
-
## Development
|
|
239
|
-
|
|
240
|
-
```bash
|
|
241
|
-
# Run locally
|
|
242
|
-
npm start
|
|
243
|
-
|
|
244
|
-
# Run specific command
|
|
245
|
-
node src/index.js init
|
|
246
|
-
node src/index.js status
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
## Examples
|
|
250
|
-
|
|
251
|
-
### Complete Workflow
|
|
252
|
-
|
|
253
|
-
```bash
|
|
254
|
-
# Initialize repository
|
|
255
|
-
gent init
|
|
256
|
-
|
|
257
|
-
# Add some files
|
|
258
|
-
echo "console.log('Hello');" > app.js
|
|
259
|
-
gent add app.js
|
|
260
|
-
|
|
261
|
-
# Commit changes
|
|
262
|
-
gent commit -m "Initial commit"
|
|
263
|
-
|
|
264
|
-
# Create a feature branch
|
|
265
|
-
gent branch feature-login
|
|
266
|
-
gent checkout feature-login
|
|
267
|
-
|
|
268
|
-
# Make changes and commit
|
|
269
|
-
echo "// Login logic" >> app.js
|
|
270
|
-
gent add app.js
|
|
271
|
-
gent commit -m "Add login feature"
|
|
272
|
-
|
|
273
|
-
# View history
|
|
274
|
-
gent log
|
|
275
|
-
|
|
276
|
-
# Switch back to main
|
|
277
|
-
gent checkout main
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
## Error Handling
|
|
281
|
-
|
|
282
|
-
Gent provides clear error messages:
|
|
283
|
-
|
|
284
|
-
- **Not a gent repository** - Run `gent init` first
|
|
285
|
-
- **No changes to commit** - Stage files with `gent add`
|
|
286
|
-
- **Branch not found** - Check available branches with `gent branch`
|
|
287
|
-
|
|
288
|
-
## Best Practices
|
|
289
|
-
|
|
290
|
-
1. **Commit Often** - Make small, focused commits
|
|
291
|
-
2. **Write Clear Messages** - Describe what and why
|
|
292
|
-
3. **Use Branches** - Isolate features and experiments
|
|
293
|
-
4. **Check Status** - Review changes before committing
|
|
294
|
-
5. **Update .gentignore** - Exclude unnecessary files
|
|
295
|
-
|
|
296
|
-
## Future Enhancements
|
|
297
|
-
|
|
298
|
-
- [ ] Diff visualization
|
|
299
|
-
- [ ] Remote repository support
|
|
300
|
-
- [ ] Merge functionality
|
|
301
|
-
- [ ] Tag management
|
|
302
|
-
- [ ] Stash implementation
|
|
303
|
-
- [ ] File restoration
|
|
304
|
-
- [ ] Conflict resolution
|
|
134
|
+
We welcome contributions! Please fork the repository and submit a Pull Request.
|
|
305
135
|
|
|
306
136
|
## License
|
|
307
137
|
|
|
308
138
|
ISC
|
|
309
139
|
|
|
310
|
-
## Author
|
|
311
|
-
|
|
312
|
-
Built with ❤️ using Node.js
|
|
313
|
-
|
|
314
140
|
---
|
|
315
141
|
|
|
316
|
-
|
|
142
|
+
Built with love by [Abdalrahman Kanawati](https://github.com/abdo-ka)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gent-cli",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "A Git-like version control CLI
|
|
3
|
+
"version": "1.6.0",
|
|
4
|
+
"description": "A modern, Git-like version control CLI with built-in cloud authentication and global user identity management.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"gent": "src/index.js"
|