gent-cli 1.4.0 → 1.5.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 (2) hide show
  1. package/README.md +68 -242
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,316 +1,142 @@
1
- # Gent CLI - A Git-like Version Control System
1
+ # Gent CLI
2
2
 
3
- 🚀 **Gent** is a lightweight, Git-inspired version control CLI tool built with Node.js. It provides essential version control features with an intuitive command-line interface.
3
+ > A modern, Git-like version control CLI with built-in cloud authentication and global user identity management.
4
4
 
5
- ## Features
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!
6
6
 
7
- - **Repository Initialization** - Set up new Gent repositories with custom configuration
8
- - **File Staging** - Add files to staging area before committing
9
- - **Commit Management** - Record changes with descriptive messages
10
- - **Branch Operations** - Create, switch, and manage branches
11
- - **Status Tracking** - View working tree status and changes
12
- - **Commit History** - Browse commit logs with detailed information
7
+ ## 🚀 Features
13
8
 
14
- ## Installation
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.
15
14
 
16
- ```bash
17
- # Navigate to the CLI directory
18
- cd apps/Cli
19
-
20
- # Install dependencies
21
- npm install
15
+ ## 📦 Installation
22
16
 
23
- # Link globally (optional)
24
- npm link
17
+ ```bash
18
+ npm install -g gent-cli
25
19
  ```
26
20
 
27
- ## Usage
21
+ ## 🔐 Authentication (The Magic mmss)
28
22
 
29
- ### Initialize a Repository
23
+ Gent uses a global authentication system. You only need to login once.
30
24
 
31
- Create a new Gent repository in the current directory:
25
+ ### Create an Account
32
26
 
33
27
  ```bash
34
- gent init
28
+ gent register
35
29
  ```
36
30
 
37
- With default configuration (skip prompts):
31
+ ### Login
38
32
 
39
33
  ```bash
40
- gent init -y
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 status
42
+ gent whoami
49
43
  ```
50
44
 
51
- Short format:
45
+ ### Logout
52
46
 
53
47
  ```bash
54
- gent status -s
48
+ gent logout
55
49
  ```
56
50
 
57
- ### Stage Files
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
- ### Commit Changes
53
+ ### 1. Initialize a Repository
71
54
 
72
- Record changes to the repository:
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
- # With inline message
76
- gent commit -m "Your commit message"
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
- Auto-stage all modified files:
62
+ ### 2. Check Status
63
+
64
+ See which files are modified or untracked.
83
65
 
84
66
  ```bash
85
- gent commit -a -m "Commit all changes"
67
+ gent status
86
68
  ```
87
69
 
88
- ### View Commit History
70
+ ### 3. Stage Files
89
71
 
90
- Display commit logs:
72
+ Add files to the staging area.
91
73
 
92
74
  ```bash
93
- # Show last 10 commits (default)
94
- gent log
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
- ### Branch Management
80
+ ### 4. Commit Changes
104
81
 
105
- List all branches:
82
+ Create a commit. Gent automatically fetches your name and email from your global login session.
106
83
 
107
84
  ```bash
108
- gent branch
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
- Create a new branch:
112
-
113
- ```bash
114
- gent branch feature-name
115
- ```
90
+ ### 5. View History
116
91
 
117
- Delete a branch:
92
+ See your commit history.
118
93
 
119
94
  ```bash
120
- gent branch -d branch-name
95
+ gent log
96
+ # or compact view
97
+ gent log --oneline
121
98
  ```
122
99
 
123
- ### Switch Branches
100
+ ## 🌿 Branching
124
101
 
125
- Switch to an existing branch:
102
+ Manage branches just like you're used to.
126
103
 
127
104
  ```bash
128
- gent checkout branch-name
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
- ```bash
134
- gent checkout -b new-branch
135
- ```
108
+ # List branches
109
+ gent branch
136
110
 
137
- ## Project Structure
111
+ # Switch back to main
112
+ gent checkout main
138
113
 
139
- ```
140
- apps/Cli/
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
- ## Repository Structure
118
+ ## 📂 Repository Structure
160
119
 
161
- When you initialize a Gent repository, it creates a `.gent` directory:
120
+ Gent creates a `.gent` directory in your project root:
162
121
 
163
122
  ```
164
123
  .gent/
165
- ├── config.json # Repository configuration
166
- ├── staging.json # Staged files
167
- ├── commits.json # Commit history
168
- ├── HEAD # Current branch reference
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
- }
191
- ```
192
-
193
- ## Ignore Patterns
194
-
195
- Create a `.gentignore` file to exclude files from tracking:
196
-
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
124
+ ├── config.json # Project configuration
125
+ ├── objects/ # Stored file contents
126
+ ├── refs/ # Branch pointers
127
+ └── HEAD # Current branch reference
247
128
  ```
248
129
 
249
- ## Examples
130
+ Your authentication tokens are stored globally in `~/.gent/auth.json`.
250
131
 
251
- ### Complete Workflow
132
+ ## 🤝 Contributing
252
133
 
253
- ```bash
254
- # Initialize repository
255
- gent init
134
+ We welcome contributions! Please fork the repository and submit a Pull Request.
256
135
 
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
305
-
306
- ## License
136
+ ## 📄 License
307
137
 
308
138
  ISC
309
139
 
310
- ## Author
311
-
312
- Built with ❤️ using Node.js
313
-
314
140
  ---
315
141
 
316
- **Note**: Gent is a learning project and educational tool. For production use, consider established version control systems like Git.
142
+ Built with ❤️ by [Abdalrahman Kanawati](https://github.com/SaadShaya7)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gent-cli",
3
- "version": "1.4.0",
4
- "description": "A Git-like version control CLI tool with cloud authentication",
3
+ "version": "1.5.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"