sing-box-cli 0.0.5__tar.gz → 0.0.6__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.
Files changed (21) hide show
  1. {sing_box_cli-0.0.5 → sing_box_cli-0.0.6}/CHANGELOG.md +14 -0
  2. {sing_box_cli-0.0.5 → sing_box_cli-0.0.6}/PKG-INFO +14 -10
  3. {sing_box_cli-0.0.5 → sing_box_cli-0.0.6}/README.md +13 -9
  4. {sing_box_cli-0.0.5 → sing_box_cli-0.0.6}/pyproject.toml +1 -1
  5. {sing_box_cli-0.0.5 → sing_box_cli-0.0.6}/src/sing_box_service/__init__.py +1 -1
  6. {sing_box_cli-0.0.5 → sing_box_cli-0.0.6}/src/sing_box_service/config.py +8 -0
  7. {sing_box_cli-0.0.5 → sing_box_cli-0.0.6}/src/sing_box_service/main.py +7 -0
  8. {sing_box_cli-0.0.5 → sing_box_cli-0.0.6}/src/sing_box_service/service.py +1 -0
  9. {sing_box_cli-0.0.5 → sing_box_cli-0.0.6}/uv.lock +1 -1
  10. {sing_box_cli-0.0.5 → sing_box_cli-0.0.6}/.github/dependabot.yml +0 -0
  11. {sing_box_cli-0.0.5 → sing_box_cli-0.0.6}/.github/workflows/main.yml +0 -0
  12. {sing_box_cli-0.0.5 → sing_box_cli-0.0.6}/.gitignore +0 -0
  13. {sing_box_cli-0.0.5 → sing_box_cli-0.0.6}/.pre-commit-config.yaml +0 -0
  14. {sing_box_cli-0.0.5 → sing_box_cli-0.0.6}/.vscode/PythonImportHelper-v2-Completion.json +0 -0
  15. {sing_box_cli-0.0.5 → sing_box_cli-0.0.6}/.vscode/settings.json +0 -0
  16. {sing_box_cli-0.0.5 → sing_box_cli-0.0.6}/LICENSE +0 -0
  17. {sing_box_cli-0.0.5 → sing_box_cli-0.0.6}/assets/image.png +0 -0
  18. {sing_box_cli-0.0.5 → sing_box_cli-0.0.6}/scripts/bump.sh +0 -0
  19. {sing_box_cli-0.0.5 → sing_box_cli-0.0.6}/scripts/format.sh +0 -0
  20. {sing_box_cli-0.0.5 → sing_box_cli-0.0.6}/scripts/lint.sh +0 -0
  21. {sing_box_cli-0.0.5 → sing_box_cli-0.0.6}/src/sing_box_service/py.typed +0 -0
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## 0.0.6 - 2025-01-09
6
+
7
+ ### 🚀 Features
8
+
9
+ - Add config clean_cache
10
+
11
+ ### 📚 Documentation
12
+
13
+ - Update linux install and run
14
+
15
+ ### ⚙️ Miscellaneous Tasks
16
+
17
+ - Update linux show logs prompt
18
+
5
19
  ## 0.0.5 - 2025-01-07
6
20
 
7
21
  ### 🚀 Features
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sing-box-cli
3
- Version: 0.0.5
3
+ Version: 0.0.6
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
- cross-platform sing-box service manager
48
+ 🎤 Cross-platform sing-box service manager.
49
49
 
50
50
  ![](assets/image.png)
51
51
 
@@ -53,27 +53,31 @@ cross-platform sing-box service manager
53
53
 
54
54
  ### uv
55
55
 
56
- windows
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
- linux
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 uv tool run sing-box-cli --help
94
+ sudo sing-box-cli --help
91
95
  ```
@@ -1,6 +1,6 @@
1
1
  # Sing-Box CLI
2
2
 
3
- cross-platform sing-box service manager
3
+ 🎤 Cross-platform sing-box service manager.
4
4
 
5
5
  ![](assets/image.png)
6
6
 
@@ -8,27 +8,31 @@ cross-platform sing-box service manager
8
8
 
9
9
  ### uv
10
10
 
11
- windows
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
- linux
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 uv tool run sing-box-cli --help
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.5"
212
+ current_version = "0.0.6"
213
213
  parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
214
214
  serialize = ["{major}.{minor}.{patch}"]
215
215
  search = "{current_version}"
@@ -2,4 +2,4 @@ from .main import main
2
2
 
3
3
  __all__ = ["main"]
4
4
 
5
- __version__ = "0.0.5"
5
+ __version__ = "0.0.6"
@@ -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"""
@@ -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:
@@ -547,7 +547,7 @@ wheels = [
547
547
 
548
548
  [[package]]
549
549
  name = "sing-box-cli"
550
- version = "0.0.5"
550
+ version = "0.0.6"
551
551
  source = { editable = "." }
552
552
  dependencies = [
553
553
  { name = "psutil", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
File without changes
File without changes