git-push-time 1.1.1 → 1.1.2
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/.github/workflows/npm-publish.yml +1 -2
- package/README.md +219 -215
- package/bin/index.js +25 -23
- package/lib/commands/github.js +16 -10
- package/lib/commands/pull.js +3 -2
- package/lib/commands/push.js +84 -37
- package/lib/git.js +24 -0
- package/lib/prompt-helpers.js +194 -62
- package/lib/ui.js +359 -100
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,215 +1,219 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
###
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
|
178
|
-
|
|
|
179
|
-
|
|
|
180
|
-
| `-
|
|
181
|
-
| `-
|
|
182
|
-
| `-
|
|
183
|
-
| `-
|
|
184
|
-
| `
|
|
185
|
-
| `2024-01-15` | Ngày
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
│
|
|
198
|
-
|
|
199
|
-
│ ├──
|
|
200
|
-
│ ├──
|
|
201
|
-
│ ├──
|
|
202
|
-
│ ├──
|
|
203
|
-
│ ├──
|
|
204
|
-
│
|
|
205
|
-
│
|
|
206
|
-
│
|
|
207
|
-
│
|
|
208
|
-
│ ├──
|
|
209
|
-
│
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# 🐙 GitHub CLI (`githubcli`)
|
|
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ỗ.**
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/git-push-time)
|
|
8
|
+
[](./LICENSE)
|
|
9
|
+
[](https://nodejs.org)
|
|
10
|
+
[](https://github.com)
|
|
11
|
+
|
|
12
|
+
`githubcli` · `git-push-time` · `git-custom-push`
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## ✨ Tính năng
|
|
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).
|
|
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õ `..`).
|
|
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.
|
|
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.
|
|
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).*
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## 📦 Cài đặt
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Cài toàn cục (khuyên dùng) — dùng được ở mọi thư mục
|
|
50
|
+
npm install -g git-push-time
|
|
51
|
+
|
|
52
|
+
# Hoặc chạy trực tiếp không cần cài
|
|
53
|
+
npx git-push-time
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Yêu cầu: **Node.js ≥ 18** và **Git** đã cài đặt.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## ⚡ Bắt đầu nhanh (3 bước)
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# 1. Đăng nhập GitHub (mở trình duyệt, nhập mã xác nhận)
|
|
64
|
+
githubcli github login
|
|
65
|
+
|
|
66
|
+
# 2. Tạo repo mới (Public/Private), xong chọn đẩy code lên luôn
|
|
67
|
+
githubcli github create
|
|
68
|
+
|
|
69
|
+
# 3. Hoặc đẩy project hiện tại lên repo bất kỳ
|
|
70
|
+
githubcli -r https://github.com/username/my-repo.git -m "Initial commit" -b main -y
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Luồng wizard khi chạy tay `githubcli` (không kèm flag):
|
|
74
|
+
|
|
75
|
+
```text
|
|
76
|
+
githubcli
|
|
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)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 🖥️ Giao diện
|
|
90
|
+
|
|
91
|
+
```text
|
|
92
|
+
╭─────────────── git-push-time v1.1.1 ───────────────╮
|
|
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
|
+
╰─────────────────────────────────────────────────────╯
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 🛠️ Lệnh
|
|
110
|
+
|
|
111
|
+
### GitHub
|
|
112
|
+
|
|
113
|
+
| Lệnh | Mô tả |
|
|
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 |
|
|
121
|
+
|
|
122
|
+
### Push / Pull / Fix
|
|
123
|
+
|
|
124
|
+
| Lệnh | Mô tả |
|
|
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 |
|
|
131
|
+
|
|
132
|
+
### Flags khi push
|
|
133
|
+
|
|
134
|
+
| Flag | Ý nghĩa | Ví dụ |
|
|
135
|
+
| :--- | :--- | :--- |
|
|
136
|
+
| `-r, --repo <url>` | URL repository | `-r https://github.com/user/repo.git` |
|
|
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 | — |
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 🔑 Token & đăng nhập
|
|
148
|
+
|
|
149
|
+
Thứ tự ưu tiên khi lấy token:
|
|
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
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## ⏳ Phụ lục: tiện ích thời gian commit
|
|
158
|
+
|
|
159
|
+
<details>
|
|
160
|
+
<summary><b>Mở rộng: backdate khi push & sửa commit cũ</b></summary>
|
|
161
|
+
|
|
162
|
+
<br>
|
|
163
|
+
|
|
164
|
+
Khi push có thể gắn thời gian tùy chỉnh bằng flag `-d`:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
githubcli -r https://github.com/user/repo.git -d "-2d" -m "Initial commit" -y
|
|
168
|
+
githubcli -r https://github.com/user/repo.git -d "2024-01-15 14:30:00" -m "Add core" -y
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Sửa thời gian commit đã có trong lịch sử:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
githubcli edit-time
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
| Định dạng | Ý nghĩa |
|
|
178
|
+
| :--- | :--- |
|
|
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ể |
|
|
187
|
+
|
|
188
|
+
</details>
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## 🏛️ Cấu trúc mã nguồn
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
cli/
|
|
196
|
+
├── bin/
|
|
197
|
+
│ └── index.js # Entrypoint & Commander dispatcher
|
|
198
|
+
├── 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
|
|
207
|
+
│ └── 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
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## 📄 License
|
|
218
|
+
|
|
219
|
+
Phát hành theo giấy phép **MIT**.
|
package/bin/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { Command } from 'commander';
|
|
4
|
-
import
|
|
4
|
+
import chalk from 'chalk';
|
|
5
5
|
import fs from 'fs';
|
|
6
6
|
import path from 'path';
|
|
7
7
|
import { fileURLToPath } from 'url';
|
|
8
|
-
import { checkGitInstalled, getCurrentBranch } from '../lib/git.js';
|
|
8
|
+
import { checkGitInstalled, getCurrentBranch, getDashboardGitStatus } from '../lib/git.js';
|
|
9
9
|
import { getCurrentGitHubUser } from '../lib/github.js';
|
|
10
10
|
import { runPushWizard } from '../lib/commands/push.js';
|
|
11
11
|
import { runPullCommand } from '../lib/commands/pull.js';
|
|
@@ -16,11 +16,10 @@ import {
|
|
|
16
16
|
promptCreateRepo,
|
|
17
17
|
showUserRepos,
|
|
18
18
|
} from '../lib/commands/github.js';
|
|
19
|
-
import { promptContinueOrBack } from '../lib/prompt-helpers.js';
|
|
19
|
+
import { promptContinueOrBack, selectBox } from '../lib/prompt-helpers.js';
|
|
20
20
|
import {
|
|
21
21
|
printBanner,
|
|
22
22
|
printDashboardStatus,
|
|
23
|
-
printSection,
|
|
24
23
|
printGitMissing,
|
|
25
24
|
printCancelled,
|
|
26
25
|
styleCliHelp
|
|
@@ -68,42 +67,41 @@ function isBareInvocation(options = {}) {
|
|
|
68
67
|
* Menu chính khi chạy `git-push-time` không truyền flag
|
|
69
68
|
*/
|
|
70
69
|
async function promptMainMenu() {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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',
|
|
74
73
|
pageSize: 10,
|
|
75
74
|
choices: [
|
|
76
75
|
{
|
|
77
|
-
name: 'Đẩy
|
|
76
|
+
name: `${chalk.hex('#38BDF8').bold('→ PUSH ')} ${chalk.hex('#334155')('│')} ${chalk.hex('#F1F5F9')('Đẩy code lên Git với giờ tùy chỉnh')}`,
|
|
78
77
|
value: 'push',
|
|
79
|
-
description: '
|
|
78
|
+
description: 'Đẩy code lên Git với tùy chỉnh thời gian commit, kiểm tra secret và branch',
|
|
80
79
|
},
|
|
81
80
|
{
|
|
82
|
-
name: 'Quản lý
|
|
81
|
+
name: `${chalk.hex('#A78BFA').bold('→ GITHUB ')} ${chalk.hex('#334155')('│')} ${chalk.hex('#CBD5E1')('Quản lý tài khoản & tạo repository')}`,
|
|
83
82
|
value: 'github',
|
|
84
|
-
description: 'Tạo
|
|
83
|
+
description: 'Tạo nhanh repo GitHub public/private, liên kết remote tự động',
|
|
85
84
|
},
|
|
86
85
|
{
|
|
87
|
-
name: '
|
|
86
|
+
name: `${chalk.hex('#34D399').bold('→ PULL ')} ${chalk.hex('#334155')('│')} ${chalk.hex('#CBD5E1')('Cập nhật code mới nhất từ remote')}`,
|
|
88
87
|
value: 'pull',
|
|
89
|
-
description: '
|
|
88
|
+
description: 'Pull an toàn với fast-forward hoặc rebase, tránh conflict',
|
|
90
89
|
},
|
|
91
90
|
{
|
|
92
|
-
name: '
|
|
91
|
+
name: `${chalk.hex('#FBBF24').bold('→ EDIT-TIME ')} ${chalk.hex('#334155')('│')} ${chalk.hex('#CBD5E1')('Đổi timestamp commit lịch sử bất kỳ')}`,
|
|
93
92
|
value: 'edit-time',
|
|
94
|
-
description: '
|
|
93
|
+
description: 'Viết lại ngày giờ cho các commit đã tạo (Backdate commit)',
|
|
95
94
|
},
|
|
96
95
|
{
|
|
97
|
-
name: 'Quét
|
|
96
|
+
name: `${chalk.hex('#F43F5E').bold('→ FIX ')} ${chalk.hex('#334155')('│')} ${chalk.hex('#CBD5E1')('Quét & gỡ key bí mật, bảo vệ GH013')}`,
|
|
98
97
|
value: 'fix',
|
|
99
|
-
description: '
|
|
98
|
+
description: 'Quét file .env/secrets, gỡ khỏi commit và cập nhật .gitignore',
|
|
100
99
|
},
|
|
101
100
|
{
|
|
102
|
-
name: '
|
|
101
|
+
name: `${chalk.hex('#64748B').bold('x THOÁT ')} ${chalk.hex('#334155')('│')} ${chalk.hex('#64748B')('Đóng chương trình')}`,
|
|
103
102
|
value: 'exit',
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
]
|
|
103
|
+
},
|
|
104
|
+
],
|
|
107
105
|
});
|
|
108
106
|
}
|
|
109
107
|
|
|
@@ -124,12 +122,16 @@ async function runMainMenuLoop(initialOptions = {}) {
|
|
|
124
122
|
ghStatus = { authenticated: false };
|
|
125
123
|
}
|
|
126
124
|
|
|
125
|
+
const gitStatus = getDashboardGitStatus(cwd);
|
|
127
126
|
printDashboardStatus({
|
|
128
127
|
targetDir: cwd,
|
|
129
128
|
currentBranch: branch,
|
|
130
|
-
githubUser: ghStatus.authenticated ? ghStatus.user : null
|
|
129
|
+
githubUser: ghStatus.authenticated ? ghStatus.user : null,
|
|
130
|
+
remoteUrl: gitStatus.remoteUrl,
|
|
131
|
+
changes: gitStatus.changes,
|
|
132
|
+
lastCommit: gitStatus.lastCommit,
|
|
133
|
+
version: VERSION,
|
|
131
134
|
});
|
|
132
|
-
|
|
133
135
|
let action;
|
|
134
136
|
try {
|
|
135
137
|
action = await promptMainMenu();
|