about-system 0.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 +235 -0
- package/about-system.js +1430 -0
- package/package.json +57 -0
package/README.md
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://i.imgur.com/1kwKBTR.png">
|
|
3
|
+
</p>
|
|
4
|
+
<p align="center">
|
|
5
|
+
<img alt="GitHub Stars" src="https://img.shields.io/github/stars/vtempest/server-shell-setup">
|
|
6
|
+
<a href="https://github.com/vtempest/server-shell-setup/discussions">
|
|
7
|
+
<img alt="GitHub Discussions"
|
|
8
|
+
src="https://img.shields.io/github/discussions/vtempest/server-shell-setup">
|
|
9
|
+
</a>
|
|
10
|
+
<a href="https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request">
|
|
11
|
+
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome">
|
|
12
|
+
</a>
|
|
13
|
+
<a href="https://codespaces.new/vtempest/server-shell-setup">
|
|
14
|
+
<img src="https://github.com/codespaces/badge.svg" width="150" height="20">
|
|
15
|
+
</a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
## Node.js Shell System Info Metadata
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
bunx about-system
|
|
22
|
+
```
|
|
23
|
+
```bash
|
|
24
|
+
npx about-system
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
A cross-platform Node.js implementation of the system info script with enhanced features, caching, and full customization support.
|
|
29
|
+
|
|
30
|
+
## Examples
|
|
31
|
+
|
|
32
|
+

|
|
33
|
+
|
|
34
|
+
`👤 deck 🏠 steamdeck 📁 90% 💾 2/14GB 🔝 6% cursor ⏱️ 1d 7h 18m 🌎 174.194.193.230 📍 San Jose 🔗 http://230.sub-174-194-193.myvzw.com 👮 Verizon Business ⚡ SteamOS 📈 AMD Custom APU 0405 💻 Jupiter 🔧 6.11.11-valve12-1-neptune-611-g517a46b477e1 🐚 fish 🚀 npm pip docker nvim bun 📦 docker-node`
|
|
35
|
+
|
|
36
|
+
`👤 u0_a365 🏠 localhost 📁 54% 💾 1/5GB 🔝 1% fish ⏱️ 4d 9h 19m 🌎 174.194.193.230 🌐 192.168.42.229 📍 San Jose 🔗 http://230.sub-174-194-193.myvzw.com 👮 Verizon Business ⚡ Android 13 📈 Kryo-4XX-Silver 💻 SM-G781U 🔧 4.19.113-27223811 🐚 nu 🚀 apt npm pip hx nvim`
|
|
37
|
+
|
|
38
|
+
### Features
|
|
39
|
+
|
|
40
|
+
- **Cross-Platform**: Works on Windows, macOS, and Linux
|
|
41
|
+
- **Smart Caching**: Configurable cache durations for different system info types
|
|
42
|
+
- **Customizable Output**: Control which info blocks to show and their order
|
|
43
|
+
- **Network Info**: Fetches IP, location, and ISP data from ipinfo.io
|
|
44
|
+
- **Emoji Support**: Beautiful emoji-enhanced output (can be disabled)
|
|
45
|
+
- **Settings Management**: Persistent configuration with JSON settings file
|
|
46
|
+
- **Shell Integration**: Easy installation as shell greeting
|
|
47
|
+
- **Performance Optimized**: Caches expensive operations like network requests
|
|
48
|
+
|
|
49
|
+
### Installation
|
|
50
|
+
|
|
51
|
+
#### Global Installation (Recommended)
|
|
52
|
+
```bash
|
|
53
|
+
npx about-system
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Quick Start
|
|
57
|
+
|
|
58
|
+
1. **Run the script**:
|
|
59
|
+
```bash
|
|
60
|
+
about-system
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
2. **Install as shell greeting**:
|
|
64
|
+
```bash
|
|
65
|
+
about-system --install
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
3. **Customize settings**:
|
|
69
|
+
```bash
|
|
70
|
+
about-system --set display.show_emojis false
|
|
71
|
+
about-system --set colors.user blue
|
|
72
|
+
about-system --set display_order '["user","hostname","uptime"]'
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Available Info Blocks
|
|
76
|
+
|
|
77
|
+
| Block | Description | Example Output |
|
|
78
|
+
|-------|-------------|----------------|
|
|
79
|
+
| `user` | Current username | `👤 username` |
|
|
80
|
+
| `hostname` | System hostname | `🏠 hostname` |
|
|
81
|
+
| `ip` | Public IP address | `🌎 192.168.1.1` |
|
|
82
|
+
| `iplocal` | Local IP addresses | `🌐 192.168.1.100` |
|
|
83
|
+
| `city` | Location based on IP | `📍 San Francisco` |
|
|
84
|
+
| `domain` | Reverse DNS hostname | `🔗 http://example.com` |
|
|
85
|
+
| `isp` | Internet service provider | `👮 Verizon Business` |
|
|
86
|
+
| `os` | Operating system | `⚡ Ubuntu 22.04` |
|
|
87
|
+
| `cpu` | CPU information | `📈 Intel Core i7-8700K` |
|
|
88
|
+
| `gpu` | Graphics card | `🎮 NVIDIA GeForce RTX 3080` |
|
|
89
|
+
| `disk_used` | Disk usage percentage | `📁 75%` |
|
|
90
|
+
| `ram_used` | Memory usage | `💾 8/16GB` |
|
|
91
|
+
| `top_process` | Highest CPU process | `🔝 15% chrome` |
|
|
92
|
+
| `uptime` | System uptime | `⏱️ 2d 5h 30m` |
|
|
93
|
+
| `device` | Device model | `💻 MacBook Pro` |
|
|
94
|
+
| `kernel` | Kernel version | `🔧 5.15.0-56-generic` |
|
|
95
|
+
| `shell` | Current shell | `🐚 fish` |
|
|
96
|
+
| `pacman` | Available package managers | `🚀 apt npm pip docker` |
|
|
97
|
+
| `ports` | Open network ports | `🔌 80http 443https 22ssh` |
|
|
98
|
+
| `containers` | Running Docker containers | `📦 nginx redis postgres` |
|
|
99
|
+
|
|
100
|
+
### Configuration
|
|
101
|
+
|
|
102
|
+
The script uses a JSON settings file located at:
|
|
103
|
+
- **Linux/macOS**: `~/.config/systeminfo-settings.json`
|
|
104
|
+
- **Windows**: `%APPDATA%\Local\systeminfo-settings.json`
|
|
105
|
+
|
|
106
|
+
#### Settings Commands
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# Show current settings
|
|
110
|
+
about-system --settings-show
|
|
111
|
+
|
|
112
|
+
# Reset to defaults
|
|
113
|
+
about-system --settings-reset
|
|
114
|
+
|
|
115
|
+
# Set individual values
|
|
116
|
+
about-system --set display.show_emojis false
|
|
117
|
+
about-system --set colors.user blue
|
|
118
|
+
about-system --set cache.enabled true
|
|
119
|
+
|
|
120
|
+
# Clear cache
|
|
121
|
+
about-system --cache-clear
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
#### Example Settings
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"version": "1.0.0",
|
|
129
|
+
"display_order": [
|
|
130
|
+
"user", "hostname", "disk_used", "ram_used", "uptime",
|
|
131
|
+
"ip", "os", "cpu", "shell"
|
|
132
|
+
],
|
|
133
|
+
"colors": {
|
|
134
|
+
"user": "red",
|
|
135
|
+
"hostname": "orange",
|
|
136
|
+
"disk_used": "purple",
|
|
137
|
+
"ram_used": "yellow",
|
|
138
|
+
"uptime": "cyan",
|
|
139
|
+
"ip": "green",
|
|
140
|
+
"os": "blue",
|
|
141
|
+
"cpu": "orange",
|
|
142
|
+
"shell": "orange"
|
|
143
|
+
},
|
|
144
|
+
"display": {
|
|
145
|
+
"show_emojis": true,
|
|
146
|
+
"separator": " ",
|
|
147
|
+
"max_width": 120
|
|
148
|
+
},
|
|
149
|
+
"cache": {
|
|
150
|
+
"enabled": true
|
|
151
|
+
},
|
|
152
|
+
"network": {
|
|
153
|
+
"timeout": 5000,
|
|
154
|
+
"show_offline_message": true
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Available Colors
|
|
160
|
+
|
|
161
|
+
- `red`, `orange`, `yellow`, `green`, `blue`, `cyan`, `purple`, `magenta`, `gray`, `lightblue`
|
|
162
|
+
- Use `multicolor` for ports to get a rainbow effect
|
|
163
|
+
|
|
164
|
+
### Platform-Specific Features
|
|
165
|
+
|
|
166
|
+
#### Windows
|
|
167
|
+
- Detects Windows-specific package managers (choco, winget, scoop)
|
|
168
|
+
- Uses `wmic` for system information
|
|
169
|
+
- Supports PowerShell and Command Prompt integration
|
|
170
|
+
|
|
171
|
+
#### Linux
|
|
172
|
+
- Detects Linux package managers (apt, yum, pacman, etc.)
|
|
173
|
+
- Reads from `/proc` and `/sys` filesystems
|
|
174
|
+
- Supports various shells (bash, zsh, fish, nushell)
|
|
175
|
+
|
|
176
|
+
#### macOS
|
|
177
|
+
- Detects macOS-specific tools
|
|
178
|
+
- Uses `system_profiler` for hardware info
|
|
179
|
+
- Supports zsh and bash integration
|
|
180
|
+
|
|
181
|
+
### Cache System
|
|
182
|
+
|
|
183
|
+
The script implements intelligent caching to improve performance:
|
|
184
|
+
|
|
185
|
+
- **IP Info**: 5 minutes (network requests are expensive)
|
|
186
|
+
- **System Info**: 24 hours (rarely changes)
|
|
187
|
+
- **Process Info**: 5 seconds (changes frequently)
|
|
188
|
+
- **Disk/RAM**: 1 minute (moderate change frequency)
|
|
189
|
+
|
|
190
|
+
### Shell Integration
|
|
191
|
+
|
|
192
|
+
The `--install` flag automatically configures the script as a shell greeting:
|
|
193
|
+
|
|
194
|
+
- **Bash**: Adds to `~/.bashrc`
|
|
195
|
+
- **Zsh**: Adds to `~/.zshrc`
|
|
196
|
+
- **Fish**: Adds to `~/.config/fish/config.fish`
|
|
197
|
+
- **NuShell**: Adds to `~/.config/nushell/config.nu`
|
|
198
|
+
- **PowerShell**: Provides instructions for profile setup
|
|
199
|
+
|
|
200
|
+
### Development
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
# Clone the repository
|
|
204
|
+
git clone https://github.com/vtempest/server-shell-setup.git
|
|
205
|
+
cd server-shell-setup
|
|
206
|
+
|
|
207
|
+
# Install dependencies
|
|
208
|
+
npm install
|
|
209
|
+
|
|
210
|
+
# Run the script
|
|
211
|
+
npm start
|
|
212
|
+
|
|
213
|
+
# Run with custom settings
|
|
214
|
+
npm start -- --set display.show_emojis false
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### License
|
|
218
|
+
|
|
219
|
+
MIT License - see the original bash version for details.
|
|
220
|
+
|
|
221
|
+
### Contributing
|
|
222
|
+
|
|
223
|
+
1. Fork the repository
|
|
224
|
+
2. Create a feature branch
|
|
225
|
+
3. Make your changes
|
|
226
|
+
4. Test on multiple platforms
|
|
227
|
+
5. Submit a pull request
|
|
228
|
+
|
|
229
|
+
### Changelog
|
|
230
|
+
|
|
231
|
+
- **v0.0.3**: Initial Node.js implementation with cross-platform support
|
|
232
|
+
- Enhanced caching system
|
|
233
|
+
- Settings management
|
|
234
|
+
- Windows compatibility
|
|
235
|
+
- Shell integration improvements
|