git-push-time 1.1.3 → 1.1.4

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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # 🐙 GitHub CLI (`githubcli`)
4
4
 
5
- **Trợ lý GitHub trên terminal — đăng nhập, tạo repo, push/pull, quét secret — tất cả trong một chỗ.**
5
+ **A terminal toolkit for GitHub sign-in, repository management, push and pull, and secret scanning.**
6
6
 
7
7
  [![npm version](https://img.shields.io/npm/v/git-push-time?style=flat-square&color=818CF8)](https://www.npmjs.com/package/git-push-time)
8
8
  [![license](https://img.shields.io/npm/l/git-push-time?style=flat-square)](./LICENSE)
@@ -15,205 +15,203 @@
15
15
 
16
16
  ---
17
17
 
18
- ## ✨ Tính năng
18
+ ## Features
19
19
 
20
- ### 🐙 GitHub — trọng tâm chính
21
- - **Đăng nhập linh hoạt**: OAuth Device Flow (mở trình duyệt, nhập mã) hoặc dán Personal Access Token.
22
- - **Đa tài khoản**: lưu nhiều account, chuyển qua lại, tự nhận token từ `gh CLI` hoặc biến môi trường `GITHUB_TOKEN` / `GH_TOKEN`.
23
- - **Tạo repository ngay trên terminal**: Public / Private, tự gợi ý tên theo folder, tạo xong hỏi đẩy code lên luôn.
24
- - **Quản lý nhanh**: xem profile (`whoami`), duyệt repo cá nhân (`repos`), chọn repo từ danh sách không cần copy-paste URL.
25
- - Token lưu local (`~/.git-push-time/config.json`, chmod 600).
20
+ ### GitHub
21
+ - **Flexible sign-in**: OAuth Device Flow in your browser or a Personal Access Token.
22
+ - **Multiple accounts**: switch between accounts and detect tokens from `gh CLI`, `GITHUB_TOKEN`, or `GH_TOKEN`.
23
+ - **Create repositories in the terminal**: choose public or private visibility, use a suggested folder name, then push your project.
24
+ - **Quick access**: view your profile (`whoami`), browse repositories (`repos`), or select a repository from the list.
25
+ - Tokens are stored locally in `~/.git-push-time/config.json` with restricted file permissions where supported.
26
26
 
27
- ### 🚀 Push / Pull
28
- - **Push wizard 7 bước**: chọn folder → account → repository (chọn sẵn / tạo mới / dán URL) → branch → message → time → xác nhận & push.
29
- - Tự động `git init`, `remote`, `add`, `commit`, `push`; hỗ trợ `--dir`, `--force`, `-y` chạy không hỏi.
30
- - **Pull**: `pull` fast-forward, gợi ý `--rebase` khi lệch lịch sử.
31
- - Nút `« Quay lại` mọi bước (hoặc gõ `..`).
27
+ ### Push and pull
28
+ - **Seven-step push wizard**: choose a folder, account, repository, branch, commit message, and commit time, then review and push.
29
+ - Can run `git init`, configure a remote, stage, commit, and push. Supports `--dir`, `--force`, and `-y`.
30
+ - **Pull** with fast-forward by default; offers rebase when histories have diverged.
31
+ - Go back from prompts with `..` or the Back option.
32
32
 
33
- ### 🛡️ Secret Shield (chống lộ key, lỗi GH013)
34
- - Quét file nhạy cảm (`.env`, `.npmrc`, private keys, API keys) trước khi push.
35
- - Tự gỡ khỏi stage + thêm `.gitignore` (file trên máy vẫn giữ nguyên).
36
- - Gợi ý squash các commit unpushed dính secret.
33
+ ### Secret protection
34
+ - Scan staged files for sensitive files and common API keys before pushing.
35
+ - Unstage detected files and add ignore rules while keeping local files intact.
36
+ - Suggest squashing unpushed commits that may contain secrets.
37
37
 
38
- ### 🎨 Terminal UI
39
- - Dashboard hiển thị folder, branch, trạng thái GitHub, remote.
40
- - Khung bo tròn đồng bộ, căn đều 2 bên, màu Cyberpunk / DevTools.
38
+ ### Terminal interface
39
+ - Dashboard shows the folder, branch, GitHub account, remote, and latest commit.
40
+ - Consistent rounded panels and a dark developer-tool color palette.
41
41
 
42
- > ⏰ *Đổi thời gian commit (backdate / edit-time) chỉ là tiện ích bổ sung, xem ở [Phụ lục](#-phụ-lục-tiện-ích-thời-gian-commit).*
42
+ > Commit timestamp editing (backdating) is an additional utility. See [Commit timestamps](#commit-timestamps).
43
43
 
44
44
  ---
45
45
 
46
- ## 📦 Cài đặt
46
+ ## Installation
47
47
 
48
48
  ```bash
49
- # Cài toàn cục (khuyên dùng) — dùng được ở mọi thư mục
49
+ # Install globally (recommended)
50
50
  npm install -g git-push-time
51
51
 
52
- # Hoặc chạy trực tiếp không cần cài
52
+ # Or run without installing
53
53
  npx git-push-time
54
54
  ```
55
55
 
56
- Yêu cầu: **Node.js ≥ 18** và **Git** đã cài đặt.
56
+ Requirements: **Node.js ≥ 18** and **Git**.
57
57
 
58
58
  ---
59
59
 
60
- ## ⚡ Bắt đầu nhanh (3 bước)
60
+ ## Quick start
61
61
 
62
62
  ```bash
63
- # 1. Đăng nhập GitHub (mở trình duyệt, nhập mã xác nhận)
63
+ # 1. Sign in to GitHub in your browser
64
64
  githubcli github login
65
65
 
66
- # 2. Tạo repo mới (Public/Private), xong chọn đẩy code lên luôn
66
+ # 2. Create a repository and choose whether to push your project
67
67
  githubcli github create
68
68
 
69
- # 3. Hoặc đẩy project hiện tại lên repo bất kỳ
69
+ # 3. Or push the current project to an existing repository
70
70
  githubcli -r https://github.com/username/my-repo.git -m "Initial commit" -b main -y
71
71
  ```
72
72
 
73
- Luồng wizard khi chạy tay `githubcli` (không kèm flag):
73
+ Run `githubcli` without flags to open the interactive wizard:
74
74
 
75
75
  ```text
76
76
  githubcli
77
77
  │
78
- ├── 📁 1. Chọn folder project
79
- ├── 👤 2. Chọn GitHub account
80
- ├── 📦 3. Chọn repository (có sẵn / tạo mới / dán URL)
81
- ├── 🌿 4. Chọn branch
82
- ├── 💬 5. Nhập commit message
83
- ├── ⏰ 6. Chọn commit time (mặc định: ngay bây giờ)
84
- └── 🚀 7. Xác nhận & Push (quét secret → commit → push)
78
+ ├── 📁 1. Choose a project folder
79
+ ├── 👤 2. Choose a GitHub account
80
+ ├── 📦 3. Choose a repository (existing / new / URL)
81
+ ├── 🌿 4. Choose a branch
82
+ ├── 💬 5. Enter a commit message
83
+ ├── ⏰ 6. Choose a commit time (defaults to now)
84
+ └── 🚀 7. Review and push (scan secrets → commit → push)
85
85
  ```
86
86
 
87
87
  ---
88
88
 
89
- ## 🖥️ Giao diện
89
+ ## Terminal preview
90
90
 
91
91
  ```text
92
92
  ╭─────────────── git-push-time v1.1.2 ───────────────╮
93
93
  │ ▲ Folder E:\my-project │
94
- │ → Branch main ● 5 file thay đổi │
95
- │ ◆ GitHub @username ✓ đã đăng nhập │
96
- │ ○ Remote username/my-repo │
97
- ╰─────────────────────────────────────────────────────╯
98
-
99
- ╭────────────────── Xác nhận ───────────────────────╮
100
- │ Repo username/my-repo │
101
- │ Branch main │
102
- │ Message "Initial commit" │
103
- │ Time now │
104
- ╰─────────────────────────────────────────────────────╯
94
+ │ → Branch main ● 5 changes │
95
+ │ ◆ GitHub @username ✓ connected │
96
+ │ ○ Remote username/my-repo │
97
+ ╰──────────────────────────────────────────────────────╯
98
+
99
+ ╭────────────────── Review push ─────────────────────╮
100
+ │ Repository username/my-repo │
101
+ │ Branch main │
102
+ │ Message "Initial commit" │
103
+ │ Time now │
104
+ ╰──────────────────────────────────────────────────────╯
105
105
  ```
106
106
 
107
107
  ---
108
108
 
109
- ## 🛠️ Lệnh
109
+ ## Commands
110
110
 
111
111
  ### GitHub
112
112
 
113
- | Lệnh | Mô tả |
113
+ | Command | Description |
114
114
  | :--- | :--- |
115
- | `githubcli github login` | Đăng nhập (OAuth Device Flow hoặc PAT — token cần quyền `repo`) |
116
- | `githubcli github logout` | Đăng xuất, xóa token khỏi máy |
117
- | `githubcli github whoami` | Xem profile tài khoản đang kết nối |
118
- | `githubcli github repos` | Liệt kê repository cá nhân |
119
- | `githubcli github create` | Tạo repo mới, hỏi đẩy code lên ngay |
120
- | `githubcli github` | Mở menu quản lý GitHub tương tác |
115
+ | `githubcli github login` | Sign in with OAuth Device Flow or a PAT (requires the `repo` scope) |
116
+ | `githubcli github logout` | Sign out and remove the saved token |
117
+ | `githubcli github whoami` | Show the connected GitHub account |
118
+ | `githubcli github repos` | List your GitHub repositories |
119
+ | `githubcli github create` | Create a repository and optionally push your project |
120
+ | `githubcli github` | Open the GitHub account and repository menu |
121
121
 
122
- ### Push / Pull / Fix
122
+ ### Push, pull, and security
123
123
 
124
- | Lệnh | Mô tả |
124
+ | Command | Description |
125
125
  | :--- | :--- |
126
- | `githubcli` | Mở dashboard tương tác (Push / GitHub / Pull / Time / Fix) |
127
- | `githubcli -r <url> -m "<msg>" -b <branch> -y` | Push nhanh không hỏi lại |
128
- | `githubcli --dir ./my-app -r <url> -m "Init" -y` | Chỉ push 1 thư mục con |
129
- | `githubcli pull [remote] [branch]` | Kéo code mới (fast-forward, gợi ý `--rebase` khi cần) |
130
- | `githubcli fix` | Quét & gỡ secret, cập nhật `.gitignore`, làm sạch commit unpushed |
126
+ | `githubcli` | Open the interactive dashboard |
127
+ | `githubcli -r <url> -m "<msg>" -b <branch> -y` | Push without interactive prompts |
128
+ | `githubcli --dir ./my-app -r <url> -m "Init" -y` | Push a subfolder only |
129
+ | `githubcli pull [remote] [branch]` | Pull changes with fast-forward; offers rebase when needed |
130
+ | `githubcli fix` | Scan for secrets, update `.gitignore`, and clean unpushed commits |
131
131
 
132
- ### Flags khi push
132
+ ### Push options
133
133
 
134
- | Flag | Ý nghĩa | Ví dụ |
134
+ | Option | Description | Example |
135
135
  | :--- | :--- | :--- |
136
- | `-r, --repo <url>` | URL repository | `-r https://github.com/user/repo.git` |
136
+ | `-r, --repo <url>` | Repository URL | `-r https://github.com/user/repo.git` |
137
137
  | `-m, --message <msg>` | Commit message | `-m "Add login"` |
138
- | `-b, --branch <branch>` | Branch remote (mặc định `main`) | `-b dev` |
139
- | `-d, --date <time>` | Thời gian commit (mặc định `now`) | `-d "-2d"` |
140
- | `-C, --dir <path>` | Thư mục nguồn | `--dir ./my-app` |
141
- | `-f, --force` | Push đè (`--force`) | — |
142
- | `-y, --yes` | Bỏ qua hỏi, dùng tham số/mặc định | — |
143
- | `--fix` | Tự gỡ secret trước khi commit | — |
138
+ | `-b, --branch <branch>` | Remote branch (default: `main`) | `-b dev` |
139
+ | `-d, --date <time>` | Commit timestamp (default: `now`) | `-d "-2d"` |
140
+ | `-C, --dir <path>` | Source folder | `--dir ./my-app` |
141
+ | `-f, --force` | Force push | — |
142
+ | `-y, --yes` | Skip prompts and use provided values or defaults | — |
143
+ | `--fix` | Unstage detected secrets and update `.gitignore` | — |
144
144
 
145
145
  ---
146
146
 
147
- ## 🔑 Token & đăng nhập
147
+ ## Tokens and sign-in
148
148
 
149
- Thứ tự ưu tiên khi lấy token:
149
+ Tokens are selected in this order:
150
150
 
151
- 1. Biến môi trường `GITHUB_TOKEN` hoặc `GH_TOKEN`
152
- 2. Tài khoản active trong `~/.git-push-time/config.json`
153
- 3. Token từ `gh` CLI (`gh auth token`) nếu máy có cài
151
+ 1. `GITHUB_TOKEN` or `GH_TOKEN` environment variable
152
+ 2. Active account in `~/.git-push-time/config.json`
153
+ 3. GitHub CLI token from `gh auth token`, if installed
154
154
 
155
155
  ---
156
156
 
157
- ## ⏳ Phụ lục: tiện ích thời gian commit
157
+ ## Commit timestamps
158
158
 
159
159
  <details>
160
- <summary><b>Mở rộng: backdate khi push & sửa commit cũ</b></summary>
161
-
162
- <br>
160
+ <summary><b>Backdate a push or edit an existing commit</b></summary>
163
161
 
164
- Khi push có thể gắn thời gian tùy chỉnh bằng flag `-d`:
162
+ When pushing, set a custom timestamp with `-d`:
165
163
 
166
164
  ```bash
167
165
  githubcli -r https://github.com/user/repo.git -d "-2d" -m "Initial commit" -y
168
166
  githubcli -r https://github.com/user/repo.git -d "2024-01-15 14:30:00" -m "Add core" -y
169
167
  ```
170
168
 
171
- Sửa thời gian commit đã có trong lịch sử:
169
+ To edit a timestamp on an existing commit:
172
170
 
173
171
  ```bash
174
172
  githubcli edit-time
175
173
  ```
176
174
 
177
- | Định dạng | Ý nghĩa |
175
+ | Format | Meaning |
178
176
  | :--- | :--- |
179
- | `now` / để trống | Giờ hiện tại |
180
- | `-2d` / `2d` | Lùi 2 ngày |
181
- | `-5h` / `5h` | Lùi 5 giờ |
182
- | `-30m` / `30m` | Lùi 30 phút (`m` = minute) |
183
- | `-1w` / `1w` | Lùi 1 tuần |
184
- | `-3M` / `-3mo` | Lùi 3 tháng (`M` = month) |
185
- | `2024-01-15 14:30:00` | Ngày giờ cụ thể |
186
- | `2024-01-15` | Ngày cụ thể |
177
+ | `now` or blank | Current time |
178
+ | `-2d` / `2d` | Two days ago |
179
+ | `-5h` / `5h` | Five hours ago |
180
+ | `-30m` / `30m` | Thirty minutes ago (`m` = minute) |
181
+ | `-1w` / `1w` | One week ago |
182
+ | `-3M` / `-3mo` | Three months ago (`M` = month) |
183
+ | `2024-01-15 14:30:00` | Specific date and time |
184
+ | `2024-01-15` | Specific date |
187
185
 
188
186
  </details>
189
187
 
190
188
  ---
191
189
 
192
- ## 🏛️ Cấu trúc mã nguồn
190
+ ## Source layout
193
191
 
194
- ```
192
+ ```text
195
193
  cli/
196
194
  ├── bin/
197
- │ └── index.js # Entrypoint & Commander dispatcher
195
+ │ └── index.js # Entry point and Commander dispatcher
198
196
  ├── lib/
199
- │ ├── config.js # Config & token GitHub local
200
- │ ├── github.js # GitHub REST API (verify, repos, create)
201
- │ ├── git.js # Tác vụ Git cốt lõi
202
- │ ├── secrets.js # Quét secret trong stage
203
- │ ├── fix.js # Gỡ secret & squash unpushed
204
- │ ├── utils.js # Validate URL & parse datetime
205
- │ ├── prompt-helpers.js # Prompt trong khung (Back '..')
206
- │ ├── ui.js # Design system: Banner, Box, Dashboard
197
+ │ ├── config.js # Local GitHub account and token configuration
198
+ │ ├── github.js # GitHub REST API helpers
199
+ │ ├── git.js # Core Git operations
200
+ │ ├── secrets.js # Staged secret scanning
201
+ │ ├── fix.js # Unstage secrets and squash unpushed commits
202
+ │ ├── utils.js # URL validation and datetime parsing
203
+ │ ├── prompt-helpers.js # Interactive prompts and back navigation
204
+ │ ├── ui.js # Banner, panels, and dashboard
207
205
  │ └── commands/
208
- │ ├── push.js # Wizard push tích hợp GitHub
209
- │ ├── github.js # Menu & lệnh GitHub
210
- │ ├── pull.js # Pull (--ff-only / --rebase)
211
- │ ├── edit-time.js # Sửa thời gian commit
212
- │ └── fix.js # Quét & sửa secret
206
+ │ ├── push.js # Push wizard
207
+ │ ├── github.js # GitHub menu and commands
208
+ │ ├── pull.js # Pull with fast-forward or rebase
209
+ │ ├── edit-time.js # Edit commit timestamps
210
+ │ └── fix.js # Scan and remediate secrets
213
211
  ```
214
212
 
215
213
  ---
216
214
 
217
- ## 📄 License
215
+ ## License
218
216
 
219
- Phát hành theo giấy phép **MIT**.
217
+ MIT
package/bin/index.js CHANGED
@@ -49,7 +49,7 @@ function isExitPromptError(err) {
49
49
  }
50
50
 
51
51
  /**
52
- * Kiểm tra xem lệnh có được gọi "trần" (không flag/subcommand nào) hay không.
52
+ * Check whether the command was invoked without flags or subcommands.
53
53
  */
54
54
  function isBareInvocation(options = {}) {
55
55
  return (
@@ -64,41 +64,41 @@ function isBareInvocation(options = {}) {
64
64
  }
65
65
 
66
66
  /**
67
- * Menu chính khi chạy `git-push-time` không truyền flag
67
+ * Main menu shown when `git-push-time` is run without flags.
68
68
  */
69
69
  async function promptMainMenu() {
70
70
  return await selectBox({
71
- message: 'Bảng điều khiển tác vụ chính',
72
- hint: '↑↓ di chuyển · Enter chọn thao tác · Esc thoát',
71
+ message: 'Main dashboard',
72
+ hint: '↑↓ move · Enter select · Esc exit',
73
73
  pageSize: 10,
74
74
  choices: [
75
75
  {
76
- name: `${chalk.hex('#38BDF8').bold('PUSH')} ${chalk.hex('#334155')('·')} ${chalk.hex('#F1F5F9')('Đẩy project lên repository')}`,
76
+ name: `${chalk.hex('#38BDF8').bold('PUSH')} ${chalk.hex('#334155')('·')} ${chalk.hex('#F1F5F9')('Push a project to a repository')}`,
77
77
  value: 'push',
78
- description: 'Chọn hoặc tạo repository, rà secret và push',
78
+ description: 'Choose or create a repository, scan for secrets, and push',
79
79
  },
80
80
  {
81
- name: `${chalk.hex('#A78BFA').bold('GITHUB')} ${chalk.hex('#334155')('·')} ${chalk.hex('#CBD5E1')('Tài khoản và repository')}`,
81
+ name: `${chalk.hex('#A78BFA').bold('GITHUB')} ${chalk.hex('#334155')('·')} ${chalk.hex('#CBD5E1')('Accounts and repositories')}`,
82
82
  value: 'github',
83
- description: 'Đăng nhập, đổi tài khoản và duyệt repo GitHub',
83
+ description: 'Sign in, switch accounts, and browse GitHub repositories',
84
84
  },
85
85
  {
86
- name: `${chalk.hex('#34D399').bold('PULL')} ${chalk.hex('#334155')('·')} ${chalk.hex('#CBD5E1')('Cập nhật từ remote')}`,
86
+ name: `${chalk.hex('#34D399').bold('PULL')} ${chalk.hex('#334155')('·')} ${chalk.hex('#CBD5E1')('Get updates from a remote')}`,
87
87
  value: 'pull',
88
- description: 'Pull an toàn với fast-forward hoặc rebase, tránh conflict',
88
+ description: 'Pull safely with fast-forward or rebase',
89
89
  },
90
90
  {
91
- name: `${chalk.hex('#FBBF24').bold('EDIT TIME')} ${chalk.hex('#334155')('·')} ${chalk.hex('#CBD5E1')('Sửa thời gian commit')}`,
91
+ name: `${chalk.hex('#FBBF24').bold('EDIT TIME')} ${chalk.hex('#334155')('·')} ${chalk.hex('#CBD5E1')('Change a commit timestamp')}`,
92
92
  value: 'edit-time',
93
- description: 'Viết lại ngày giờ cho các commit đã tạo (Backdate commit)',
93
+ description: 'Rewrite the timestamp of an existing commit',
94
94
  },
95
95
  {
96
- name: `${chalk.hex('#F43F5E').bold('SECURITY')} ${chalk.hex('#334155')('·')} ${chalk.hex('#CBD5E1')('Rà soát secret')}`,
96
+ name: `${chalk.hex('#F43F5E').bold('SECURITY')} ${chalk.hex('#334155')('·')} ${chalk.hex('#CBD5E1')('Scan for secrets')}`,
97
97
  value: 'fix',
98
- description: 'Quét file .env/secrets, gỡ khỏi commit và cập nhật .gitignore',
98
+ description: 'Scan for secrets, unstage them, and update .gitignore',
99
99
  },
100
100
  {
101
- name: `${chalk.hex('#64748B').bold('THOÁT')} ${chalk.hex('#334155')('·')} ${chalk.hex('#64748B')('Đóng chương trình')}`,
101
+ name: `${chalk.hex('#64748B').bold('EXIT')} ${chalk.hex('#334155')('·')} ${chalk.hex('#64748B')('Close the program')}`,
102
102
  value: 'exit',
103
103
  },
104
104
  ],
@@ -106,7 +106,7 @@ async function promptMainMenu() {
106
106
  }
107
107
 
108
108
  /**
109
- * Vòng lặp Menu chính (không đệ quy — callback back chỉ trả sentinel)
109
+ * Main menu loop; back callbacks return a sentinel instead of recursing.
110
110
  */
111
111
  async function runMainMenuLoop(initialOptions = {}) {
112
112
  while (true) {
@@ -151,7 +151,7 @@ async function runMainMenuLoop(initialOptions = {}) {
151
151
  try {
152
152
  if (action === 'push') {
153
153
  const res = await runPushWizard(initialOptions, async () => 'back');
154
- // 'back' = user muốn về menu → tiếp tục loop; ngược lại push xong thì thoát
154
+ // 'back' returns to the dashboard; otherwise the completed push exits.
155
155
  if (res === 'back') continue;
156
156
  return;
157
157
  }
@@ -173,8 +173,7 @@ async function runMainMenuLoop(initialOptions = {}) {
173
173
  throw err;
174
174
  }
175
175
 
176
- // Mỗi tác vụ trở về cùng dashboard; không cần thêm một menu
177
- // "tiếp tục / quay lại" sau menu hành động.
176
+ // Each action returns to the dashboard, so no extra continue/back prompt is needed.
178
177
  }
179
178
  }
180
179
 
@@ -201,7 +200,7 @@ async function main(options = {}) {
201
200
  return;
202
201
  }
203
202
 
204
- // Chạy trực tiếp push wizard với các options được cung cấp
203
+ // Run the push wizard directly with the supplied options.
205
204
  try {
206
205
  await runPushWizard(options);
207
206
  } catch (err) {
@@ -222,24 +221,24 @@ styleCliHelp(program);
222
221
 
223
222
  program
224
223
  .name('git-push-time')
225
- .description('Bộ công cụ Git & GitHub CLI: Đẩy code siêu tốc, kết nối GitHub tạo repo, chỉnh thời gian commit và bảo vệ secret')
224
+ .description('Git and GitHub CLI for pushing, repository management, commit timestamps, and secret protection')
226
225
  .version(VERSION)
227
- .option('-r, --repo <url>', 'Đường dẫn Git repository (URL hoặc để trống để chọn/tạo mới)')
228
- .option('-d, --date <datetime>', 'Thời gian commit (VD: "2024-01-15 14:30:00", "-2d", "-5h", "now")')
229
- .option('-m, --message <msg>', 'Thông điệp commit (Commit message)')
230
- .option('-b, --branch <branch>', 'Tên branch trên remote (Mặc định: main)')
231
- .option('-C, --dir <path>', 'Thư mục nguồn cần push (Mặc định: thư mục hiện tại)')
232
- .option('-f, --force', 'Thực hiện push đè (--force)', false)
233
- .option('-y, --yes', 'Bỏ qua giao diện hỏi, tự động dùng tham số hoặc giá trị mặc định', false)
234
- .option('--fix', 'Tự động gỡ file secret khỏi stage & thêm .gitignore (an toàn, không xóa file thật)', false)
226
+ .option('-r, --repo <url>', 'Git repository URL, or leave empty to choose or create one')
227
+ .option('-d, --date <datetime>', 'Commit time (e.g. "2024-01-15 14:30:00", "-2d", "-5h", "now")')
228
+ .option('-m, --message <msg>', 'Commit message')
229
+ .option('-b, --branch <branch>', 'Remote branch name (default: main)')
230
+ .option('-C, --dir <path>', 'Source folder to push (default: current folder)')
231
+ .option('-f, --force', 'Force push (--force)', false)
232
+ .option('-y, --yes', 'Skip prompts and use the provided values or defaults', false)
233
+ .option('--fix', 'Unstage secret files and update .gitignore (keeps local files)', false)
235
234
  .action(async (opts) => {
236
235
  await main(opts);
237
236
  });
238
237
 
239
- // LỆNH GITHUB
238
+ // GITHUB COMMANDS
240
239
  const ghCmd = program
241
240
  .command('github')
242
- .description('Quản lý tài khoản GitHub và tạo repository mới trực tiếp')
241
+ .description('Manage GitHub accounts and repositories')
243
242
  .action(async () => {
244
243
  printBanner(VERSION);
245
244
  await runGitHubMenu();
@@ -247,8 +246,8 @@ const ghCmd = program
247
246
 
248
247
  ghCmd
249
248
  .command('create')
250
- .description('Tạo repository mới trên GitHub (Public hoặc Private)')
251
- .option('-C, --dir <path>', 'Thư mục nguồn cần liên kết')
249
+ .description('Create a GitHub repository (public or private)')
250
+ .option('-C, --dir <path>', 'Source folder used to suggest a repository name')
252
251
  .action(async (opts) => {
253
252
  printBanner(VERSION);
254
253
  const res = await promptCreateRepo({ targetDir: opts.dir || process.cwd() });
@@ -259,7 +258,7 @@ ghCmd
259
258
 
260
259
  ghCmd
261
260
  .command('whoami')
262
- .description('Xem thông tin tài khoản GitHub đang kết nối')
261
+ .description('Show the connected GitHub account')
263
262
  .action(async () => {
264
263
  printBanner(VERSION);
265
264
  await showGitHubStatus();
@@ -267,7 +266,7 @@ ghCmd
267
266
 
268
267
  ghCmd
269
268
  .command('repos')
270
- .description('Liệt kê danh sách repository trên GitHub của bạn')
269
+ .description('List your GitHub repositories')
271
270
  .action(async () => {
272
271
  printBanner(VERSION);
273
272
  await showUserRepos();
@@ -275,7 +274,7 @@ ghCmd
275
274
 
276
275
  ghCmd
277
276
  .command('login')
278
- .description('Đăng nhập tài khoản GitHub bằng OAuth Device Flow hoặc Token')
277
+ .description('Sign in to GitHub with OAuth Device Flow or a token')
279
278
  .action(async () => {
280
279
  printBanner(VERSION);
281
280
  await promptGitHubLogin();
@@ -283,37 +282,37 @@ ghCmd
283
282
 
284
283
  ghCmd
285
284
  .command('logout')
286
- .description('Đăng xuất tài khoản GitHub khỏi máy')
285
+ .description('Sign out of GitHub on this machine')
287
286
  .action(async () => {
288
287
  printBanner(VERSION);
289
288
  logoutGitHub();
290
289
  });
291
290
 
292
- // LỆNH FIX
291
+ // FIX COMMAND
293
292
  program
294
293
  .command('fix')
295
- .description('Quét & tự động gỡ file secret khỏi stage, cập nhật .gitignore và làm sạch commit unpushed')
296
- .option('-C, --dir <path>', 'Thư mục cần quét fix (Mặc định: thư mục hiện tại)')
294
+ .description('Scan for secrets, unstage files, update .gitignore, and clean unpushed commits')
295
+ .option('-C, --dir <path>', 'Folder to scan (default: current folder)')
297
296
  .action(async (opts) => {
298
297
  printBanner(VERSION);
299
298
  await runFixCommand(opts);
300
299
  });
301
300
 
302
- // LỆNH PULL
301
+ // PULL COMMAND
303
302
  program
304
303
  .command('pull [remote] [branch]')
305
- .description('Cập nhật code từ remote bằng fast-forward --ff-only hoặc --rebase')
306
- .option('-C, --dir <path>', 'Thư mục repo cần pull (Mặc định: thư mục hiện tại)')
304
+ .description('Pull from a remote with fast-forward (--ff-only) or rebase')
305
+ .option('-C, --dir <path>', 'Repository folder (default: current folder)')
307
306
  .action(async (remote, branch, opts) => {
308
307
  printBanner(VERSION);
309
308
  await runPullCommand(remote || 'origin', branch, opts || {});
310
309
  });
311
310
 
312
- // LỆNH EDIT-TIME
311
+ // EDIT-TIME COMMAND
313
312
  program
314
313
  .command('edit-time')
315
- .description('Sửa thời gian của commit lịch sử (Backdate commit hash)')
316
- .option('-C, --dir <path>', 'Thư mục repo (Mặc định: thư mục hiện tại)')
314
+ .description('Change the timestamp of an existing commit')
315
+ .option('-C, --dir <path>', 'Repository folder (default: current folder)')
317
316
  .action(async (opts) => {
318
317
  printBanner(VERSION);
319
318
  await runEditCommitTimeCommand(opts);