sing-box-cli 0.0.5__tar.gz → 0.0.7__tar.gz
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.
- {sing_box_cli-0.0.5 → sing_box_cli-0.0.7}/CHANGELOG.md +18 -0
- {sing_box_cli-0.0.5 → sing_box_cli-0.0.7}/PKG-INFO +14 -10
- {sing_box_cli-0.0.5 → sing_box_cli-0.0.7}/README.md +13 -9
- {sing_box_cli-0.0.5 → sing_box_cli-0.0.7}/pyproject.toml +1 -1
- {sing_box_cli-0.0.5 → sing_box_cli-0.0.7}/src/sing_box_service/__init__.py +1 -1
- {sing_box_cli-0.0.5 → sing_box_cli-0.0.7}/src/sing_box_service/config.py +8 -0
- {sing_box_cli-0.0.5 → sing_box_cli-0.0.7}/src/sing_box_service/main.py +7 -0
- {sing_box_cli-0.0.5 → sing_box_cli-0.0.7}/src/sing_box_service/service.py +2 -1
- {sing_box_cli-0.0.5 → sing_box_cli-0.0.7}/uv.lock +1 -1
- {sing_box_cli-0.0.5 → sing_box_cli-0.0.7}/.github/dependabot.yml +0 -0
- {sing_box_cli-0.0.5 → sing_box_cli-0.0.7}/.github/workflows/main.yml +0 -0
- {sing_box_cli-0.0.5 → sing_box_cli-0.0.7}/.gitignore +0 -0
- {sing_box_cli-0.0.5 → sing_box_cli-0.0.7}/.pre-commit-config.yaml +0 -0
- {sing_box_cli-0.0.5 → sing_box_cli-0.0.7}/.vscode/PythonImportHelper-v2-Completion.json +0 -0
- {sing_box_cli-0.0.5 → sing_box_cli-0.0.7}/.vscode/settings.json +0 -0
- {sing_box_cli-0.0.5 → sing_box_cli-0.0.7}/LICENSE +0 -0
- {sing_box_cli-0.0.5 → sing_box_cli-0.0.7}/assets/image.png +0 -0
- {sing_box_cli-0.0.5 → sing_box_cli-0.0.7}/scripts/bump.sh +0 -0
- {sing_box_cli-0.0.5 → sing_box_cli-0.0.7}/scripts/format.sh +0 -0
- {sing_box_cli-0.0.5 → sing_box_cli-0.0.7}/scripts/lint.sh +0 -0
- {sing_box_cli-0.0.5 → sing_box_cli-0.0.7}/src/sing_box_service/py.typed +0 -0
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## 0.0.7 - 2025-01-10
|
|
6
|
+
|
|
7
|
+
### 🚀 Features
|
|
8
|
+
|
|
9
|
+
- Add config clean_cache
|
|
10
|
+
|
|
11
|
+
### 🐛 Bug Fixes
|
|
12
|
+
|
|
13
|
+
- Service start before network connection
|
|
14
|
+
|
|
15
|
+
### 📚 Documentation
|
|
16
|
+
|
|
17
|
+
- Update linux install and run
|
|
18
|
+
|
|
19
|
+
### ⚙️ Miscellaneous Tasks
|
|
20
|
+
|
|
21
|
+
- Update linux show logs prompt
|
|
22
|
+
|
|
5
23
|
## 0.0.5 - 2025-01-07
|
|
6
24
|
|
|
7
25
|
### 🚀 Features
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sing-box-cli
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.7
|
|
4
4
|
Summary: cross-platform sing-box-service manager.
|
|
5
5
|
Project-URL: Homepage, https://github.com/aittcuszz/sing-box-service
|
|
6
6
|
Project-URL: Issues, https://github.com/atticuszz/sing-box-service/issues
|
|
@@ -45,7 +45,7 @@ Description-Content-Type: text/markdown
|
|
|
45
45
|
|
|
46
46
|
# Sing-Box CLI
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
🎤 Cross-platform sing-box service manager.
|
|
49
49
|
|
|
50
50
|

|
|
51
51
|
|
|
@@ -53,27 +53,31 @@ cross-platform sing-box service manager
|
|
|
53
53
|
|
|
54
54
|
### uv
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
Windows
|
|
57
57
|
|
|
58
58
|
```powershell
|
|
59
59
|
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
Linux
|
|
63
63
|
|
|
64
64
|
```bash
|
|
65
|
-
# root
|
|
66
|
-
sudo su
|
|
67
|
-
# install as root
|
|
68
65
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
69
|
-
# create link
|
|
70
|
-
ln -s $(which uv) /usr/local/bin/uv
|
|
71
66
|
```
|
|
72
67
|
|
|
73
68
|
### sing-box
|
|
74
69
|
|
|
70
|
+
Windows
|
|
71
|
+
|
|
72
|
+
```powershell
|
|
73
|
+
uv tool install sing-box-cli
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Linux
|
|
77
|
+
|
|
75
78
|
```bash
|
|
76
79
|
uv tool install sing-box-cli
|
|
80
|
+
sudo ln -sf $(which sing-box-cli) /usr/local/bin/
|
|
77
81
|
```
|
|
78
82
|
|
|
79
83
|
## Run
|
|
@@ -87,5 +91,5 @@ sing-box-cli --help
|
|
|
87
91
|
Linux
|
|
88
92
|
|
|
89
93
|
```bash
|
|
90
|
-
sudo
|
|
94
|
+
sudo sing-box-cli --help
|
|
91
95
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Sing-Box CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
🎤 Cross-platform sing-box service manager.
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
@@ -8,27 +8,31 @@ cross-platform sing-box service manager
|
|
|
8
8
|
|
|
9
9
|
### uv
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Windows
|
|
12
12
|
|
|
13
13
|
```powershell
|
|
14
14
|
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Linux
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
# root
|
|
21
|
-
sudo su
|
|
22
|
-
# install as root
|
|
23
20
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
24
|
-
# create link
|
|
25
|
-
ln -s $(which uv) /usr/local/bin/uv
|
|
26
21
|
```
|
|
27
22
|
|
|
28
23
|
### sing-box
|
|
29
24
|
|
|
25
|
+
Windows
|
|
26
|
+
|
|
27
|
+
```powershell
|
|
28
|
+
uv tool install sing-box-cli
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Linux
|
|
32
|
+
|
|
30
33
|
```bash
|
|
31
34
|
uv tool install sing-box-cli
|
|
35
|
+
sudo ln -sf $(which sing-box-cli) /usr/local/bin/
|
|
32
36
|
```
|
|
33
37
|
|
|
34
38
|
## Run
|
|
@@ -42,5 +46,5 @@ sing-box-cli --help
|
|
|
42
46
|
Linux
|
|
43
47
|
|
|
44
48
|
```bash
|
|
45
|
-
sudo
|
|
49
|
+
sudo sing-box-cli --help
|
|
46
50
|
```
|
|
@@ -209,7 +209,7 @@ sort_commits = "oldest"
|
|
|
209
209
|
|
|
210
210
|
|
|
211
211
|
[tool.bumpversion]
|
|
212
|
-
current_version = "0.0.
|
|
212
|
+
current_version = "0.0.7"
|
|
213
213
|
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
|
214
214
|
serialize = ["{major}.{minor}.{patch}"]
|
|
215
215
|
search = "{current_version}"
|
|
@@ -35,6 +35,7 @@ class Config:
|
|
|
35
35
|
|
|
36
36
|
self.config_file = self.install_dir / "config.json"
|
|
37
37
|
self.subscription_file = self.install_dir / "subscription.txt"
|
|
38
|
+
self.cache_db = self.install_dir / "cache.db"
|
|
38
39
|
|
|
39
40
|
def init_directories(self) -> None:
|
|
40
41
|
self.install_dir.mkdir(parents=True, exist_ok=True)
|
|
@@ -93,3 +94,10 @@ class Config:
|
|
|
93
94
|
print(self.sub_url)
|
|
94
95
|
else:
|
|
95
96
|
print("❌ No subscription URL found.")
|
|
97
|
+
|
|
98
|
+
def clean_cache(self) -> None:
|
|
99
|
+
if self.cache_db.exists():
|
|
100
|
+
self.cache_db.unlink()
|
|
101
|
+
print("🗑️ Cache database removed.")
|
|
102
|
+
else:
|
|
103
|
+
print("❌ Cache database not found.")
|
|
@@ -127,6 +127,13 @@ def config_show() -> None:
|
|
|
127
127
|
cli.config.show_config()
|
|
128
128
|
|
|
129
129
|
|
|
130
|
+
@config.command("clean_cache")
|
|
131
|
+
def config_clean_cache() -> None:
|
|
132
|
+
"""Clean cache database"""
|
|
133
|
+
cli = SingBoxCLI()
|
|
134
|
+
cli.config.clean_cache()
|
|
135
|
+
|
|
136
|
+
|
|
130
137
|
@app.command()
|
|
131
138
|
def logs() -> None:
|
|
132
139
|
"""Show sing-box service logs"""
|
|
@@ -163,7 +163,7 @@ class LinuxServiceManager(ServiceManager):
|
|
|
163
163
|
[Unit]
|
|
164
164
|
Description=sing-box service
|
|
165
165
|
Documentation=https://sing-box.sagernet.org
|
|
166
|
-
After=network.target
|
|
166
|
+
After=After=network.target network-online.target NetworkManager.service NetworkManager-wait-online.service
|
|
167
167
|
|
|
168
168
|
[Service]
|
|
169
169
|
Type=simple
|
|
@@ -203,6 +203,7 @@ WantedBy=multi-user.target
|
|
|
203
203
|
return "Stopped"
|
|
204
204
|
|
|
205
205
|
def logs(self) -> None:
|
|
206
|
+
print("⌛ Showing real-time logs (Press Ctrl+C to exit)")
|
|
206
207
|
subprocess.run(["journalctl", "-u", "sing-box", "-o", "cat", "-f"])
|
|
207
208
|
|
|
208
209
|
def disable(self) -> None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|