@ryuyx/pvm 0.0.1
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/LICENSE +21 -0
- package/README.md +213 -0
- package/dist/commands/config.d.ts +2 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +104 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/list.d.ts +2 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +28 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/off.d.ts +2 -0
- package/dist/commands/off.d.ts.map +1 -0
- package/dist/commands/off.js +29 -0
- package/dist/commands/off.js.map +1 -0
- package/dist/commands/on.d.ts +2 -0
- package/dist/commands/on.d.ts.map +1 -0
- package/dist/commands/on.js +29 -0
- package/dist/commands/on.js.map +1 -0
- package/dist/commands/set.d.ts +6 -0
- package/dist/commands/set.d.ts.map +1 -0
- package/dist/commands/set.js +41 -0
- package/dist/commands/set.js.map +1 -0
- package/dist/core/config.d.ts +15 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +44 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/proxy.d.ts +31 -0
- package/dist/core/proxy.d.ts.map +1 -0
- package/dist/core/proxy.js +113 -0
- package/dist/core/proxy.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +96 -0
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +18 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/no-proxy.d.ts +9 -0
- package/dist/utils/no-proxy.d.ts.map +1 -0
- package/dist/utils/no-proxy.js +40 -0
- package/dist/utils/no-proxy.js.map +1 -0
- package/package.json +61 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 pvm contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# Proxy Manager
|
|
2
|
+
|
|
3
|
+
> 🚀 Cross-platform CLI tool for managing proxy environment variables
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@ryuyx/pvm)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
✅ **Cross-platform** - Works on Windows, macOS, and Linux
|
|
11
|
+
✅ **Simple CLI** - Easy-to-use commands for managing proxies
|
|
12
|
+
✅ **Persistent Config** - Save proxy settings for reuse
|
|
13
|
+
✅ **NO_PROXY Support** - Manage proxy bypass lists
|
|
14
|
+
✅ **Shell Integration** - Optional shell functions for seamless usage
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install -g @ryuyx/pvm
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Set proxy
|
|
26
|
+
pvm set http://127.0.0.1:7890
|
|
27
|
+
|
|
28
|
+
# Enable proxy (shows commands to run)
|
|
29
|
+
pvm on
|
|
30
|
+
|
|
31
|
+
# Check status
|
|
32
|
+
pvm list
|
|
33
|
+
|
|
34
|
+
# Disable proxy
|
|
35
|
+
pvm off
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
### Basic Commands
|
|
41
|
+
|
|
42
|
+
**Check current status:**
|
|
43
|
+
```bash
|
|
44
|
+
pvm
|
|
45
|
+
pvm list
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Set proxy URL:**
|
|
49
|
+
```bash
|
|
50
|
+
# Set both HTTP and HTTPS to the same URL
|
|
51
|
+
pvm set http://127.0.0.1:7890
|
|
52
|
+
|
|
53
|
+
# Set HTTP and HTTPS separately
|
|
54
|
+
pvm set --http http://127.0.0.1:7890 --https http://127.0.0.1:7891
|
|
55
|
+
|
|
56
|
+
# Set with NO_PROXY list
|
|
57
|
+
pvm set http://127.0.0.1:7890 --no-proxy "localhost,127.0.0.1,.local"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Enable/Disable proxy:**
|
|
61
|
+
```bash
|
|
62
|
+
pvm on # Shows commands to enable
|
|
63
|
+
pvm off # Shows commands to disable
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Configuration Management
|
|
67
|
+
|
|
68
|
+
**View configuration:**
|
|
69
|
+
```bash
|
|
70
|
+
pvm config show
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Set specific values:**
|
|
74
|
+
```bash
|
|
75
|
+
pvm config set http http://127.0.0.1:7890
|
|
76
|
+
pvm config set https http://127.0.0.1:7891
|
|
77
|
+
pvm config set both http://127.0.0.1:7890
|
|
78
|
+
pvm config set no-proxy "localhost,127.0.0.1"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Manage NO_PROXY list:**
|
|
82
|
+
```bash
|
|
83
|
+
# Add domain to NO_PROXY
|
|
84
|
+
pvm config add no-proxy .local
|
|
85
|
+
|
|
86
|
+
# Remove domain from NO_PROXY
|
|
87
|
+
pvm config rm no-proxy .local
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Reset to defaults:**
|
|
91
|
+
```bash
|
|
92
|
+
pvm config reset
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Shell Integration
|
|
96
|
+
|
|
97
|
+
Since Node.js runs in a subprocess and cannot modify the parent shell's environment, you need to copy and run the commands shown by `proxy on` and `proxy off`.
|
|
98
|
+
|
|
99
|
+
### Option 1: Manual (Recommended for first-time users)
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# 1. Run this to see the commands
|
|
103
|
+
pvm on
|
|
104
|
+
|
|
105
|
+
# 2. Copy and paste the output commands into your shell
|
|
106
|
+
export http_proxy="http://127.0.0.1:7890"
|
|
107
|
+
export https_proxy="http://127.0.0.1:7890"
|
|
108
|
+
# ... etc
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Option 2: Shell Function (Advanced)
|
|
112
|
+
|
|
113
|
+
Add this to your shell profile for automatic execution:
|
|
114
|
+
|
|
115
|
+
**For Bash/Zsh** (~/.bashrc or ~/.zshrc):
|
|
116
|
+
```bash
|
|
117
|
+
pvm() {
|
|
118
|
+
if [ "$1" = "on" ]; then
|
|
119
|
+
eval "$(command pvm on 2>/dev/null | grep -E '^(export|unset)')"
|
|
120
|
+
echo "✓ Proxy enabled"
|
|
121
|
+
elif [ "$1" = "off" ]; then
|
|
122
|
+
eval "$(command pvm off 2>/dev/null | grep -E '^(export|unset)')"
|
|
123
|
+
echo "✗ Proxy disabled"
|
|
124
|
+
else
|
|
125
|
+
command pvm "$@"
|
|
126
|
+
fi
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**For PowerShell** ($PROFILE):
|
|
131
|
+
```powershell
|
|
132
|
+
function pvm {
|
|
133
|
+
if ($args[0] -eq "on") {
|
|
134
|
+
$commands = pvm-actual on 2>$null | Select-String '^\$env:|^Remove-Item'
|
|
135
|
+
$commands | ForEach-Object { Invoke-Expression $_ }
|
|
136
|
+
Write-Host "✓ Proxy enabled" -ForegroundColor Green
|
|
137
|
+
} elseif ($args[0] -eq "off") {
|
|
138
|
+
$commands = pvm-actual off 2>$null | Select-String '^\$env:|^Remove-Item'
|
|
139
|
+
$commands | ForEach-Object { Invoke-Expression $_ }
|
|
140
|
+
Write-Host "✗ Proxy disabled" -ForegroundColor Red
|
|
141
|
+
} else {
|
|
142
|
+
pvm-actual @args
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
# Rename the actual command
|
|
147
|
+
Set-Alias -Name pvm-actual -Value pvm.cmd
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Then reload your shell:
|
|
151
|
+
```bash
|
|
152
|
+
source ~/.bashrc # or ~/.zshrc
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Now you can use:
|
|
156
|
+
```bash
|
|
157
|
+
pvm on # Actually enables proxy
|
|
158
|
+
pvm off # Actually disables proxy
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## How It Works
|
|
162
|
+
|
|
163
|
+
1. **Configuration Storage**: Settings are saved to a config file using the [conf](https://github.com/sindresorhus/conf) library
|
|
164
|
+
2. **Environment Variables**: Sets HTTP_PROXY, HTTPS_PROXY, and NO_PROXY (both uppercase and lowercase)
|
|
165
|
+
3. **Cross-platform**: Automatically detects shell type and generates appropriate commands
|
|
166
|
+
|
|
167
|
+
## Configuration File Location
|
|
168
|
+
|
|
169
|
+
Config is stored at:
|
|
170
|
+
- **Windows**: `%APPDATA%\proxy-manager-nodejs\Config\config.json`
|
|
171
|
+
- **macOS**: `~/Library/Preferences/proxy-manager-nodejs/config.json`
|
|
172
|
+
- **Linux**: `~/.config/proxy-manager-nodejs/config.json`
|
|
173
|
+
|
|
174
|
+
## Commands Reference
|
|
175
|
+
|
|
176
|
+
| Command | Description |
|
|
177
|
+
|---------|-------------|
|
|
178
|
+
| `pvm` | Show current status |
|
|
179
|
+
| `pvm on` | Display commands to enable proxy |
|
|
180
|
+
| `pvm off` | Display commands to disable proxy |
|
|
181
|
+
| `pvm list` | Show configuration and status |
|
|
182
|
+
| `pvm set <url>` | Set proxy URL |
|
|
183
|
+
| `pvm config show` | Show configuration |
|
|
184
|
+
| `pvm config set <key> <value>` | Set config value |
|
|
185
|
+
| `pvm config add no-proxy <item>` | Add to NO_PROXY list |
|
|
186
|
+
| `pvm config rm no-proxy <item>` | Remove from NO_PROXY list |
|
|
187
|
+
| `pvm config reset` | Reset to defaults |
|
|
188
|
+
|
|
189
|
+
## Environment Variables
|
|
190
|
+
|
|
191
|
+
This tool manages the following environment variables:
|
|
192
|
+
|
|
193
|
+
- `http_proxy` / `HTTP_PROXY` - HTTP proxy URL
|
|
194
|
+
- `https_proxy` / `HTTPS_PROXY` - HTTPS proxy URL
|
|
195
|
+
- `no_proxy` / `NO_PROXY` - Comma-separated list of hosts to bypass proxy
|
|
196
|
+
|
|
197
|
+
## Contributing
|
|
198
|
+
|
|
199
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
200
|
+
|
|
201
|
+
## License
|
|
202
|
+
|
|
203
|
+
MIT © Liu Yuxuan
|
|
204
|
+
|
|
205
|
+
## Related Projects
|
|
206
|
+
|
|
207
|
+
- [conf](https://github.com/sindresorhus/conf) - Simple config handling
|
|
208
|
+
- [commander](https://github.com/tj/commander.js) - Node.js CLI framework
|
|
209
|
+
- [chalk](https://github.com/chalk/chalk) - Terminal styling
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
Made with ❤️ for developers who need proxy management
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAKA,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,GAAG,CAAC,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,MAAM,QAoGf"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { configManager } from '../core/config.js';
|
|
3
|
+
import { addToNoProxyList, removeFromNoProxyList } from '../utils/no-proxy.js';
|
|
4
|
+
import { handleList } from './list.js';
|
|
5
|
+
export function handleConfig(action, key, value) {
|
|
6
|
+
switch (action) {
|
|
7
|
+
case 'show':
|
|
8
|
+
handleList();
|
|
9
|
+
break;
|
|
10
|
+
case 'set':
|
|
11
|
+
if (!key) {
|
|
12
|
+
console.log(chalk.red('Error: Missing key'));
|
|
13
|
+
printConfigUsage();
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
switch (key) {
|
|
17
|
+
case 'http':
|
|
18
|
+
if (!value) {
|
|
19
|
+
console.log(chalk.red('Error: Missing URL for http'));
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
configManager.setHttp(value);
|
|
23
|
+
console.log(chalk.green(`[proxy] Set HTTP to: ${value}`));
|
|
24
|
+
break;
|
|
25
|
+
case 'https':
|
|
26
|
+
if (!value) {
|
|
27
|
+
console.log(chalk.red('Error: Missing URL for https'));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
configManager.setHttps(value);
|
|
31
|
+
console.log(chalk.green(`[proxy] Set HTTPS to: ${value}`));
|
|
32
|
+
break;
|
|
33
|
+
case 'both':
|
|
34
|
+
if (!value) {
|
|
35
|
+
console.log(chalk.red('Error: Missing URL for both'));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
configManager.setBoth(value);
|
|
39
|
+
console.log(chalk.green(`[proxy] Set both HTTP and HTTPS to: ${value}`));
|
|
40
|
+
break;
|
|
41
|
+
case 'no-proxy':
|
|
42
|
+
case 'no_proxy':
|
|
43
|
+
configManager.setNoProxy(value || '');
|
|
44
|
+
console.log(chalk.green(`[proxy] Set NO_PROXY to: ${value || '<empty>'}`));
|
|
45
|
+
break;
|
|
46
|
+
default:
|
|
47
|
+
console.log(chalk.red(`Error: Unknown config key: ${key}`));
|
|
48
|
+
printConfigUsage();
|
|
49
|
+
}
|
|
50
|
+
break;
|
|
51
|
+
case 'add':
|
|
52
|
+
if (key !== 'no-proxy' && key !== 'no_proxy') {
|
|
53
|
+
console.log(chalk.red('Error: Only "no-proxy" can be added'));
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (!value) {
|
|
57
|
+
console.log(chalk.red('Error: Missing item to add'));
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const currentList = configManager.getConfig().noProxy;
|
|
61
|
+
const newList = addToNoProxyList(currentList, value);
|
|
62
|
+
configManager.setNoProxy(newList);
|
|
63
|
+
console.log(chalk.green(`[proxy] Added "${value}" to NO_PROXY`));
|
|
64
|
+
console.log(chalk.dim(`NO_PROXY: ${newList || '<empty>'}`));
|
|
65
|
+
break;
|
|
66
|
+
case 'rm':
|
|
67
|
+
case 'remove':
|
|
68
|
+
case 'del':
|
|
69
|
+
if (key !== 'no-proxy' && key !== 'no_proxy') {
|
|
70
|
+
console.log(chalk.red('Error: Only "no-proxy" can be removed'));
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (!value) {
|
|
74
|
+
console.log(chalk.red('Error: Missing item to remove'));
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const currentListRm = configManager.getConfig().noProxy;
|
|
78
|
+
const newListRm = removeFromNoProxyList(currentListRm, value);
|
|
79
|
+
configManager.setNoProxy(newListRm);
|
|
80
|
+
console.log(chalk.green(`[proxy] Removed "${value}" from NO_PROXY`));
|
|
81
|
+
console.log(chalk.dim(`NO_PROXY: ${newListRm || '<empty>'}`));
|
|
82
|
+
break;
|
|
83
|
+
case 'reset':
|
|
84
|
+
configManager.reset();
|
|
85
|
+
console.log(chalk.green('[proxy] Configuration reset to defaults'));
|
|
86
|
+
console.log(chalk.dim(' HTTP: http://127.0.0.1:20170'));
|
|
87
|
+
console.log(chalk.dim(' HTTPS: http://127.0.0.1:20170'));
|
|
88
|
+
console.log(chalk.dim(' NO_PROXY: <empty>'));
|
|
89
|
+
break;
|
|
90
|
+
default:
|
|
91
|
+
console.log(chalk.red(`Error: Unknown config action: ${action}`));
|
|
92
|
+
printConfigUsage();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function printConfigUsage() {
|
|
96
|
+
console.log();
|
|
97
|
+
console.log('Usage:');
|
|
98
|
+
console.log(' pvm config show');
|
|
99
|
+
console.log(' pvm config set <http|https|both|no-proxy> <value>');
|
|
100
|
+
console.log(' pvm config add no-proxy <item>');
|
|
101
|
+
console.log(' pvm config rm no-proxy <item>');
|
|
102
|
+
console.log(' pvm config reset');
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,UAAU,YAAY,CAC1B,MAAc,EACd,GAAY,EACZ,KAAc;IAEd,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,MAAM;YACT,UAAU,EAAE,CAAC;YACb,MAAM;QAER,KAAK,KAAK;YACR,IAAI,CAAC,GAAG,EAAE,CAA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AAC,qDAAqD,CAAC,CAAC;IACnE,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAIA,wBAAgB,UAAU,SA4BzB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { getProxyStatus } from '../core/proxy.js';
|
|
3
|
+
import { configManager } from '../core/config.js';
|
|
4
|
+
export function handleList() {
|
|
5
|
+
const status = getProxyStatus();
|
|
6
|
+
const config = status.config;
|
|
7
|
+
console.log(chalk.bold('[proxy] Current proxy configuration:'));
|
|
8
|
+
console.log();
|
|
9
|
+
console.log(chalk.blue('Saved Configuration:'));
|
|
10
|
+
console.log(` HTTP: ${chalk.cyan(config.http)}`);
|
|
11
|
+
console.log(` HTTPS: ${chalk.cyan(config.https)}`);
|
|
12
|
+
console.log(` NO_PROXY: ${chalk.cyan(config.noProxy || '<not set>')}`);
|
|
13
|
+
console.log();
|
|
14
|
+
console.log(chalk.blue('Environment Variables:'));
|
|
15
|
+
console.log(` http_proxy: ${chalk.cyan(status.env.http_proxy || '<not set>')}`);
|
|
16
|
+
console.log(` https_proxy: ${chalk.cyan(status.env.https_proxy || '<not set>')}`);
|
|
17
|
+
console.log(` HTTP_PROXY: ${chalk.cyan(status.env.HTTP_PROXY || '<not set>')}`);
|
|
18
|
+
console.log(` HTTPS_PROXY: ${chalk.cyan(status.env.HTTPS_PROXY || '<not set>')}`);
|
|
19
|
+
console.log(` NO_PROXY: ${chalk.cyan(status.env.NO_PROXY || '<not set>')}`);
|
|
20
|
+
console.log();
|
|
21
|
+
const statusText = status.isEnabled
|
|
22
|
+
? chalk.green('✓ ENABLED')
|
|
23
|
+
: chalk.red('✗ DISABLED');
|
|
24
|
+
console.log(chalk.bold('Status: ') + statusText);
|
|
25
|
+
console.log();
|
|
26
|
+
console.log(chalk.dim(`Config file: ${configManager.getConfigPath()}`));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,MAAM,UAAU,UAAU;IACxB,MAAM,MAAM,GAAG,cAAc,EAAE,CAAC;IAChC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAE7B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC,CAAC;IAChE,OAAO,CAAC,GAAG,EAAE,CAAC;IAEd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,gBAAgB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACvD,OAAO,CAAC,GAAG,CAAC,gBAAgB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACxD,OAAO,CAAC,GAAG,CAAC,gBAAgB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,WAAW,CAAC,EAAE,CAAC,CAAC;IACzE,OAAO,CAAC,GAAG,EAAE,CAAC;IAEd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,C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|
|
2
|
+
import { generateDisableCommands, generateDisableCommandsPowerShell, detectShell, } from '../core/proxy.js';
|
|
3
|
+
export function handleOff() {
|
|
4
|
+
const shell = detectShell();
|
|
5
|
+
console.log(chalk.red('[proxy] Disabling proxy...'));
|
|
6
|
+
console.log();
|
|
7
|
+
if (shell === 'powershell') {
|
|
8
|
+
console.log(chalk.yellow('PowerShell detected. Run the following commands:'));
|
|
9
|
+
console.log();
|
|
10
|
+
console.log(chalk.cyan(generateDisableCommandsPowerShell()));
|
|
11
|
+
}
|
|
12
|
+
else if (shell === 'bash') {
|
|
13
|
+
console.log(chalk.yellow('Bash/Zsh detected. Run the following commands:'));
|
|
14
|
+
console.log();
|
|
15
|
+
console.log(chalk.cyan(generateDisableCommands()));
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
console.log(chalk.yellow('Unknown shell. Here are commands for both:'));
|
|
19
|
+
console.log();
|
|
20
|
+
console.log(chalk.blue('For Bash/Zsh:'));
|
|
21
|
+
console.log(chalk.cyan(generateDisableCommands()));
|
|
22
|
+
console.log();
|
|
23
|
+
console.log(chalk.blue('For PowerShell:'));
|
|
24
|
+
console.log(chalk.cyan(generateDisableCommandsPowerShell()));
|
|
25
|
+
}
|
|
26
|
+
console.log();
|
|
27
|
+
console.log(chalk.dim('Tip: To automate this, add a shell function. See README for details.'));
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=off.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"off.js","sourceRoot":"","sources":["../../src/commands/off.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EACjC,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAE1B,MAAM,UAAU,SAAS;IACvB,MAAM,KAAK,GAAG,WAAW,EAAE,CAAC;IAE5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC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+
{"version":3,"file":"on.d.ts","sourceRoot":"","sources":["../../src/commands/on.ts"],"names":[],"mappings":"AAOA,wBAAgB,QAAQ,SA0BvB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { generateEnableCommands, generateEnableCommandsPowerShell, detectShell, } from '../core/proxy.js';
|
|
3
|
+
export function handleOn() {
|
|
4
|
+
const shell = detectShell();
|
|
5
|
+
console.log(chalk.green('[proxy] Enabling proxy...'));
|
|
6
|
+
console.log();
|
|
7
|
+
if (shell === 'powershell') {
|
|
8
|
+
console.log(chalk.yellow('PowerShell detected. Run the following commands:'));
|
|
9
|
+
console.log();
|
|
10
|
+
console.log(chalk.cyan(generateEnableCommandsPowerShell()));
|
|
11
|
+
}
|
|
12
|
+
else if (shell === 'bash') {
|
|
13
|
+
console.log(chalk.yellow('Bash/Zsh detected. Run the following commands:'));
|
|
14
|
+
console.log();
|
|
15
|
+
console.log(chalk.cyan(generateEnableCommands()));
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
console.log(chalk.yellow('Unknown shell. Here are commands for both:'));
|
|
19
|
+
console.log();
|
|
20
|
+
console.log(chalk.blue('For Bash/Zsh:'));
|
|
21
|
+
console.log(chalk.cyan(generateEnableCommands()));
|
|
22
|
+
console.log();
|
|
23
|
+
console.log(chalk.blue('For PowerShell:'));
|
|
24
|
+
console.log(chalk.cyan(generateEnableCommandsPowerShell()));
|
|
25
|
+
}
|
|
26
|
+
console.log();
|
|
27
|
+
console.log(chalk.dim('Tip: To automate this, add a shell function. See README for details.'));
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=on.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"on.js","sourceRoot":"","sources":["../../src/commands/on.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,sBAAsB,EACtB,gCAAgC,EAChC,WAAW,GACZ,MAAM,kBA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O,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,sEAAsE,CAAC,CAAC,CAAC;AACjG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../src/commands/set.ts"],"names":[],"mappings":"AAIA,wBAAgB,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,QAoCpG"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { configManager } from '../core/config.js';
|
|
3
|
+
import { isProxyEnabled } from '../core/proxy.js';
|
|
4
|
+
export function handleSet(url, options) {
|
|
5
|
+
if (!url && !options) {
|
|
6
|
+
console.log(chalk.red('Error: Missing URL or options'));
|
|
7
|
+
console.log();
|
|
8
|
+
console.log('Usage:');
|
|
9
|
+
console.log(' proxy set <url>');
|
|
10
|
+
console.log(' proxy set --http <url> [--https <url>] [--no-proxy <list>]');
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
// Simple mode: proxy set <url>
|
|
14
|
+
if (url && !options) {
|
|
15
|
+
configManager.setBoth(url);
|
|
16
|
+
console.log(chalk.green(`[proxy] Set both HTTP and HTTPS to: ${url}`));
|
|
17
|
+
}
|
|
18
|
+
else if (options) {
|
|
19
|
+
// Advanced mode with options
|
|
20
|
+
if (options.http) {
|
|
21
|
+
configManager.setHttp(options.http);
|
|
22
|
+
console.log(chalk.green(`[proxy] Set HTTP to: ${options.http}`));
|
|
23
|
+
}
|
|
24
|
+
if (options.https) {
|
|
25
|
+
configManager.setHttps(options.https);
|
|
26
|
+
console.log(chalk.green(`[proxy] Set HTTPS to: ${options.https}`));
|
|
27
|
+
}
|
|
28
|
+
if (options.noProxy !== undefined) {
|
|
29
|
+
configManager.setNoProxy(options.noProxy);
|
|
30
|
+
console.log(chalk.green(`[proxy] Set NO_PROXY to: ${options.noProxy || '<empty>'}`));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
console.log();
|
|
34
|
+
if (isProxyEnabled()) {
|
|
35
|
+
console.log(chalk.yellow('Proxy is currently enabled. Run "proxy on" to apply new settings.'));
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
console.log(chalk.dim('Configuration saved. Run "proxy on" to enable proxy.'));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set.js","sourceRoot":"","sources":["../../src/commands/set.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,UAAU,SAAS,CAAC,GAAY,EAAE,OAA6D;IACnG,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC,CAAC;QACxD,OAAO,CAAC,GAAG,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;QACjC,OAAO,CAAC,GAAG,CAAC,8DAA8D,CAAC,CAAC;QAC5E,OAAO;IACT,CAAC;IAED,+BAA+B;IAC/B,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QACpB,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,uCAAuC,GAAG,EAAE,CAAC,CAAC,CAAC;IACzE,CAAC;SAAM,IAAI,OAAO,EAAE,CAAC;QACnB,6BAA6B;QAC7B,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,wBAAwB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACnE,CAAC;QACD,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YAClB,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACtC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,yBAAyB,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACrE,CAAC;QACD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAClC,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YAC1C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,4BAA4B,OAAO,CAAC,OAAO,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC;QACvF,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,IAAI,cAAc,EAAE,EAAE,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,mEAAmE,CAAC,CAAC,CAAC;IACjG,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,sDAAsD,CAAC,CAAC,CAAC;IACjF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ProxyConfig } from '../types/index.js';
|
|
2
|
+
declare class ConfigManager {
|
|
3
|
+
private config;
|
|
4
|
+
constructor();
|
|
5
|
+
getConfig(): ProxyConfig;
|
|
6
|
+
setHttp(url: string): void;
|
|
7
|
+
setHttps(url: string): void;
|
|
8
|
+
setBoth(url: string): void;
|
|
9
|
+
setNoProxy(list: string): void;
|
|
10
|
+
reset(): void;
|
|
11
|
+
getConfigPath(): string;
|
|
12
|
+
}
|
|
13
|
+
export declare const configManager: ConfigManager;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAUrD,cAAM,aAAa;IACjB,OAAO,CAAC,MAAM,CAAqB;;IAanC,SAAS,IAAI,WAAW;IAQxB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI1B,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI3B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAK1B,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI9B,KAAK,IAAI,IAAI;IAMb,aAAa,IAAI,MAAM;CAGxB;AAED,eAAO,MAAM,aAAa,eAAsB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import Conf from 'conf';
|
|
2
|
+
const DEFAULT_PROXY_URL = 'http://127.0.0.1:20170';
|
|
3
|
+
class ConfigManager {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.config = new Conf({
|
|
6
|
+
projectName: 'proxy-manager',
|
|
7
|
+
defaults: {
|
|
8
|
+
http: DEFAULT_PROXY_URL,
|
|
9
|
+
https: DEFAULT_PROXY_URL,
|
|
10
|
+
noProxy: '',
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
getConfig() {
|
|
15
|
+
return {
|
|
16
|
+
http: this.config.get('http'),
|
|
17
|
+
https: this.config.get('https'),
|
|
18
|
+
noProxy: this.config.get('noProxy'),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
setHttp(url) {
|
|
22
|
+
this.config.set('http', url);
|
|
23
|
+
}
|
|
24
|
+
setHttps(url) {
|
|
25
|
+
this.config.set('https', url);
|
|
26
|
+
}
|
|
27
|
+
setBoth(url) {
|
|
28
|
+
this.config.set('http', url);
|
|
29
|
+
this.config.set('https', url);
|
|
30
|
+
}
|
|
31
|
+
setNoProxy(list) {
|
|
32
|
+
this.config.set('noProxy', list);
|
|
33
|
+
}
|
|
34
|
+
reset() {
|
|
35
|
+
this.config.set('http', DEFAULT_PROXY_URL);
|
|
36
|
+
this.config.set('https', DEFAULT_PROXY_URL);
|
|
37
|
+
this.config.set('noProxy', '');
|
|
38
|
+
}
|
|
39
|
+
getConfigPath() {
|
|
40
|
+
return this.config.path;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export const configManager = new ConfigManager();
|
|
44
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,MAAM,iBAAiB,GAAG,wBAAwB,CAAC;AAQnD,MAAM,aAAa;IAGjB;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,IAAI,CAAe;YACnC,WAAW,EAAE,eAAe;YAC5B,QAAQ,EAAE;gBACR,IAAI,EAAE,iBAAiB;gBACvB,KAAK,EAAE,iBAAiB;gBACxB,OAAO,EAAE,EAAE;aACZ;SACF,CAAC,CAAC;IACL,CAAC;IAED,SAAS;QACP,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;YAC7B,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;YAC/B,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC;SACpC,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,GAAW;QACjB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,CAAC;IAED,QAAQ,CAAC,GAAW;QAClB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,CAAC,GAAW;QACjB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC7B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAChC,CAAC;IAED,UAAU,CAAC,IAAY;QACrB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,KAAK;QACH,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;QAC5C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IACjC,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;CACF;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ProxyStatus } from '../types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Check if proxy is currently enabled in environment
|
|
4
|
+
*/
|
|
5
|
+
export declare function isProxyEnabled(): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Get current proxy status
|
|
8
|
+
*/
|
|
9
|
+
export declare function getProxyStatus(): ProxyStatus;
|
|
10
|
+
/**
|
|
11
|
+
* Generate shell export commands for enabling proxy
|
|
12
|
+
* Returns commands that user should eval in their shell
|
|
13
|
+
*/
|
|
14
|
+
export declare function generateEnableCommands(): string;
|
|
15
|
+
/**
|
|
16
|
+
* Generate shell commands for disabling proxy
|
|
17
|
+
*/
|
|
18
|
+
export declare function generateDisableCommands(): string;
|
|
19
|
+
/**
|
|
20
|
+
* Generate PowerShell commands for enabling proxy
|
|
21
|
+
*/
|
|
22
|
+
export declare function generateEnableCommandsPowerShell(): string;
|
|
23
|
+
/**
|
|
24
|
+
* Generate PowerShell commands for disabling proxy
|
|
25
|
+
*/
|
|
26
|
+
export declare function generateDisableCommandsPowerShell(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Detect current shell type
|
|
29
|
+
*/
|
|
30
|
+
export declare function detectShell(): 'powershell' | 'bash' | 'unknown';
|
|
31
|
+
//# sourceMappingURL=proxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../src/core/proxy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;GAEG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAe5C;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAkB/C;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAWhD;AAED;;GAEG;AACH,wBAAgB,gCAAgC,IAAI,MAAM,CAkBzD;AAED;;GAEG;AACH,wBAAgB,iCAAiC,IAAI,MAAM,CAW1D;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,YAAY,GAAG,MAAM,GAAG,SAAS,CAgB/D"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { configManager } from './config.js';
|
|
2
|
+
/**
|
|
3
|
+
* Check if proxy is currently enabled in environment
|
|
4
|
+
*/
|
|
5
|
+
export function isProxyEnabled() {
|
|
6
|
+
return !!(process.env.http_proxy || process.env.HTTP_PROXY);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Get current proxy status
|
|
10
|
+
*/
|
|
11
|
+
export function getProxyStatus() {
|
|
12
|
+
const config = configManager.getConfig();
|
|
13
|
+
return {
|
|
14
|
+
isEnabled: isProxyEnabled(),
|
|
15
|
+
config,
|
|
16
|
+
env: {
|
|
17
|
+
http_proxy: process.env.http_proxy,
|
|
18
|
+
https_proxy: process.env.https_proxy,
|
|
19
|
+
HTTP_PROXY: process.env.HTTP_PROXY,
|
|
20
|
+
HTTPS_PROXY: process.env.HTTPS_PROXY,
|
|
21
|
+
NO_PROXY: process.env.NO_PROXY,
|
|
22
|
+
no_proxy: process.env.no_proxy,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Generate shell export commands for enabling proxy
|
|
28
|
+
* Returns commands that user should eval in their shell
|
|
29
|
+
*/
|
|
30
|
+
export function generateEnableCommands() {
|
|
31
|
+
const config = configManager.getConfig();
|
|
32
|
+
const commands = [];
|
|
33
|
+
commands.push(`export http_proxy="${config.http}"`);
|
|
34
|
+
commands.push(`export https_proxy="${config.https}"`);
|
|
35
|
+
commands.push(`export HTTP_PROXY="${config.http}"`);
|
|
36
|
+
commands.push(`export HTTPS_PROXY="${config.https}"`);
|
|
37
|
+
if (config.noProxy) {
|
|
38
|
+
commands.push(`export NO_PROXY="${config.noProxy}"`);
|
|
39
|
+
commands.push(`export no_proxy="${config.noProxy}"`);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
commands.push('unset NO_PROXY');
|
|
43
|
+
commands.push('unset no_proxy');
|
|
44
|
+
}
|
|
45
|
+
return commands.join('\n');
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Generate shell commands for disabling proxy
|
|
49
|
+
*/
|
|
50
|
+
export function generateDisableCommands() {
|
|
51
|
+
const commands = [
|
|
52
|
+
'unset http_proxy',
|
|
53
|
+
'unset https_proxy',
|
|
54
|
+
'unset HTTP_PROXY',
|
|
55
|
+
'unset HTTPS_PROXY',
|
|
56
|
+
'unset NO_PROXY',
|
|
57
|
+
'unset no_proxy',
|
|
58
|
+
];
|
|
59
|
+
return commands.join('\n');
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Generate PowerShell commands for enabling proxy
|
|
63
|
+
*/
|
|
64
|
+
export function generateEnableCommandsPowerShell() {
|
|
65
|
+
const config = configManager.getConfig();
|
|
66
|
+
const commands = [];
|
|
67
|
+
commands.push(`$env:http_proxy="${config.http}"`);
|
|
68
|
+
commands.push(`$env:https_proxy="${config.https}"`);
|
|
69
|
+
commands.push(`$env:HTTP_PROXY="${config.http}"`);
|
|
70
|
+
commands.push(`$env:HTTPS_PROXY="${config.https}"`);
|
|
71
|
+
if (config.noProxy) {
|
|
72
|
+
commands.push(`$env:NO_PROXY="${config.noProxy}"`);
|
|
73
|
+
commands.push(`$env:no_proxy="${config.noProxy}"`);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
commands.push('Remove-Item Env:NO_PROXY -ErrorAction SilentlyContinue');
|
|
77
|
+
commands.push('Remove-Item Env:no_proxy -ErrorAction SilentlyContinue');
|
|
78
|
+
}
|
|
79
|
+
return commands.join('\n');
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Generate PowerShell commands for disabling proxy
|
|
83
|
+
*/
|
|
84
|
+
export function generateDisableCommandsPowerShell() {
|
|
85
|
+
const commands = [
|
|
86
|
+
'Remove-Item Env:http_proxy -ErrorAction SilentlyContinue',
|
|
87
|
+
'Remove-Item Env:https_proxy -ErrorAction SilentlyContinue',
|
|
88
|
+
'Remove-Item Env:HTTP_PROXY -ErrorAction SilentlyContinue',
|
|
89
|
+
'Remove-Item Env:HTTPS_PROXY -ErrorAction SilentlyContinue',
|
|
90
|
+
'Remove-Item Env:NO_PROXY -ErrorAction SilentlyContinue',
|
|
91
|
+
'Remove-Item Env:no_proxy -ErrorAction SilentlyContinue',
|
|
92
|
+
];
|
|
93
|
+
return commands.join('\n');
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Detect current shell type
|
|
97
|
+
*/
|
|
98
|
+
export function detectShell() {
|
|
99
|
+
if (process.platform === 'win32') {
|
|
100
|
+
// On Windows, check if running in PowerShell or cmd
|
|
101
|
+
const shell = process.env.SHELL || process.env.ComSpec || '';
|
|
102
|
+
if (shell.toLowerCase().includes('powershell') || process.env.PSModulePath) {
|
|
103
|
+
return 'powershell';
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
// Unix-like systems (macOS, Linux) or Git Bash on Windows
|
|
107
|
+
const shell = process.env.SHELL || '';
|
|
108
|
+
if (shell.includes('bash') || shell.includes('zsh') || shell.includes('sh')) {
|
|
109
|
+
return 'bash';
|
|
110
|
+
}
|
|
111
|
+
return 'unknown';
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=proxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy.js","sourceRoot":"","sources":["../../src/core/proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAC9D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,MAAM,GAAG,aAAa,CAAC,SAAS,EAAE,CAAC;IAEzC,OAAO;QACL,SAAS,EAAE,cAAc,EAAE;QAC3B,MAAM;QACN,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;YAClC,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW;YACpC,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;YAClC,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW;YACpC,QAAQ,EAAE,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7D,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;YAC3E,OAAO,YAAY,CAAC;QACtB,CAAC;IACH,CAAC;IAED,0DAA0D;IAC1D,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;IACtC,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5E,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { handleOn } from './commands/on.js';
|
|
5
|
+
import { handleOff } from './commands/off.js';
|
|
6
|
+
import { handleList } from './commands/list.js';
|
|
7
|
+
import { handleSet } from './commands/set.js';
|
|
8
|
+
import { handleConfig } from './commands/config.js';
|
|
9
|
+
import { getProxyStatus } from './core/proxy.js';
|
|
10
|
+
const program = new Command();
|
|
11
|
+
program
|
|
12
|
+
.name('pvm')
|
|
13
|
+
.description('Cross-platform CLI tool for managing proxy environment variables')
|
|
14
|
+
.version('1.0.0');
|
|
15
|
+
// pvm on
|
|
16
|
+
program
|
|
17
|
+
.command('on')
|
|
18
|
+
.description('Enable proxy (displays commands to run)')
|
|
19
|
+
.action(() => {
|
|
20
|
+
handleOn();
|
|
21
|
+
});
|
|
22
|
+
// pvm off
|
|
23
|
+
program
|
|
24
|
+
.command('off')
|
|
25
|
+
.description('Disable proxy (displays commands to run)')
|
|
26
|
+
.action(() => {
|
|
27
|
+
handleOff();
|
|
28
|
+
});
|
|
29
|
+
// pvm list
|
|
30
|
+
program
|
|
31
|
+
.command('list')
|
|
32
|
+
.alias('status')
|
|
33
|
+
.description('Show current proxy configuration and status')
|
|
34
|
+
.action(() => {
|
|
35
|
+
handleList();
|
|
36
|
+
});
|
|
37
|
+
// pvm set <url>
|
|
38
|
+
program
|
|
39
|
+
.command('set [url]')
|
|
40
|
+
.description('Set proxy URL for both HTTP and HTTPS')
|
|
41
|
+
.option('--http <url>', 'Set HTTP proxy URL')
|
|
42
|
+
.option('--https <url>', 'Set HTTPS proxy URL')
|
|
43
|
+
.option('--no-proxy <list>', 'Set NO_PROXY list (comma-separated)')
|
|
44
|
+
.action((url, options) => {
|
|
45
|
+
handleSet(url, options);
|
|
46
|
+
});
|
|
47
|
+
// pvm config
|
|
48
|
+
const configCmd = program
|
|
49
|
+
.command('config')
|
|
50
|
+
.description('Manage proxy configuration');
|
|
51
|
+
configCmd
|
|
52
|
+
.command('show')
|
|
53
|
+
.description('Show current configuration')
|
|
54
|
+
.action(() => {
|
|
55
|
+
handleConfig('show');
|
|
56
|
+
});
|
|
57
|
+
configCmd
|
|
58
|
+
.command('set <key> <value>')
|
|
59
|
+
.description('Set configuration value (http|https|both|no-proxy)')
|
|
60
|
+
.action((key, value) => {
|
|
61
|
+
handleConfig('set', key, value);
|
|
62
|
+
});
|
|
63
|
+
configCmd
|
|
64
|
+
.command('add <key> <value>')
|
|
65
|
+
.description('Add item to NO_PROXY list')
|
|
66
|
+
.action((key, value) => {
|
|
67
|
+
handleConfig('add', key, value);
|
|
68
|
+
});
|
|
69
|
+
configCmd
|
|
70
|
+
.command('rm <key> <value>')
|
|
71
|
+
.alias('remove')
|
|
72
|
+
.description('Remove item from NO_PROXY list')
|
|
73
|
+
.action((key, value) => {
|
|
74
|
+
handleConfig('rm', key, value);
|
|
75
|
+
});
|
|
76
|
+
configCmd
|
|
77
|
+
.command('reset')
|
|
78
|
+
.description('Reset configuration to defaults')
|
|
79
|
+
.action(() => {
|
|
80
|
+
handleConfig('reset');
|
|
81
|
+
});
|
|
82
|
+
// Default action (no command)
|
|
83
|
+
program.action(() => {
|
|
84
|
+
const status = getProxyStatus();
|
|
85
|
+
if (status.isEnabled) {
|
|
86
|
+
console.log(chalk.green(`✓ Proxy is ENABLED`));
|
|
87
|
+
console.log(chalk.dim(` ${status.env.http_proxy || status.env.HTTP_PROXY}`));
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
console.log(chalk.red('✗ Proxy is DISABLED'));
|
|
91
|
+
}
|
|
92
|
+
console.log();
|
|
93
|
+
console.log(chalk.dim('Run "pvm --help" for usage information'));
|
|
94
|
+
});
|
|
95
|
+
program.parse();
|
|
96
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,KAAK,CAAC;KACX,WAAW,CAAC,kEAAkE,CAAC;KAC/E,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,SAAS;AACT,OAAO;KACJ,OAAO,CAAC,IAAI,CA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AAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC,CAAC;AACnE,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface ProxyConfig {
|
|
2
|
+
http: string;
|
|
3
|
+
https: string;
|
|
4
|
+
noProxy: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ProxyStatus {
|
|
7
|
+
isEnabled: boolean;
|
|
8
|
+
config: ProxyConfig;
|
|
9
|
+
env: {
|
|
10
|
+
http_proxy?: string;
|
|
11
|
+
https_proxy?: string;
|
|
12
|
+
HTTP_PROXY?: string;
|
|
13
|
+
HTTPS_PROXY?: string;
|
|
14
|
+
NO_PROXY?: string;
|
|
15
|
+
no_proxy?: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,WAAW,CAAC;IACpB,GAAG,EAAE;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for managing NO_PROXY comma-separated list
|
|
3
|
+
*/
|
|
4
|
+
export declare function parseNoProxyList(list: string): string[];
|
|
5
|
+
export declare function formatNoProxyList(items: string[]): string;
|
|
6
|
+
export declare function addToNoProxyList(list: string, item: string): string;
|
|
7
|
+
export declare function removeFromNoProxyList(list: string, item: string): string;
|
|
8
|
+
export declare function containsInNoProxyList(list: string, item: string): boolean;
|
|
9
|
+
//# sourceMappingURL=no-proxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-proxy.d.ts","sourceRoot":"","sources":["../../src/utils/no-proxy.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAMvD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAEzD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAYnE;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAQxE;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAKzE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for managing NO_PROXY comma-separated list
|
|
3
|
+
*/
|
|
4
|
+
export function parseNoProxyList(list) {
|
|
5
|
+
if (!list)
|
|
6
|
+
return [];
|
|
7
|
+
return list
|
|
8
|
+
.split(',')
|
|
9
|
+
.map((item) => item.trim())
|
|
10
|
+
.filter((item) => item.length > 0);
|
|
11
|
+
}
|
|
12
|
+
export function formatNoProxyList(items) {
|
|
13
|
+
return items.filter((item) => item.trim().length > 0).join(',');
|
|
14
|
+
}
|
|
15
|
+
export function addToNoProxyList(list, item) {
|
|
16
|
+
if (!item || !item.trim())
|
|
17
|
+
return list;
|
|
18
|
+
const items = parseNoProxyList(list);
|
|
19
|
+
const trimmedItem = item.trim();
|
|
20
|
+
if (items.includes(trimmedItem)) {
|
|
21
|
+
return list; // Already exists
|
|
22
|
+
}
|
|
23
|
+
items.push(trimmedItem);
|
|
24
|
+
return formatNoProxyList(items);
|
|
25
|
+
}
|
|
26
|
+
export function removeFromNoProxyList(list, item) {
|
|
27
|
+
if (!item || !item.trim())
|
|
28
|
+
return list;
|
|
29
|
+
const items = parseNoProxyList(list);
|
|
30
|
+
const trimmedItem = item.trim();
|
|
31
|
+
const filtered = items.filter((i) => i !== trimmedItem);
|
|
32
|
+
return formatNoProxyList(filtered);
|
|
33
|
+
}
|
|
34
|
+
export function containsInNoProxyList(list, item) {
|
|
35
|
+
if (!item || !item.trim())
|
|
36
|
+
return false;
|
|
37
|
+
const items = parseNoProxyList(list);
|
|
38
|
+
return items.includes(item.trim());
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=no-proxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-proxy.js","sourceRoot":"","sources":["../../src/utils/no-proxy.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,OAAO,IAAI;SACR,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAe;IAC/C,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CA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C;AACrC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ryuyx/pvm",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Cross-platform CLI tool for managing proxy environment variables",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"pvm": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"dev": "tsc --watch",
|
|
13
|
+
"start": "node dist/index.js",
|
|
14
|
+
"lint": "eslint src --ext .ts",
|
|
15
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
16
|
+
"prepublishOnly": "npm run build"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"proxy",
|
|
20
|
+
"cli",
|
|
21
|
+
"environment",
|
|
22
|
+
"http-proxy",
|
|
23
|
+
"https-proxy",
|
|
24
|
+
"no-proxy",
|
|
25
|
+
"cross-platform"
|
|
26
|
+
],
|
|
27
|
+
"author": "Liu Yuxuan <768442726@qq.com>",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/ryuyx/pvm.git"
|
|
35
|
+
},
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/ryuyx/pvm/issues"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://github.com/ryuyx/pvm#readme",
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"README.md",
|
|
43
|
+
"LICENSE"
|
|
44
|
+
],
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=16.0.0"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"chalk": "^5.3.0",
|
|
50
|
+
"commander": "^12.0.0",
|
|
51
|
+
"conf": "^13.0.1"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/node": "^20.11.5",
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "^6.19.0",
|
|
56
|
+
"@typescript-eslint/parser": "^6.19.0",
|
|
57
|
+
"eslint": "^8.56.0",
|
|
58
|
+
"prettier": "^3.2.4",
|
|
59
|
+
"typescript": "^5.3.3"
|
|
60
|
+
}
|
|
61
|
+
}
|