devtool 0.8.23

A CLI tool for development in update rustup toolchain, mise maintained tools and homebrew packages.
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
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
# devtool ๐Ÿš€

A modern, efficient developer tool written in Rust that unifies the update process for your development environment tools and package managers with a single command. Say goodbye to multiple update commands and let `devtool` keep everything up to date.

[![Crates.io](https://img.shields.io/crates/v/devtool.svg)](https://crates.io/crates/devtool)
[![CI](https://github.com/jenkinpan/devtool-rs/workflows/CI/badge.svg)](https://github.com/jenkinpan/devtool-rs/actions/workflows/ci.yml)
[![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Rust](https://img.shields.io/badge/rust-1.70%2B-orange.svg)](https://www.rust-lang.org)

English | [็ฎ€ไฝ“ไธญๆ–‡]README_zh.md

## โœจ Features

- **One-command updates**: Run `devtool` to automatically update multiple supported tools
- **๐Ÿš€ Parallel execution**: Default parallel execution for up to 10x faster updates with concurrent tool execution
- **Smart detection**: Automatically detects installed tools (Homebrew, rustup, mise) and skips uninstalled ones
- **Enhanced progress feedback**: Multi-progress bars with real-time updates and elapsed time tracking
- **๐Ÿ“Š Detailed upgrade tracking**: Shows exactly what was upgraded with before/after version information
- **๐Ÿ” Smart version detection**: Only performs version comparison when actual upgrades occur, improving performance
- **๐Ÿ“ Comprehensive logging**: Each step's output is logged for easy troubleshooting
- **๐Ÿ—‚๏ธ Unified log storage**: All log files are stored in a unified location (`~/Library/Caches/devtool/` on macOS, `~/.cache/devtool/` on Linux)
- **๐Ÿ” Organized by tool**: Log files are organized by tool (Homebrew, Rustup, Mise) with timestamped directories
- **๐Ÿ”— Latest symlinks**: Each tool directory includes a `latest` symlink pointing to the most recent execution
- **๐Ÿ“‹ Execution summary**: Clear summary showing which tools were updated, already latest, or failed
- **๐Ÿงช Dry run mode**: Use `--dry-run` to preview steps without making changes
- **โš™๏ธ Flexible execution modes**: Choose between parallel (default) or sequential execution with `--sequential`
- **๐Ÿ”ง Configurable concurrency**: Set the number of concurrent jobs with `--jobs` (default: 3)
- **๐Ÿ“ก External status monitoring**: Query real-time status with `devtool progress-status` for integration with other tools
- **๐ŸŒ Multi-language support**: Automatically detects system language and displays Chinese or English interface
- **โŒจ๏ธ Shell completion**: Comprehensive completion support for bash, zsh, fish, powershell, elvish, and nushell
- **โ„น๏ธ Version information**: Check version with `devtool -V` or `devtool --version`
- **๐Ÿ“ User feedback system**: Built-in feedback collection with `devtool feedback` command
- **๐Ÿ› Issue templates**: Standardized GitHub Issues templates for bug reports and feature requests
- **๐Ÿ“Š Feedback analysis**: Tools for analyzing user feedback and improving the product

## ๐Ÿ› ๏ธ Supported Tools

`devtool` currently supports automatic detection and updating of:

- **Homebrew**: Update index, upgrade packages, cleanup old versions
- **Rust (rustup)**: Update all installed Rust toolchains (stable, nightly, beta)
- **Mise** (formerly rtx): Run `mise up` to update all managed languages and tools (Node.js, Python, etc.)

## ๐Ÿ“ฆ Installation

### From crates.io (Recommended)

```bash
cargo install devtool
```

Make sure `~/.cargo/bin` is in your `PATH` environment variable.

### From source

```bash
git clone https://github.com/jenkinpan/devtool-rs.git
cd devtool-rs
cargo build --release
cargo install --path .
```

## ๐Ÿš€ Usage

### Basic Usage

Simply run `devtool` in your terminal to start the update process:

```bash
devtool
```

This is equivalent to running `devtool update`.

### Parallel Execution (Default in v0.7.0)

Parallel execution is now the default mode for faster updates:

```bash
# Default parallel execution with 3 concurrent jobs
devtool

# Control the number of concurrent jobs
devtool --jobs 5

# Sequential execution (override parallel mode)
devtool --sequential

# Parallel execution with dry run
devtool --jobs 3 --dry-run
```

**Performance Benefits:**
- Up to 10x faster execution with parallel mode (default)
- Configurable concurrency with `--jobs` parameter (default: 3)
- Choose between parallel (default) or sequential execution
- Intelligent dependency management
- Maintains all safety features of sequential mode

### Command Line Options

Customize `devtool` behavior with these options:

| Option         | Short | Description                                                            |
| -------------- | ----- | ---------------------------------------------------------------------- |
| `--dry-run`    | `-n`  | Show steps that would be executed without actually running them        |
| `--verbose`    | `-v`  | Print detailed output for each step during execution                   |
| `--version`    | `-V`  | Show version information                                               |
| `--keep-logs`  |       | Keep log files for each step, stored in unified cache directory by default |
| `--no-banner`  |       | Don't show startup banner                                              |
| `--compact`    |       | Use more compact output format for non-interactive environments        |
| `--parallel`   |       | Execute update steps in parallel (default)                             |
| `--sequential` |       | Execute update steps sequentially (override parallel mode)            |
| `--jobs`       |       | Number of concurrent jobs for parallel execution (default: 3)         |
| `--no-color`   |       | Disable colored output                                                 |
| `--help`       | `-h`  | Show help information                                                  |

## ๐Ÿ“Š Upgrade Details Tracking

`devtool` now provides detailed upgrade tracking, showing exactly what was upgraded with before/after version information:

### Upgrade Detail Display

When upgrades occur, `devtool` shows detailed information about what was changed:

```bash
๐ŸŽ‰ ๆ›ดๆ–ฐๅฎŒๆˆ๏ผš2025-10-18 14:00:30 (่€—ๆ—ถ: 12็ง’)
โœ… ๅทฒๆ›ดๆ–ฐ๏ผšHomebrew, Rustup
โ„น๏ธ ๆ— ๆ›ดๆ–ฐๅบ”็”จใ€‚

๐Ÿ“‹ ๅ‡็บง่ฏฆๆƒ…๏ผš
Homebrew๏ผšๅ‡็บง่ฝฏไปถๅŒ…
  - git: 2.45.0 โ†’ 2.45.1
  - node: 20.10.0 โ†’ 20.11.0
  - python: 3.12.0 โ†’ 3.12.1

Rust๏ผšๆ›ดๆ–ฐๅทฅๅ…ท้“พ
  - stable-aarch64-apple-darwin: 1.90.0 โ†’ 1.91.0
  - nightly-aarch64-apple-darwin: 1.92.0 โ†’ 1.93.0
```

### Smart Version Detection

- **Performance optimized**: Only performs version comparison when actual upgrades occur
- **Accurate tracking**: Distinguishes between index updates and actual package upgrades
- **Unified format**: All tools (Homebrew, Rustup, Mise) use consistent upgrade detail format
- **Multiple formats**: Supports both JSON and text formats for upgrade details

### Supported Upgrade Types

- **Version upgrades**: `package: old_version โ†’ new_version`
- **New installations**: `package: new installation โ†’ version`
- **Toolchain updates**: Shows Rust toolchain version changes
- **Tool updates**: Shows Mise-managed tool version changes

## ๐Ÿ“ Log Storage System

`devtool` provides a comprehensive log storage system for easy troubleshooting and debugging:

### Unified Log Storage

All log files are stored in a unified location:
- **macOS**: `~/Library/Caches/devtool/`
- **Linux**: `~/.cache/devtool/`

### Directory Structure

Logs are organized by tool with timestamped directories:

```
~/Library/Caches/devtool/
โ”œโ”€โ”€ homebrew/
โ”‚   โ”œโ”€โ”€ 1761008090/
โ”‚   โ”‚   โ”œโ”€โ”€ brew_cleanup.log
โ”‚   โ”‚   โ”œโ”€โ”€ brew_detailed_debug.log
โ”‚   โ”‚   โ”œโ”€โ”€ brew_outdated.log
โ”‚   โ”‚   โ”œโ”€โ”€ brew_update.log
โ”‚   โ”‚   โ”œโ”€โ”€ brew_upgrade.log
โ”‚   โ”‚   โ””โ”€โ”€ outdated_packages.json
โ”‚   โ””โ”€โ”€ latest -> 1761008090/
โ”œโ”€โ”€ rustup/
โ”‚   โ”œโ”€โ”€ 1761008078/
โ”‚   โ”‚   โ””โ”€โ”€ rustup_update.log
โ”‚   โ””โ”€โ”€ latest -> 1761008078/
โ”œโ”€โ”€ mise/
โ”‚   โ”œโ”€โ”€ 1761008076/
โ”‚   โ”‚   โ””โ”€โ”€ mise_up.log
โ”‚   โ””โ”€โ”€ latest -> 1761008076/
โ””โ”€โ”€ feedback/
    โ””โ”€โ”€ devtool_feedback_*.md
```

### Log File Types

Each tool generates specific log files:

- **Homebrew**:
  - `brew_update.log`: Homebrew update output
  - `brew_upgrade.log`: Homebrew upgrade output
  - `brew_cleanup.log`: Homebrew cleanup output
  - `brew_outdated.log`: Outdated packages detection
  - `brew_detailed_debug.log`: Detailed debugging information
  - `outdated_packages.json`: JSON format of outdated packages

- **Rustup**:
  - `rustup_update.log`: Rustup update output

- **Mise**:
  - `mise_up.log`: Mise update output

### Using Logs for Troubleshooting

1. **Access latest logs**: Use the `latest` symlink for the most recent execution
   ```bash
   ls ~/Library/Caches/devtool/homebrew/latest/
   ```

2. **View specific log files**: Check individual log files for detailed information
   ```bash
   cat ~/Library/Caches/devtool/homebrew/latest/brew_detailed_debug.log
   ```

3. **Historical logs**: Browse timestamped directories for previous executions
   ```bash
   ls ~/Library/Caches/devtool/homebrew/
   ```

### Enabling Log Storage

Use the `--keep-logs` flag to enable log storage:

```bash
devtool update --keep-logs
```

This will save all log files to the unified cache directory for later analysis.

### Examples

**Standard update (parallel execution by default):**

```bash
$ devtool
๐Ÿš€ Starting devtool update: 2025-10-16 16:59:41
๐Ÿ“‹ Will execute 3 steps:
  1) Homebrew update & upgrade & cleanup
  2) Rustup all toolchains update
  3) Mise tools update
๐Ÿš€ Parallel execution mode (max concurrent: 3)
[00:00:11] [#########################] 100% โœ… Homebrew ๅฎŒๆˆ
[00:00:12] [#########################] 100% โœ… Rustup ๅฎŒๆˆ
[00:00:12] [#########################] 100% โœ… Mise ๅฎŒๆˆ

๐ŸŽ‰ Update completed: 2025-10-16 16:59:45 (Time taken: 19็ง’)
โ„น๏ธ No updates applied.
โš ๏ธ Already latest: Rustup, Mise
โœ… Updated: Homebrew
```

**Dry run:**

```bash
devtool --dry-run
```

**User feedback:**

```bash
# Interactive feedback collection
devtool feedback

# Direct feedback submission
devtool feedback --type bug --message "Found an issue with Homebrew updates" --verbose

# Feature request
devtool feedback --type feature --message "Add support for npm updates"
```

**Check version:**

```bash
devtool -V
# Output: devtool 0.3.3
```

**Monitor progress (for scripts or status bars):**

Run `devtool` in one terminal, query progress in another:

```bash
devtool progress-status
# Output: Progress status: ProgressStatus { state: "update", percent: Some(60), done: Some(3), total: Some(5), desc: Some("Action: Cleanup old versions"), ts: Some("2025-10-04T13:17:45.123+08:00") }
```

**Language support:**

The tool automatically detects your system language and displays the interface in Chinese or English accordingly.

## ๐Ÿš Shell Completion

`devtool` provides comprehensive shell completion support for all major shells:

### Generate Completion Scripts

```bash
# Generate completion for your shell
devtool completion bash    # For bash
devtool completion zsh     # For zsh
devtool completion fish    # For fish
devtool completion powershell  # For PowerShell
devtool completion elvish  # For Elvish
devtool completion nushell # For Nushell
```

### Setup Completion

**Bash:**
```bash
# Add to ~/.bashrc
source <(devtool completion bash)
```

**Zsh:**
```bash
# Add to ~/.zshrc
source <(devtool completion zsh)
```

**Fish:**
```bash
# Add to ~/.config/fish/config.fish
devtool completion fish | source
```

**Nushell:**
```nu
# Add to your config.nu
use ~/.config/nushell/completions/devtool-completions.nu *
```

## ๐Ÿ”ง Troubleshooting

### Command not found

If you get `command not found: devtool` after installation:

```bash
# Check if ~/.cargo/bin is in your PATH
echo $PATH

# Add to your shell profile (e.g., ~/.bashrc, ~/.zshrc)
export PATH="$HOME/.cargo/bin:$PATH"

# Reload your shell configuration
source ~/.bashrc  # or source ~/.zshrc
```

### Permission errors

If you encounter permission errors:

```bash
# Make sure the binary is executable (Unix/Linux/macOS)
chmod +x ~/.cargo/bin/devtool

# On macOS, if blocked by Gatekeeper:
xattr -d com.apple.quarantine ~/.cargo/bin/devtool
```

### No tools detected

`devtool` only updates tools that are already installed. To get started:

- Install [Homebrew]https://brew.sh (macOS/Linux)
- Install [Rustup]https://rustup.rs (all platforms)
- Install [Mise]https://mise.jdx.dev (all platforms)

### Updates fail

If updates fail consistently:

1. Try running the tool's update command manually to see the actual error
2. Check your internet connection
3. Verify you have sufficient disk space
4. Run with `--verbose` flag for detailed output: `devtool --verbose`
5. Check log files in `~/.cache/devtool/logs/` for detailed error messages

### Language/locale issues

Force English output if automatic language detection doesn't work:

```bash
LANG=en_US.UTF-8 devtool
```

## ๐Ÿ’ก Tips & Tricks

### Create an alias

Add to your shell profile for quick access:

```bash
alias dup='devtool'
alias update-dev='devtool'
```

### Automated updates

**Using cron (Linux/macOS):**

```bash
# Edit crontab
crontab -e

# Add this line to run daily at 9 AM
0 9 * * * /home/username/.cargo/bin/devtool
```

**Using launchd (macOS):**

Create `~/Library/LaunchAgents/com.devtool.update.plist`:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.devtool.update</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Users/yourname/.cargo/bin/devtool</string>
    </array>
    <key>StartCalendarInterval</key>
    <dict>
        <key>Hour</key>
        <integer>9</integer>
        <key>Minute</key>
        <integer>0</integer>
    </dict>
</dict>
</plist>
```

Then load it: `launchctl load ~/Library/LaunchAgents/com.devtool.update.plist`

### Integration with other tools

**In Makefiles:**

```makefile
.PHONY: update-tools
update-tools:
	devtool

.PHONY: dev-setup
dev-setup: update-tools
	npm install
	bundle install
```

**In scripts:**

```bash
#!/bin/bash
# Safe update script
if devtool --dry-run; then
    echo "Dry run successful, proceeding..."
    devtool
else
    echo "Dry run failed, skipping update"
    exit 1
fi
```

### Notifications on completion

**macOS:**

```bash
devtool && osascript -e 'display notification "Updates completed" with title "devtool"'
```

**Linux (with notify-send):**

```bash
devtool && notify-send "devtool" "Updates completed"
```

## โ“ FAQ

**Q: Does devtool work on Windows?**  
A: Partial support. Rustup and Mise work, but Homebrew is not available on Windows. We plan to add winget support in the future.

**Q: Is it safe to run devtool?**  
A: Yes! devtool only calls the standard update commands for each tool. Use `--dry-run` to see exactly what will be executed before running.

**Q: How long does it take?**  
A: Typically 30-90 seconds depending on how many updates are available and your internet speed.

**Q: Can I run it in parallel?**  
A: Not yet, but parallel execution is planned for v0.5.0, which will significantly reduce update time.

**Q: Does it update system packages (apt, yum, etc.)?**  
A: Not yet, but system package manager support is planned for v0.6.0.

**Q: Where are log files stored?**  
A: Log files are stored in `~/.cache/devtool/logs/` (Linux/macOS) or `%LOCALAPPDATA%\devtool\logs\` (Windows).

**Q: How do I report a bug?**  
A: Please [open an issue](https://github.com/jenkinpan/devtool-rs/issues/new?template=bug_report.md) on GitHub with details about your environment and the error.

**Q: How can I contribute?**  
A: See our [CONTRIBUTING.md](CONTRIBUTING.md) guide! We welcome bug reports, feature requests, and pull requests.

## ๐Ÿ“– Documentation

- [Architecture Overview](ARCHITECTURE.md) - System design and module structure
- [Contributing Guide](CONTRIBUTING.md) - How to contribute to the project
- [Roadmap](ROADMAP.md) - Future development plans
- [Changelog](CHANGELOG.md) - Version history and release notes

## ๐Ÿค Contributing

Contributions are welcome! Please feel free to submit issues and pull requests on the GitHub repository.

See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines on:
- Reporting bugs
- Suggesting features
- Submitting pull requests
- Development setup
- Adding new package managers


## ๐Ÿ”— Links

- [Crates.io](https://crates.io/crates/devtool)
- [GitHub Repository](https://github.com/jenkinpan/devtool-rs)
- [Documentation](https://docs.rs/devtool)
- [Report Issues](https://github.com/jenkinpan/devtool-rs/issues)
- [Discussions](https://github.com/jenkinpan/devtool-rs/discussions)