tr200 2.0.1 → 2.0.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/README.md CHANGED
@@ -80,45 +80,55 @@ If your system is different, things might break. Look up the offending line and
80
80
  npm install -g tr200
81
81
  ```
82
82
 
83
- **That's it!** Now you can run:
84
-
83
+ **Run on-demand:**
85
84
  ```bash
86
85
  tr200
87
86
  # or
88
87
  report
89
88
  ```
90
89
 
91
- **Requirements:**
92
- - Node.js 14.0.0 or later
93
- - bash (Linux/macOS) or PowerShell (Windows)
90
+ **Set up auto-run on terminal startup:**
91
+ ```bash
92
+ tr200 --install
93
+ ```
94
+
95
+ **Remove auto-run:**
96
+ ```bash
97
+ tr200 --uninstall
98
+ ```
99
+
100
+ **Completely uninstall:**
101
+ ```bash
102
+ tr200 --uninstall
103
+ npm uninstall -g tr200
104
+ ```
94
105
 
95
- **What this does:**
96
- - Downloads the TR-200 package from npm
97
- - Creates global `tr200` and `report` commands
98
- - Automatically detects your OS and runs the appropriate script
106
+ **Requirements:** Node.js 14.0.0 or later
107
+
108
+ ---
99
109
 
100
- **Note:** The npm version is for on-demand use. If you want TR-200 to auto-run on terminal startup, use one of the install scripts below instead.
110
+ ## Quick Reference
111
+
112
+ | Command | Description |
113
+ |---------|-------------|
114
+ | `tr200` | Run the machine report |
115
+ | `tr200 --help` | Show help |
116
+ | `tr200 --version` | Show version |
117
+ | `tr200 --install` | Set up auto-run on terminal startup |
118
+ | `tr200 --uninstall` | Remove auto-run configuration |
101
119
 
102
120
  ---
103
121
 
104
- ## ⚡ Super Quick Install (install.sh)
122
+ ## ⚡ Alternative: install.sh (No Node.js Required)
105
123
 
106
- **Simplest method - fully automated!**
124
+ **For users without Node.js:**
107
125
 
108
126
  ```bash
109
127
  cd ~/git-projects && gh repo clone RealEmmettS/usgc-machine-report && \
110
128
  cd RealEmmettS-usgc-machine-report && ./install.sh
111
129
  ```
112
130
 
113
- The `install.sh` script handles everything:
114
- - Detects your OS and architecture
115
- - Installs dependencies (lastlog2)
116
- - Backs up existing installations
117
- - Copies and configures the script
118
- - Tests everything works
119
- - Sets up the `report` alias
120
-
121
- **That's it! Type `report` or open a new terminal to see it in action.**
131
+ The `install.sh` script handles everything: OS detection, dependency installation, backup, configuration, and auto-run setup.
122
132
 
123
133
  ---
124
134
 
@@ -146,194 +156,16 @@ The script creates `dist/tr-200-machine-report.zip` containing the launchers, `m
146
156
 
147
157
  ---
148
158
 
149
- ## 🤖 Claude Code Automated Installation
150
-
151
- **Best for:** Using with [Claude Code](https://claude.ai/code) AI assistant
159
+ ## 🤖 Claude Code Installation
152
160
 
153
161
  Ask Claude Code:
154
162
 
155
163
  ```
156
- Install usgc-machine-report from RealEmmettS/usgc-machine-report using install.sh
157
- ```
158
-
159
- Or provide these specific instructions:
160
-
161
- ```bash
162
- cd ~/git-projects && \
163
- gh repo clone RealEmmettS/usgc-machine-report && \
164
- cd RealEmmettS-usgc-machine-report && \
165
- ./install.sh
166
- ```
167
-
168
- Claude Code will automatically:
169
- 1. Clone this repository
170
- 2. Install `lastlog2` if on Debian/Raspberry Pi OS
171
- 3. Copy script to `~/.machine_report.sh`
172
- 4. Add to `.bashrc` with automatic run on login
173
- 5. Create convenient `report` alias
174
-
175
- **Or provide these specific instructions to Claude Code:**
176
-
177
- ```bash
178
- # 1. Clone the repository
179
- cd ~/git-projects
180
- gh repo clone RealEmmettS/usgc-machine-report
181
-
182
- # 2. Install dependencies (Debian/Ubuntu/Raspberry Pi OS)
183
- sudo apt install -y lastlog2
184
-
185
- # 3. Install the script
186
- cp ~/git-projects/RealEmmettS-usgc-machine-report/machine_report.sh ~/.machine_report.sh
187
- chmod +x ~/.machine_report.sh
188
-
189
- # 4. Add to .bashrc
190
- cat >> ~/.bashrc << 'EOF'
191
-
192
- # Machine Report alias - run anytime with 'report' command
193
- alias report='~/.machine_report.sh'
194
-
195
- # Run Machine Report only when in interactive mode
196
- if [[ $- == *i* ]]; then
197
- ~/.machine_report.sh
198
- fi
199
- EOF
200
-
201
- # 5. Test installation
202
- ~/.machine_report.sh
164
+ npm install -g tr200 && tr200 --install
203
165
  ```
204
166
 
205
167
  ---
206
168
 
207
- ## 🍎 macOS Installation
208
-
209
- **Requirements:**
210
- - macOS 10.13 (High Sierra) or later
211
- - Bash 4.0+ recommended (install via `brew install bash`)
212
-
213
- **Quick Install:**
214
-
215
- ```bash
216
- cd ~/git-projects && gh repo clone RealEmmettS/usgc-machine-report && \
217
- cd RealEmmettS-usgc-machine-report && ./install.sh
218
- ```
219
-
220
- **What works on macOS:**
221
- - ✅ OS version detection (via `sw_vers`)
222
- - ✅ CPU info (via `sysctl`)
223
- - ✅ Memory usage (via `vm_stat`)
224
- - ✅ Disk usage (via `df`)
225
- - ✅ Network info (via `scutil`)
226
- - ✅ System uptime (calculated from boot time)
227
- - ⚠️ Last login may show "unavailable" (macOS limitation)
228
-
229
- **macOS-Specific Notes:**
230
- - No package installation needed - uses built-in commands
231
- - Default Bash 3.2 works but Bash 4+ recommended
232
- - To install newer Bash: `brew install bash`
233
- - Script automatically detects macOS and uses appropriate commands
234
-
235
- ### 🐚 zsh Installation (macOS Default Shell)
236
-
237
- **Modern macOS (Catalina 10.15+) uses zsh by default**, not bash. If you're using zsh, follow these instructions:
238
-
239
- **Quick Install for zsh:**
240
-
241
- ```bash
242
- # Clone and install the script
243
- cd ~/Downloads && git clone https://github.com/RealEmmettS/usgc-machine-report.git && \
244
- cp ~/Downloads/usgc-machine-report/machine_report.sh ~/.machine_report.sh && \
245
- chmod +x ~/.machine_report.sh
246
-
247
- # Add to .zshrc (not .bashrc!)
248
- cat >> ~/.zshrc << 'EOF'
249
-
250
- # Machine Report alias - run anytime with 'report' command
251
- alias report='~/.machine_report.sh'
252
-
253
- # Run Machine Report only when in interactive mode
254
- if [[ $- == *i* ]]; then
255
- ~/.machine_report.sh
256
- fi
257
- EOF
258
-
259
- # Clean up cloned repo (optional)
260
- rm -rf ~/Downloads/usgc-machine-report
261
-
262
- echo "✅ Installation complete! Open a new terminal or type: source ~/.zshrc"
263
- ```
264
-
265
- **Important zsh Notes:**
266
- - ✅ Use `~/.zshrc` instead of `~/.bashrc`
267
- - ✅ The script works identically in zsh - no code changes needed
268
- - ✅ Test with: `zsh -c "source ~/.zshrc && report"`
269
- - ℹ️ To check your shell: `echo $SHELL` (should show `/bin/zsh`)
270
-
271
- ---
272
-
273
- ## 📦 Quick Install (Manual - Raspberry Pi OS / Debian)
274
-
275
- **One-liner installation:**
276
-
277
- ```bash
278
- cd ~/git-projects && gh repo clone RealEmmettS/usgc-machine-report && \
279
- sudo apt install -y lastlog2 && \
280
- cp ~/git-projects/RealEmmettS-usgc-machine-report/machine_report.sh ~/.machine_report.sh && \
281
- chmod +x ~/.machine_report.sh && \
282
- cat >> ~/.bashrc << 'EOF'
283
-
284
- # Machine Report alias - run anytime with 'report' command
285
- alias report='~/.machine_report.sh'
286
-
287
- # Run Machine Report only when in interactive mode
288
- if [[ $- == *i* ]]; then
289
- ~/.machine_report.sh
290
- fi
291
- EOF
292
- echo "✅ Installation complete! Type 'report' or open a new terminal."
293
- ```
294
-
295
- **Step-by-step installation:**
296
-
297
- 1. **Clone the repository**:
298
- ```bash
299
- cd ~/git-projects
300
- gh repo clone RealEmmettS/usgc-machine-report
301
- ```
302
-
303
- 2. **Install dependencies** (for modern Debian/Raspberry Pi OS):
304
- ```bash
305
- sudo apt install -y lastlog2
306
- ```
307
-
308
- *Note: On systems with the legacy `lastlog` command, this step is optional. The script automatically detects and uses whichever is available.*
309
-
310
- 3. **Copy the script to your home directory**:
311
- ```bash
312
- cp ~/git-projects/RealEmmettS-usgc-machine-report/machine_report.sh ~/.machine_report.sh
313
- chmod +x ~/.machine_report.sh
314
- ```
315
-
316
- 4. **Add to `.bashrc` for automatic display on login**:
317
- ```bash
318
- cat >> ~/.bashrc << 'EOF'
319
-
320
- # Machine Report alias - run anytime with 'report' command
321
- alias report='~/.machine_report.sh'
322
-
323
- # Run Machine Report only when in interactive mode
324
- if [[ $- == *i* ]]; then
325
- ~/.machine_report.sh
326
- fi
327
- EOF
328
- ```
329
-
330
- 5. **Test the installation**:
331
- ```bash
332
- ~/.machine_report.sh
333
- ```
334
-
335
- ---
336
-
337
169
  ## 🛠️ Manual Installation (Advanced)
338
170
 
339
171
  For login sessions over ssh, reference the script `~/.machine_report.sh` in your `.bashrc` file. Make sure the script is executable by running `chmod +x ~/.machine_report.sh`.
@@ -432,6 +264,24 @@ For ZFS systems, edit:
432
264
 
433
265
  ## 📝 Changelog (Fork-specific)
434
266
 
267
+ ### v2.0.1 (2026-01-30) - **INSTALL FLAGS + PS 5.1 FIXES**
268
+ **New CLI Flags + PowerShell Compatibility**
269
+
270
+ - ✨ **`--install` flag**: Set up auto-run on terminal startup via npm
271
+ - ✨ **`--uninstall` flag**: Remove auto-run configuration cleanly
272
+ - ✨ **`--help` flag**: Show usage information (all scripts)
273
+ - ✨ **`--version` flag**: Show version information (all scripts)
274
+ - 🔧 **PowerShell 5.1 compatibility**: Fixed `[System.Net.Dns]::GetHostName()` and null-conditional operators
275
+ - 📚 **Simplified README**: npm + `--install` promoted as primary installation method
276
+
277
+ **Upgrade path:**
278
+ ```bash
279
+ npm update -g tr200
280
+ tr200 --install # Re-run to update shell config if needed
281
+ ```
282
+
283
+ ---
284
+
435
285
  ### v2.0.0 (2026-01-30) - **SHAUGHV REBRAND + NPM RELEASE**
436
286
  **Complete Rebrand + Auto-Run Enhancements + npm Publishing**
437
287
 
@@ -460,7 +460,9 @@ function Show-TR200Report {
460
460
  }
461
461
 
462
462
  # Total inner width of table (excluding outer borders)
463
- $innerWidth = 2 + $labelWidth + 3 + $dataWidth + 2 # "│ <label> │ <value> │"
463
+ # Row format: "│ <label> │ <value> │" = 1+1+label+1+1+1+data+1+1 = label+data+7
464
+ # Inner width is between outer │ chars: " <label> │ <value> " = label+data+5
465
+ $innerWidth = $labelWidth + $dataWidth + 5
464
466
 
465
467
  # Convert chars to strings for multiplication (PS 5.1 compatibility)
466
468
  $hzLine = [string]$TR200Chars.Horizontal
package/bin/tr200.js CHANGED
@@ -300,7 +300,7 @@ More info: https://github.com/RealEmmettS/usgc-machine-report
300
300
 
301
301
  // Handle version flag
302
302
  if (process.argv.includes('--version') || process.argv.includes('-v')) {
303
- console.log('2.0.1');
303
+ console.log('2.0.2');
304
304
  process.exit(0);
305
305
  }
306
306
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tr200",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Cross-platform system information report with Unicode box-drawing display",
5
5
  "author": "shaughv",
6
6
  "license": "BSD-3-Clause",