gent-cli 5.0.0 → 5.0.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.
Files changed (2) hide show
  1. package/README.md +217 -53
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,16 +1,47 @@
1
1
  # Gent CLI
2
2
 
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!
3
+ ![npm](https://img.shields.io/npm/v/gent-cli)
4
+ ![downloads](https://img.shields.io/npm/dw/gent-cli)
6
5
 
7
- ## Features
6
+ > A modern, Git-like version control CLI with built-in cloud authentication and global user identity management.
8
7
 
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.
8
+ Gent is a lightweight version control system that feels like Git but handles user identity automatically through the cloud. No more configuring `user.name` and `user.email` for every repository.
9
+
10
+ ## Highlights
11
+
12
+ - **Cloud Authentication** Login once, work everywhere. JWT-based auth with automatic token refresh.
13
+ - **Git-like Experience** — Familiar commands: `init`, `add`, `commit`, `status`, `log`, `branch`, `checkout`, `merge`, `push`, `pull`, `clone`, and more.
14
+ - **Zero Configuration** — `gent init` auto-detects your authenticated user profile.
15
+ - **Global Identity** — Commits are automatically authored with your cloud profile.
16
+ - **Content-Addressable Storage** — SHA-256 object store with zlib compression and deduplication.
17
+ - **Smart Diff & Merge** — Line-level LCS diff, three-way merge with conflict detection.
18
+ - **Remote Sync** — Push, pull, and clone repositories from the cloud backend.
19
+ - **Secure** — Tokens stored with AES encryption in `~/.gent/auth.json`.
20
+
21
+ ## Table of Contents
22
+
23
+ - [Requirements](#requirements)
24
+ - [Installation](#installation)
25
+ - [Quickstart](#quickstart)
26
+ - [Authentication](#authentication)
27
+ - [Commands](#commands)
28
+ - [Repository Setup](#repository-setup)
29
+ - [Staging & Working Tree](#staging--working-tree)
30
+ - [History](#history)
31
+ - [Branching & Merging](#branching--merging)
32
+ - [Remote & Sync](#remote--sync)
33
+ - [Authentication Commands](#authentication-commands)
34
+ - [Usage Examples](#usage-examples)
35
+ - [Repository Structure](#repository-structure)
36
+ - [Configuration](#configuration)
37
+ - [Docs](#docs)
38
+ - [Troubleshooting](#troubleshooting)
39
+ - [Contributing](#contributing)
40
+ - [License](#license)
41
+
42
+ ## Requirements
43
+
44
+ - Node.js >= 14
14
45
 
15
46
  ## Installation
16
47
 
@@ -18,11 +49,33 @@ Gent is a lightweight version control system that feels exactly like Git but han
18
49
  npm install -g gent-cli
19
50
  ```
20
51
 
52
+ Run locally without installing:
53
+
54
+ ```bash
55
+ cd apps/Cli
56
+ npm install
57
+ node src/index.js --help
58
+ ```
59
+
60
+ ## Quickstart
61
+
62
+ ```bash
63
+ # 1) Authenticate
64
+ gent login
65
+
66
+ # 2) Initialize a repo
67
+ gent init
68
+
69
+ # 3) Make a first commit
70
+ gent add .
71
+ gent commit -m "Initial commit"
72
+ ```
73
+
21
74
  ## Authentication
22
75
 
23
- Gent uses a global authentication system. You only need to login once.
76
+ Gent uses a global authentication system. You only need to log in once.
24
77
 
25
- ### Create an Account
78
+ ### Register a New Account
26
79
 
27
80
  ```bash
28
81
  gent register
@@ -32,11 +85,11 @@ gent register
32
85
 
33
86
  ```bash
34
87
  gent login
35
- # or
88
+ # or with flags
36
89
  gent login -e user@example.com -p YourPassword
37
90
  ```
38
91
 
39
- ### Check Status
92
+ ### Check Current User
40
93
 
41
94
  ```bash
42
95
  gent whoami
@@ -48,58 +101,77 @@ gent whoami
48
101
  gent logout
49
102
  ```
50
103
 
51
- ## Usage
104
+ ## Commands
52
105
 
53
- ### 1. Initialize a Repository
106
+ ### Repository Setup
54
107
 
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.
108
+ | Command | Description |
109
+ |---|---|
110
+ | `gent init [-y]` | Initialize a new Gent repository in the current directory. Use `-y` to skip prompts. |
111
+ | `gent clone <url> [directory]` | Clone a remote repository from the cloud backend. |
56
112
 
57
- ```bash
58
- gent init
59
- # Output: Initialized empty Gent repository in /path/to/project
60
- ```
113
+ ### Staging & Working Tree
61
114
 
62
- ### 2. Check Status
115
+ | Command | Description |
116
+ |---|---|
117
+ | `gent status [-s]` | Show the working tree status. Use `-s` for short format. |
118
+ | `gent add <files...> [-A]` | Add files to the staging area. Use `-A` or `--all` to add all files. |
119
+ | `gent rm <files...> [--cached]` | Remove files from the working tree and staging area. Use `--cached` to keep the file on disk. |
120
+ | `gent reset [files...] [--hard <hash> \| --soft <hash>]` | Unstage files or reset HEAD to a specific commit. |
121
+ | `gent diff [files...] [--staged] [--stat]` | Show changes between working tree, staging area, and commits. |
63
122
 
64
- See which files are modified or untracked.
123
+ ### History
65
124
 
66
- ```bash
67
- gent status
68
- ```
125
+ | Command | Description |
126
+ |---|---|
127
+ | `gent commit [-m <message>] [-a]` | Record changes to the repository. Use `-a` to auto-stage all modified files. |
128
+ | `gent log [-n <count>] [--oneline] [--stat]` | Show commit history. Default limit is 10 commits. |
129
+ | `gent show [ref] [--no-patch]` | Show commit details and diff. |
130
+ | `gent tag [name] [-m <message>] [-d <name>]` | Create, list, or delete tags. |
69
131
 
70
- ### 3. Stage Files
132
+ ### Branching & Merging
71
133
 
72
- Add files to the staging area.
134
+ | Command | Description |
135
+ |---|---|
136
+ | `gent branch [name] [-d <name>] [-a]` | List, create, or delete branches. |
137
+ | `gent checkout <branch> [-b]` | Switch branches. Use `-b` to create and switch to a new branch. |
138
+ | `gent merge <branch> [-m <message>]` | Merge a branch into the current branch using a three-way smart merge. |
139
+ | `gent stash [pop \| list \| drop \| apply] [-m <message>] [-i <index>]` | Stash working tree changes. |
73
140
 
74
- ```bash
75
- gent add filename.js
76
- # or add all files
77
- gent add .
78
- ```
141
+ ### Remote & Sync
79
142
 
80
- ### 4. Commit Changes
143
+ | Command | Description |
144
+ |---|---|
145
+ | `gent remote [add \| remove \| set-url] [args...] [-v]` | Manage remote connections. |
146
+ | `gent push [remote] [branch] [-f]` | Push local commits to the remote. Use `-f` to force push. |
147
+ | `gent pull [remote] [branch]` | Pull and merge remote commits into the current branch. |
81
148
 
82
- Create a commit. Gent automatically fetches your name and email from your global login session.
149
+ ### Authentication Commands
83
150
 
84
- ```bash
85
- gent commit -m "Initial commit"
86
- # Output: [main a1b2c3d] Initial commit
87
- # Author: Your Name <your.email@example.com>
88
- ```
151
+ | Command | Description |
152
+ |---|---|
153
+ | `gent register` | Create a new user account interactively. |
154
+ | `gent login [-e <email>] [-p <password>]` | Log in to your account. |
155
+ | `gent logout` | Log out and clear stored tokens. |
156
+ | `gent whoami` | Display the currently logged-in user. |
89
157
 
90
- ### 5. View History
158
+ ## Usage Examples
91
159
 
92
- See your commit history.
160
+ ### Initialize a Repository
93
161
 
94
162
  ```bash
95
- gent log
96
- # or compact view
97
- gent log --oneline
163
+ gent init
164
+ # Output: Initialized empty Gent repository in /path/to/project
98
165
  ```
99
166
 
100
- ## Branching
167
+ ### Stage and Commit
101
168
 
102
- Manage branches just like you're used to.
169
+ ```bash
170
+ gent add .
171
+ gent commit -m "Initial commit"
172
+ ```
173
+
174
+ ### Work with Branches
103
175
 
104
176
  ```bash
105
177
  # Create and switch to a new branch
@@ -115,23 +187,115 @@ gent checkout main
115
187
  gent branch -d feature-login
116
188
  ```
117
189
 
190
+ ### View History
191
+
192
+ ```bash
193
+ gent log
194
+ gent log --oneline
195
+ gent log -n 5
196
+ ```
197
+
198
+ ### Remote Workflow
199
+
200
+ ```bash
201
+ # Add a remote
202
+ gent remote add origin https://gent-api.onrender.com/api/repos/123/
203
+
204
+ # Push to remote
205
+ gent push origin main
206
+
207
+ # Pull from remote
208
+ gent pull origin main
209
+
210
+ # Clone a repository
211
+ gent clone https://gent-api.onrender.com/api/repos/123/ my-project
212
+ ```
213
+
118
214
  ## Repository Structure
119
215
 
120
- Gent creates a .gent directory in your project root:
216
+ Gent creates a `.gent` directory in your project root:
121
217
 
122
218
  ```
123
219
  .gent/
124
- ├── config.json # Project configuration
125
- ├── objects/ # Stored file contents
126
- ├── refs/ # Branch pointers
127
- └── HEAD # Current branch reference
220
+ ├── config.json # Project configuration, remotes, user info
221
+ ├── commits.json # Full commit history, branches, and tags
222
+ ├── staging.json # Current staging area
223
+ ├── stash.json # Stashed changes (created on first stash)
224
+ ├── HEAD # Current branch reference
225
+ ├── objects/ # Content-addressable blob and tree store
226
+ │ ├── ab/ # First 2 characters of SHA-256 hash
227
+ │ │ └── cdef... # zlib-compressed object
228
+ │ └── ...
229
+ └── refs/
230
+ ├── heads/ # Branch references (reserved for future use)
231
+ └── tags/ # Tag references (reserved for future use)
232
+ ```
233
+
234
+ Your authentication tokens are stored globally in `~/.gent/auth.json`.
235
+
236
+ ## Configuration
237
+
238
+ ### Ignore Files
239
+
240
+ Create a `.gentignore` file in your repository root to exclude files from tracking:
241
+
128
242
  ```
243
+ node_modules/
244
+ dist/
245
+ .env
246
+ *.log
247
+ ```
248
+
249
+ Default ignored patterns include: `.gent`, `node_modules`, `.git`, `.DS_Store`, `.env`, `dist`, `build`, `coverage`, `.vscode`, `.idea`, and `*.log`.
250
+
251
+ ### Remotes
252
+
253
+ Remotes are stored in `.gent/config.json`:
254
+
255
+ ```json
256
+ {
257
+ "remotes": {
258
+ "origin": {
259
+ "url": "https://gent-api.onrender.com/api/repos/123/"
260
+ }
261
+ }
262
+ }
263
+ ```
264
+
265
+ ## Troubleshooting
266
+
267
+ **Command not found?**
268
+
269
+ Make sure the CLI is linked globally:
270
+ ```bash
271
+ npm link
272
+ ```
273
+
274
+ Or run it directly:
275
+ ```bash
276
+ node src/index.js <command>
277
+ ```
278
+
279
+ **Not a Gent repository?**
280
+
281
+ Run `gent init` in your project directory first.
282
+
283
+ **No changes to commit?**
284
+
285
+ Stage files with `gent add <files>` before committing.
286
+
287
+ **Authentication errors?**
288
+
289
+ Run `gent login` to refresh your session. Tokens expire automatically and should refresh; if not, log in again.
290
+
291
+ ## Docs
129
292
 
130
- Your authentication tokens are stored globally in ~/.gent/auth.json.
293
+ - [QUICKSTART.md](QUICKSTART.md)
294
+ - [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)
131
295
 
132
296
  ## Contributing
133
297
 
134
- We welcome contributions! Please fork the repository and submit a Pull Request.
298
+ Contributions are welcome! Please fork the repository and submit a Pull Request.
135
299
 
136
300
  ## License
137
301
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gent-cli",
3
- "version": "5.0.0",
3
+ "version": "5.0.3",
4
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": {