gittable 1.0.8 → 1.0.9
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 +13 -313
- package/package.json +12 -9
- package/src/cli/interactive.js +65 -25
- package/src/commands/remote/push.js +27 -5
- package/src/commands/utilities/examples.js +2 -2
- package/src/commands/utilities/help.js +298 -9
- package/src/commands/utilities/index.js +5 -21
- package/src/commands/utilities/tag.js +195 -28
- package/src/commands/utilities/tutorial.js +784 -627
- package/src/core/config/setup.js +22 -13
- package/src/core/git/executor.js +2 -1
- package/src/ui/components/cli-table3/cell.js +410 -0
- package/src/ui/components/cli-table3/debug.js +29 -0
- package/src/ui/components/cli-table3/index.js +2 -0
- package/src/ui/components/cli-table3/layout-manager.js +255 -0
- package/src/ui/components/cli-table3/table.js +107 -0
- package/src/ui/components/cli-table3/utils.js +346 -0
- package/src/ui/components/index.js +5 -0
- package/src/ui/components/sisteransi.js +59 -0
- package/src/ui/components/spinner.js +459 -0
- package/src/ui/framework/layout.js +11 -14
- package/src/ui/framework/prompts.js +155 -155
- package/src/ui/framework/tables.js +1 -1
- package/src/ui/prompts/block.js +1 -1
- package/src/ui/prompts/core.js +1 -1
- package/src/ui/prompts/helpers.js +3 -9
- package/src/ui/prompts/index.js +1 -1
- package/src/ui/prompts/select.js +1 -1
- package/src/utils/commands/command-helpers.js +9 -0
- package/src/utils/table-sort.js +2 -7
- package/src/utils/ui/index.js +0 -1
- package/src/utils/ui/progress-indicator.js +2 -2
- package/src/utils/versions.js +1 -3
- package/src/ui/prompts/spinner.js +0 -116
- package/src/utils/ui/spinner.js +0 -57
- /package/src/ui/{ascii.js → components/ascii.js} +0 -0
package/README.md
CHANGED
|
@@ -1,31 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center"><a name="readme-top"></a>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/gittable)
|
|
4
|
+
[](https://github.com/GG-Santos/Gittable)
|
|
5
|
+
[](https://github.com/GG-Santos/Gittable)
|
|
4
6
|
|
|
5
|
-
**A modern, interactive Git CLI wrapper with conventional commits**
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
[](https://github.com/GG-Santos/Gittable)
|
|
10
|
-
|
|
11
|
-
[Installation](#installation) • [Quick Start](#quick-start) • [Documentation](#documentation) • [Architecture](./ARCHITECTURE.md)
|
|
8
|
+
<div align="justify">
|
|
9
|
+
Gittable is a modern, interactive suite built on top of Git operations, designed to improve developer productivity and make everyday Git workflows more intuitive. Rather than replacing Git, Gittable wraps standard Git commands in a beautiful, guided CLI experience that helps developers work faster, safer, and with more confidence—while remaining fully compatible with existing repositories and workflows. </br></br>
|
|
12
10
|
|
|
11
|
+
Every interaction is designed to reduce friction and prevent mistakes before they happen. For example, when committing with Gittable, you’re guided through required commit fields at commit time, with instant feedback on formatting and conventions. No more failed commits from late-running hooks, and no more hunting through CONTRIBUTING.md to figure out the correct message format. This same philosophy extends across the full Gittable workflow: proactive guidance, clear feedback, and smarter defaults that help teams stay consistent without slowing down. </br></br>
|
|
13
12
|
</div>
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Gittable is a modern, interactive Git CLI wrapper that enhances the standard Git experience with beautiful prompts, conventional commits enforcement, and intelligent workflow suggestions. It provides a user-friendly interface for common Git operations while maintaining full compatibility with standard Git commands.
|
|
18
|
-
|
|
19
|
-
## ✨ Features
|
|
20
|
-
|
|
21
|
-
- **🎨 Beautiful CLI Interface** - Native prompt system with colorful banners, tables, and status displays
|
|
22
|
-
- **📝 Conventional Commits** - Enforces conventional commit message format for better project history
|
|
23
|
-
- **⚡ Workflow Shortcuts** - Combined commands like `quick` (add+commit+push), `commit-push`, `add-commit`
|
|
24
|
-
- **🧠 Smart Suggestions** - Context-aware next-step prompts after each command
|
|
25
|
-
- **🛡️ Safety Features** - Branch protection warnings, backup before destructive operations
|
|
26
|
-
- **🔧 Fully Configurable** - Customize commit types, scopes, and command behavior
|
|
27
|
-
- **📚 Interactive Tutorial** - Learn Git workflows with guided tutorials
|
|
28
|
-
- **🚀 Fast & Lightweight** - Minimal dependencies, maximum performance
|
|
14
|
+
</div>
|
|
15
|
+
<div align="left">
|
|
29
16
|
|
|
30
17
|
## 📦 Installation
|
|
31
18
|
|
|
@@ -47,291 +34,15 @@ npm install --save-dev gittable
|
|
|
47
34
|
npx gittable <command>
|
|
48
35
|
```
|
|
49
36
|
|
|
50
|
-
For detailed installation instructions, see the [Installation](#installation) section below.
|
|
51
|
-
|
|
52
|
-
## 🚀 Quick Start
|
|
53
|
-
|
|
54
|
-
### Interactive Mode
|
|
55
|
-
|
|
56
37
|
Simply run `gittable` without any arguments to enter interactive mode:
|
|
57
38
|
|
|
58
39
|
```bash
|
|
59
|
-
gittable
|
|
40
|
+
npx gittable
|
|
60
41
|
```
|
|
61
42
|
|
|
62
43
|
This displays a beautiful category-based menu for easy command discovery.
|
|
63
44
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
Use Gittable just like Git, but with enhanced prompts:
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
# Check repository status
|
|
70
|
-
gittable status
|
|
71
|
-
gittable st
|
|
72
|
-
|
|
73
|
-
# Create a commit with conventional format
|
|
74
|
-
gittable commit
|
|
75
|
-
gittable ci
|
|
76
|
-
|
|
77
|
-
# Branch management
|
|
78
|
-
gittable branch
|
|
79
|
-
gittable br
|
|
80
|
-
|
|
81
|
-
# Quick workflow (add + commit + push)
|
|
82
|
-
gittable quick
|
|
83
|
-
gittable q
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
## 📖 Available Commands
|
|
87
|
-
|
|
88
|
-
### Core Commands
|
|
89
|
-
|
|
90
|
-
| Command | Aliases | Description |
|
|
91
|
-
|---------|---------|-------------|
|
|
92
|
-
| `status` | `st`, `s` | Show repository status with color-coded display |
|
|
93
|
-
| `info` | | Quick repository overview |
|
|
94
|
-
| `add` | | Stage files for commit with interactive selection |
|
|
95
|
-
| `commit` | `ci`, `save` | Create commits with conventional format |
|
|
96
|
-
| `diff` | | Show changes with formatted output |
|
|
97
|
-
| `log` | | View commit history with formatted output |
|
|
98
|
-
|
|
99
|
-
### Workflow Commands ⚡
|
|
100
|
-
|
|
101
|
-
| Command | Aliases | Description |
|
|
102
|
-
|---------|---------|-------------|
|
|
103
|
-
| `quick` | `q` | Full workflow: add + commit + push |
|
|
104
|
-
| `add-commit` | `ac` | Stage files and commit in one flow |
|
|
105
|
-
| `commit-push` | `cp` | Commit and push in one flow |
|
|
106
|
-
| `commit-sync` | `cs` | Commit and sync (fetch + rebase + push) |
|
|
107
|
-
| `sync` | | Synchronize (pull + rebase + push) |
|
|
108
|
-
|
|
109
|
-
### Branching Commands
|
|
110
|
-
|
|
111
|
-
| Command | Aliases | Description |
|
|
112
|
-
|---------|---------|-------------|
|
|
113
|
-
| `branch` | `br`, `co` | Branch management (list, create, checkout, delete) |
|
|
114
|
-
| `checkout` | `co` | Checkout files or branches |
|
|
115
|
-
| `merge` | | Merge branches with interactive prompts |
|
|
116
|
-
| `rebase` | | Rebase operations with safety checks |
|
|
117
|
-
| `branch-clean` | | Delete merged branches interactively |
|
|
118
|
-
|
|
119
|
-
### Remote Commands
|
|
120
|
-
|
|
121
|
-
| Command | Aliases | Description |
|
|
122
|
-
|---------|---------|-------------|
|
|
123
|
-
| `push` | `ps`, `up` | Push to remote repository |
|
|
124
|
-
| `pull` | `pl`, `down` | Fetch and merge from remote |
|
|
125
|
-
| `fetch` | | Fetch from remote with status updates |
|
|
126
|
-
| `create-pr` | `pr` | Create pull request after push |
|
|
127
|
-
|
|
128
|
-
See the [Available Commands](#-available-commands) section above for more commands.
|
|
129
|
-
|
|
130
|
-
## ⚙️ Configuration
|
|
131
|
-
|
|
132
|
-
Gittable uses configuration files to customize commit prompts and behavior. Create one of the following files in your project root:
|
|
133
|
-
|
|
134
|
-
- `.gittable.js`
|
|
135
|
-
- `.gittable.json`
|
|
136
|
-
- Or add config to `package.json` under `gittable` key
|
|
137
|
-
|
|
138
|
-
### Example Configuration (`.gittable.js`)
|
|
139
|
-
|
|
140
|
-
```javascript
|
|
141
|
-
module.exports = {
|
|
142
|
-
types: [
|
|
143
|
-
{ value: 'feat', name: 'feat: A new feature' },
|
|
144
|
-
{ value: 'fix', name: 'fix: A bug fix' },
|
|
145
|
-
{ value: 'docs', name: 'docs: Documentation only changes' },
|
|
146
|
-
{ value: 'style', name: 'style: Code style changes (formatting, etc.)' },
|
|
147
|
-
{ value: 'refactor', name: 'refactor: Code refactoring' },
|
|
148
|
-
{ value: 'perf', name: 'perf: Performance improvements' },
|
|
149
|
-
{ value: 'test', name: 'test: Adding or updating tests' },
|
|
150
|
-
{ value: 'chore', name: 'chore: Maintenance tasks' },
|
|
151
|
-
],
|
|
152
|
-
scopes: [
|
|
153
|
-
'components',
|
|
154
|
-
'api',
|
|
155
|
-
'auth',
|
|
156
|
-
'db',
|
|
157
|
-
'config',
|
|
158
|
-
'utils',
|
|
159
|
-
],
|
|
160
|
-
allowTicketNumber: true,
|
|
161
|
-
ticketNumberPrefix: 'TICKET-',
|
|
162
|
-
subjectLimit: 100,
|
|
163
|
-
allowBreakingChanges: ['feat', 'fix'],
|
|
164
|
-
};
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
See the [Configuration](#️-configuration) section above for more details.
|
|
168
|
-
|
|
169
|
-
## 📚 Documentation
|
|
170
|
-
|
|
171
|
-
- **[Architecture](./ARCHITECTURE.md)** - System architecture and design
|
|
172
|
-
- **README** - This file contains installation, usage, and configuration guides
|
|
173
|
-
|
|
174
|
-
## 💡 Usage Examples
|
|
175
|
-
|
|
176
|
-
### Creating a Commit
|
|
177
|
-
|
|
178
|
-
```bash
|
|
179
|
-
gittable commit
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
This interactive command guides you through:
|
|
183
|
-
1. Selecting commit type (feat, fix, docs, etc.)
|
|
184
|
-
2. Choosing scope (optional)
|
|
185
|
-
3. Entering ticket number (if enabled)
|
|
186
|
-
4. Writing commit message
|
|
187
|
-
5. Adding extended description (optional)
|
|
188
|
-
6. Breaking changes (if applicable)
|
|
189
|
-
7. Issues closed (optional)
|
|
190
|
-
|
|
191
|
-
### Quick Workflow
|
|
192
|
-
|
|
193
|
-
```bash
|
|
194
|
-
gittable quick
|
|
195
|
-
# or
|
|
196
|
-
gittable q
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
This will:
|
|
200
|
-
1. Show changes
|
|
201
|
-
2. Stage files (with confirmation)
|
|
202
|
-
3. Create a commit (interactive)
|
|
203
|
-
4. Push to remote (with confirmation)
|
|
204
|
-
|
|
205
|
-
### Combined Commands
|
|
206
|
-
|
|
207
|
-
```bash
|
|
208
|
-
# Stage and commit in one flow
|
|
209
|
-
gittable add-commit
|
|
210
|
-
gittable ac
|
|
211
|
-
|
|
212
|
-
# Commit and push
|
|
213
|
-
gittable commit-push
|
|
214
|
-
gittable cp
|
|
215
|
-
|
|
216
|
-
# Commit and sync (fetch + rebase + push)
|
|
217
|
-
gittable commit-sync
|
|
218
|
-
gittable cs
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
### Branch Management
|
|
222
|
-
|
|
223
|
-
```bash
|
|
224
|
-
# List all branches
|
|
225
|
-
gittable branch
|
|
226
|
-
|
|
227
|
-
# Create and checkout new branch
|
|
228
|
-
gittable branch create feature/new-feature
|
|
229
|
-
|
|
230
|
-
# Clean up merged branches
|
|
231
|
-
gittable branch-clean
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
### Status Check
|
|
235
|
-
|
|
236
|
-
```bash
|
|
237
|
-
gittable status
|
|
238
|
-
# or use short alias
|
|
239
|
-
gittable st
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
Shows a beautiful, color-coded status display with:
|
|
243
|
-
- Current branch information
|
|
244
|
-
- Last commit message and time
|
|
245
|
-
- Staged files
|
|
246
|
-
- Unstaged files
|
|
247
|
-
- Untracked files
|
|
248
|
-
- Ahead/behind information relative to remote
|
|
249
|
-
- Smart suggestions for next actions
|
|
250
|
-
|
|
251
|
-
## 🛠️ Development
|
|
252
|
-
|
|
253
|
-
### Prerequisites
|
|
254
|
-
|
|
255
|
-
- Node.js >= 14.0.0
|
|
256
|
-
- npm or yarn
|
|
257
|
-
- Git
|
|
258
|
-
|
|
259
|
-
### Setup
|
|
260
|
-
|
|
261
|
-
```bash
|
|
262
|
-
# Clone repository
|
|
263
|
-
git clone https://github.com/GG-Santos/Gittable.git
|
|
264
|
-
cd Gittable
|
|
265
|
-
|
|
266
|
-
# Install dependencies
|
|
267
|
-
npm install
|
|
268
|
-
|
|
269
|
-
# Link for local development
|
|
270
|
-
npm link
|
|
271
|
-
|
|
272
|
-
# Run tests
|
|
273
|
-
npm test
|
|
274
|
-
|
|
275
|
-
# Lint code
|
|
276
|
-
npm run lint
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
For development setup, see the [Development](#️-development) section above.
|
|
280
|
-
|
|
281
|
-
## 🏗️ Architecture
|
|
282
|
-
|
|
283
|
-
Gittable uses a modular, category-based architecture for better maintainability and extensibility.
|
|
284
|
-
|
|
285
|
-
### Project Structure
|
|
286
|
-
|
|
287
|
-
```
|
|
288
|
-
gittable/
|
|
289
|
-
├── src/
|
|
290
|
-
│ ├── cli/ # CLI layer (entry, parsing, routing)
|
|
291
|
-
│ ├── commands/ # Commands organized by category
|
|
292
|
-
│ ├── core/ # Core business logic
|
|
293
|
-
│ ├── ui/ # UI components and framework
|
|
294
|
-
│ └── utils/ # Shared utilities
|
|
295
|
-
├── test/ # Test suite (unit, integration, fixtures)
|
|
296
|
-
├── scripts/ # Build and publish scripts
|
|
297
|
-
└── index.js # Main entry point
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
See [ARCHITECTURE.md](./ARCHITECTURE.md) for detailed architecture documentation.
|
|
301
|
-
|
|
302
|
-
## 📦 Dependencies
|
|
303
|
-
|
|
304
|
-
### Production Dependencies
|
|
305
|
-
|
|
306
|
-
- **chalk** (^4.1.2) - Terminal string styling
|
|
307
|
-
- **cli-table3** (^0.6.5) - Beautiful tables for CLI output
|
|
308
|
-
- **find-config** (^1.0.0) - Configuration file discovery
|
|
309
|
-
- **prettycli** (^1.1.0) - Enhanced CLI logging
|
|
310
|
-
- **sisteransi** (^1.0.5) - ANSI escape sequences
|
|
311
|
-
- **wcwidth** (^1.0.1) - Character width calculation
|
|
312
|
-
- **word-wrap** (^1.2.5) - Text wrapping utility
|
|
313
|
-
|
|
314
|
-
### Development Dependencies
|
|
315
|
-
|
|
316
|
-
- **@biomejs/biome** (^1.9.4) - Fast formatter and linter
|
|
317
|
-
|
|
318
|
-
## 🤝 Contributing
|
|
319
|
-
|
|
320
|
-
Contributions are welcome! Please follow these guidelines:
|
|
321
|
-
1. Fork the repository
|
|
322
|
-
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
323
|
-
3. Make your changes and add tests
|
|
324
|
-
4. Commit using conventional commits (`feat: add amazing feature`)
|
|
325
|
-
5. Push to your branch (`git push origin feature/amazing-feature`)
|
|
326
|
-
6. Open a Pull Request
|
|
327
|
-
|
|
328
|
-
For more details, see the [Development](#️-development) section above.
|
|
329
|
-
|
|
330
|
-
## 📄 License
|
|
331
|
-
|
|
332
|
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
333
|
-
|
|
334
|
-
## 🙏 Acknowledgments
|
|
45
|
+
## Acknowledgments
|
|
335
46
|
|
|
336
47
|
Gittable is built with the following excellent open-source projects:
|
|
337
48
|
|
|
@@ -339,21 +50,10 @@ Gittable is built with the following excellent open-source projects:
|
|
|
339
50
|
- **[conventional-changelog](https://github.com/conventional-changelog)** - Conventional commits specification
|
|
340
51
|
- **[chalk](https://github.com/chalk/chalk)** by [@sindresorhus](https://github.com/sindresorhus) - Terminal string styling
|
|
341
52
|
- **[cli-table3](https://github.com/cli-table/cli-table3)** - Beautiful CLI tables
|
|
342
|
-
- **[Biome](https://biomejs.dev/)** - Fast formatter and linter
|
|
343
53
|
|
|
344
|
-
##
|
|
54
|
+
## Author
|
|
345
55
|
|
|
346
56
|
**GG-Santos** from Wab n' Wab Atelier
|
|
347
57
|
|
|
348
58
|
- Email: ggsantos_0415@proton.me
|
|
349
|
-
- GitHub: [@GG-Santos](https://github.com/GG-Santos)
|
|
350
|
-
|
|
351
|
-
---
|
|
352
|
-
|
|
353
|
-
<div align="center">
|
|
354
|
-
|
|
355
|
-
Made with dedication by the Wab n' Wab Atelier
|
|
356
|
-
|
|
357
|
-
[Report Bug](https://github.com/GG-Santos/Gittable/issues) • [Request Feature](https://github.com/GG-Santos/Gittable/issues) • [View on GitHub](https://github.com/GG-Santos/Gittable)
|
|
358
|
-
|
|
359
|
-
</div>
|
|
59
|
+
- GitHub: [@GG-Santos](https://github.com/GG-Santos)
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.0.
|
|
2
|
+
"version": "1.0.9",
|
|
3
3
|
"name": "gittable",
|
|
4
4
|
"description": "Modern Git CLI with Conventional Commits",
|
|
5
5
|
"main": "index.js",
|
|
@@ -12,11 +12,7 @@
|
|
|
12
12
|
"lint": "biome check .",
|
|
13
13
|
"lint:fix": "biome check --write .",
|
|
14
14
|
"format": "biome format --write .",
|
|
15
|
-
"
|
|
16
|
-
"test:watch": "node --test --watch test/**/*.test.js",
|
|
17
|
-
"publish:github": "npm publish --registry=https://npm.pkg.github.com",
|
|
18
|
-
"publish:npm": "node scripts/publish-npm.js",
|
|
19
|
-
"publish:both": "npm run publish:github && npm run publish:npm",
|
|
15
|
+
"package": "npm publish --registry=https://npm.pkg.github.com && node scripts/publish-npm.js",
|
|
20
16
|
"gittable": "node index.js"
|
|
21
17
|
},
|
|
22
18
|
"repository": {
|
|
@@ -38,12 +34,19 @@
|
|
|
38
34
|
"version-control"
|
|
39
35
|
],
|
|
40
36
|
"dependencies": {
|
|
37
|
+
"@colors/colors": "^1.6.0",
|
|
41
38
|
"chalk": "^4.1.2",
|
|
42
|
-
"cli-
|
|
39
|
+
"cli-cursor": "^4.0.0",
|
|
40
|
+
"cli-spinners": "^3.3.0",
|
|
43
41
|
"find-config": "^1.0.0",
|
|
42
|
+
"is-interactive": "^1.0.0",
|
|
43
|
+
"is-unicode-supported": "^1.3.0",
|
|
44
|
+
"log-symbols": "^5.1.0",
|
|
44
45
|
"prettycli": "^1.1.0",
|
|
45
|
-
"
|
|
46
|
-
"
|
|
46
|
+
"stdin-discarder": "^0.3.0",
|
|
47
|
+
"string-width": "^6.1.0",
|
|
48
|
+
"strip-ansi": "^7.1.2",
|
|
49
|
+
"terminal-link": "^3.0.0",
|
|
47
50
|
"word-wrap": "^1.2.5"
|
|
48
51
|
},
|
|
49
52
|
"devDependencies": {
|
package/src/cli/interactive.js
CHANGED
|
@@ -73,7 +73,6 @@ function getWorkflowMap() {
|
|
|
73
73
|
fileOps: 'File Operations',
|
|
74
74
|
repoManagement: 'Repository Management',
|
|
75
75
|
tagging: 'Tagging',
|
|
76
|
-
helpLearning: 'Help & Learning',
|
|
77
76
|
quickActions: 'Quick Actions',
|
|
78
77
|
undo: 'Undo & Recovery',
|
|
79
78
|
inspection: 'Inspection',
|
|
@@ -82,10 +81,7 @@ function getWorkflowMap() {
|
|
|
82
81
|
gittableSettings: {
|
|
83
82
|
label: 'Gittable Settings',
|
|
84
83
|
description: 'Configure Gittable appearance and behavior',
|
|
85
|
-
subcategories:
|
|
86
|
-
appearance: 'Appearance',
|
|
87
|
-
behavior: 'Behavior',
|
|
88
|
-
},
|
|
84
|
+
subcategories: null,
|
|
89
85
|
},
|
|
90
86
|
};
|
|
91
87
|
}
|
|
@@ -98,12 +94,8 @@ function getWorkflowMap() {
|
|
|
98
94
|
function mapCommandToWorkflow(commandName, category, subcategory) {
|
|
99
95
|
// Special handling for settings commands (utilities category with settings subcategory)
|
|
100
96
|
if (category === 'utilities' && subcategory === 'settings') {
|
|
101
|
-
// Map settings commands to gittableSettings workflow
|
|
102
|
-
|
|
103
|
-
return { workflow: 'gittableSettings', subcategory: 'appearance' };
|
|
104
|
-
}
|
|
105
|
-
// config goes to behavior
|
|
106
|
-
return { workflow: 'gittableSettings', subcategory: 'behavior' };
|
|
97
|
+
// Map all settings commands directly to gittableSettings workflow (no subcategory)
|
|
98
|
+
return { workflow: 'gittableSettings', subcategory: null };
|
|
107
99
|
}
|
|
108
100
|
|
|
109
101
|
// Map workflow category based on subcategory
|
|
@@ -140,9 +132,6 @@ function mapCommandToWorkflow(commandName, category, subcategory) {
|
|
|
140
132
|
if (subcategory === 'tagging') {
|
|
141
133
|
return { workflow: 'maintenanceUtilities', subcategory: 'tagging' };
|
|
142
134
|
}
|
|
143
|
-
if (subcategory === 'help' || subcategory === 'commandHistory') {
|
|
144
|
-
return { workflow: 'maintenanceUtilities', subcategory: 'helpLearning' };
|
|
145
|
-
}
|
|
146
135
|
if (subcategory === 'inspection') {
|
|
147
136
|
return { workflow: 'historyInspection', subcategory: 'repositoryState' };
|
|
148
137
|
}
|
|
@@ -150,7 +139,7 @@ function mapCommandToWorkflow(commandName, category, subcategory) {
|
|
|
150
139
|
// diff-preview and preview-diff already handled above, but fallback
|
|
151
140
|
return { workflow: 'dailyDevelopment', subcategory: 'previewChanges' };
|
|
152
141
|
}
|
|
153
|
-
return { workflow: 'maintenanceUtilities', subcategory: '
|
|
142
|
+
return { workflow: 'maintenanceUtilities', subcategory: 'quickActions' };
|
|
154
143
|
}
|
|
155
144
|
|
|
156
145
|
// Map core category
|
|
@@ -206,7 +195,7 @@ function mapCommandToWorkflow(commandName, category, subcategory) {
|
|
|
206
195
|
}
|
|
207
196
|
|
|
208
197
|
// Default fallback
|
|
209
|
-
return { workflow: 'maintenanceUtilities', subcategory: '
|
|
198
|
+
return { workflow: 'maintenanceUtilities', subcategory: 'quickActions' };
|
|
210
199
|
}
|
|
211
200
|
|
|
212
201
|
/**
|
|
@@ -244,10 +233,16 @@ function getCommandsByWorkflow(workflow, subcategory = null, config = null) {
|
|
|
244
233
|
}
|
|
245
234
|
|
|
246
235
|
// If subcategory is specified, only match commands with that subcategory
|
|
236
|
+
// If subcategory is null, only match commands with null subcategory
|
|
247
237
|
if (subcategory !== null) {
|
|
248
238
|
if (mapping.subcategory !== subcategory) {
|
|
249
239
|
return false;
|
|
250
240
|
}
|
|
241
|
+
} else {
|
|
242
|
+
// When subcategory is null, only match commands that also have null subcategory
|
|
243
|
+
if (mapping.subcategory !== null) {
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
251
246
|
}
|
|
252
247
|
|
|
253
248
|
// Filter by config if provided
|
|
@@ -385,7 +380,7 @@ function showHelp() {
|
|
|
385
380
|
}
|
|
386
381
|
|
|
387
382
|
const workflowName = workflowInfo.label;
|
|
388
|
-
const hasSubcategories = workflowInfo.subcategories
|
|
383
|
+
const hasSubcategories = workflowInfo.subcategories != null && typeof workflowInfo.subcategories === 'object';
|
|
389
384
|
|
|
390
385
|
if (hasSubcategories) {
|
|
391
386
|
// Show workflow header
|
|
@@ -454,6 +449,45 @@ async function showSubcategoryMenu(workflowKey, workflowInfo) {
|
|
|
454
449
|
const config = getConfig();
|
|
455
450
|
const theme = getTheme();
|
|
456
451
|
|
|
452
|
+
// If workflow has no subcategories, show commands directly
|
|
453
|
+
if (!workflowInfo.subcategories) {
|
|
454
|
+
const commands = getCommandsByWorkflow(workflowKey, null, config);
|
|
455
|
+
if (commands.length === 0) {
|
|
456
|
+
prompts.cancel(chalk.yellow('No commands available in this workflow'));
|
|
457
|
+
return showWorkflowMenu();
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
const commandOptions = commands.map((cmd) => {
|
|
461
|
+
const aliases = cmd.aliases.length > 0 ? chalk.dim(` (${cmd.aliases.join(', ')})`) : '';
|
|
462
|
+
return {
|
|
463
|
+
value: cmd.name,
|
|
464
|
+
label: `${theme.primary(cmd.name)}${aliases} ${chalk.gray(`- ${cmd.description}`)}`,
|
|
465
|
+
};
|
|
466
|
+
});
|
|
467
|
+
|
|
468
|
+
commandOptions.push({
|
|
469
|
+
value: INTERACTIVE_MARKERS.BACK,
|
|
470
|
+
label: chalk.dim('← Previous Menu'),
|
|
471
|
+
});
|
|
472
|
+
|
|
473
|
+
const selectedCommand = await prompts.select({
|
|
474
|
+
message: theme.primary(`Select a command from ${workflowInfo.label}:`),
|
|
475
|
+
options: commandOptions,
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
if (prompts.isCancel(selectedCommand) || selectedCommand === INTERACTIVE_MARKERS.BACK) {
|
|
479
|
+
return showWorkflowMenu();
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
// Execute the selected command
|
|
483
|
+
const success = await router.execute(selectedCommand, []);
|
|
484
|
+
if (!success) {
|
|
485
|
+
const { CommandError } = require('../core/errors');
|
|
486
|
+
throw new CommandError(`Command "${selectedCommand}" failed`, selectedCommand);
|
|
487
|
+
}
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
|
|
457
491
|
const subcategoryOptions = [];
|
|
458
492
|
const directCommandSubcategories = [];
|
|
459
493
|
const regularSubcategories = [];
|
|
@@ -548,9 +582,13 @@ async function showCommandMenu(workflowKey, subcategory, workflowInfo) {
|
|
|
548
582
|
label: chalk.dim('← Previous Menu'),
|
|
549
583
|
});
|
|
550
584
|
|
|
585
|
+
const subcategoryLabel = workflowInfo.subcategories && workflowInfo.subcategories[subcategory]
|
|
586
|
+
? workflowInfo.subcategories[subcategory]
|
|
587
|
+
: 'this subcategory';
|
|
588
|
+
|
|
551
589
|
const selectedCommand = await prompts.select({
|
|
552
590
|
message: theme.primary(
|
|
553
|
-
`Select a command from ${
|
|
591
|
+
`Select a command from ${subcategoryLabel}:`
|
|
554
592
|
),
|
|
555
593
|
options: commandOptions,
|
|
556
594
|
});
|
|
@@ -595,8 +633,12 @@ async function showWorkflowMenu() {
|
|
|
595
633
|
|
|
596
634
|
// Count commands in this workflow
|
|
597
635
|
let commandCount = 0;
|
|
598
|
-
|
|
599
|
-
|
|
636
|
+
if (workflowInfo.subcategories) {
|
|
637
|
+
for (const subKey of Object.keys(workflowInfo.subcategories)) {
|
|
638
|
+
commandCount += getCommandsByWorkflow(workflowKey, subKey, config).length;
|
|
639
|
+
}
|
|
640
|
+
} else {
|
|
641
|
+
commandCount = getCommandsByWorkflow(workflowKey, null, config).length;
|
|
600
642
|
}
|
|
601
643
|
|
|
602
644
|
const label =
|
|
@@ -606,9 +648,8 @@ async function showWorkflowMenu() {
|
|
|
606
648
|
topLevelOptions.push({ value: workflowKey, label });
|
|
607
649
|
}
|
|
608
650
|
|
|
609
|
-
// Add
|
|
651
|
+
// Add exit
|
|
610
652
|
topLevelOptions.push(
|
|
611
|
-
{ value: 'help', label: chalk.yellow('List Commands') },
|
|
612
653
|
{ value: 'exit', label: chalk.red('Exit') }
|
|
613
654
|
);
|
|
614
655
|
|
|
@@ -618,13 +659,12 @@ async function showWorkflowMenu() {
|
|
|
618
659
|
options: topLevelOptions,
|
|
619
660
|
});
|
|
620
661
|
|
|
621
|
-
if (prompts.isCancel(selection)
|
|
662
|
+
if (prompts.isCancel(selection)) {
|
|
622
663
|
prompts.cancel(chalk.yellow('Cancelled'));
|
|
623
664
|
return;
|
|
624
665
|
}
|
|
625
666
|
|
|
626
|
-
if (selection === '
|
|
627
|
-
showHelp();
|
|
667
|
+
if (selection === 'exit') {
|
|
628
668
|
return;
|
|
629
669
|
}
|
|
630
670
|
|
|
@@ -125,12 +125,13 @@ module.exports = async (args) => {
|
|
|
125
125
|
// Execute push with spinner
|
|
126
126
|
let command = 'push';
|
|
127
127
|
|
|
128
|
+
// Add --no-progress to prevent git progress output from interfering with spinner
|
|
128
129
|
if (pushType === 'tags') {
|
|
129
|
-
command += ` ${remote} --tags`;
|
|
130
|
+
command += ` ${remote} --tags --no-progress`;
|
|
130
131
|
} else if (pushType === 'all') {
|
|
131
|
-
command += ` ${remote} --all`;
|
|
132
|
+
command += ` ${remote} --all --no-progress`;
|
|
132
133
|
} else {
|
|
133
|
-
command += ` ${remote} ${branchName}`;
|
|
134
|
+
command += ` ${remote} ${branchName} --no-progress`;
|
|
134
135
|
if (pushType === 'upstream') {
|
|
135
136
|
command += ' --set-upstream';
|
|
136
137
|
} else if (pushType === 'force-with-lease') {
|
|
@@ -148,9 +149,30 @@ module.exports = async (args) => {
|
|
|
148
149
|
|
|
149
150
|
const result = await execGitWithSpinner(command, {
|
|
150
151
|
spinnerText,
|
|
151
|
-
|
|
152
|
+
silent: true, // Capture output to format it nicely
|
|
153
|
+
successMessage: null, // We'll format it ourselves
|
|
152
154
|
errorMessage: 'Push failed',
|
|
153
|
-
onSuccess: async () => {
|
|
155
|
+
onSuccess: async (result) => {
|
|
156
|
+
// Format and display git output nicely
|
|
157
|
+
// Git push writes output to stderr (not stdout), so check stderr first
|
|
158
|
+
const pushOutput = result.stderr || result.output || '';
|
|
159
|
+
|
|
160
|
+
if (pushOutput.trim()) {
|
|
161
|
+
const outputLines = pushOutput.trim().split('\n');
|
|
162
|
+
outputLines.forEach(line => {
|
|
163
|
+
const trimmed = line.trim();
|
|
164
|
+
// Filter out warnings and empty lines
|
|
165
|
+
if (trimmed &&
|
|
166
|
+
!trimmed.includes('CRLF') &&
|
|
167
|
+
!trimmed.includes('LF') &&
|
|
168
|
+
!trimmed.includes('warning:')) {
|
|
169
|
+
// Format git push output with proper indentation
|
|
170
|
+
console.log(` ${chalk.dim(trimmed)}`);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
ui.success('Push completed');
|
|
154
176
|
// Suggest creating PR after successful push
|
|
155
177
|
if (process.stdin.isTTY && branchName !== 'main' && branchName !== 'master') {
|
|
156
178
|
const { getPRUrl, detectCIPlatform } = require('../../utils/git');
|
|
@@ -111,8 +111,8 @@ const EXAMPLES = {
|
|
|
111
111
|
'Tag Management': [
|
|
112
112
|
{ cmd: 'gittable tag', desc: 'List all tags' },
|
|
113
113
|
{ cmd: 'gittable tag create v1.0.0', desc: 'Create a tag' },
|
|
114
|
-
{ cmd: 'gittable tag
|
|
115
|
-
{ cmd: 'gittable tag
|
|
114
|
+
{ cmd: 'gittable tag push v1.0.0', desc: 'Create and push tag in one step' },
|
|
115
|
+
{ cmd: 'gittable tag delete v1.0.0', desc: 'Delete tag locally and remotely' },
|
|
116
116
|
],
|
|
117
117
|
|
|
118
118
|
'Configuration & Customization': [
|