fcbyk-cli 0.2.2__tar.gz → 0.3.0__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 (128) hide show
  1. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/LICENSE +21 -21
  2. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/MANIFEST.in +18 -18
  3. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/PKG-INFO +91 -103
  4. fcbyk_cli-0.3.0/README.md +44 -0
  5. fcbyk_cli-0.3.0/pyproject.toml +48 -0
  6. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/setup.cfg +75 -75
  7. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/setup.py +4 -4
  8. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/cli.py +51 -46
  9. fcbyk_cli-0.3.0/src/fcbyk/cli_support/__init__.py +11 -0
  10. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/cli_support/callbacks.py +113 -73
  11. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/cli_support/guard.py +77 -77
  12. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/cli_support/helpers.py +21 -21
  13. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/cli_support/output.py +135 -135
  14. fcbyk_cli-0.3.0/src/fcbyk/commands/__init__.py +11 -0
  15. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/commands/ai/cli.py +178 -178
  16. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/commands/ai/service.py +150 -150
  17. fcbyk_cli-0.3.0/src/fcbyk/commands/alias.py +125 -0
  18. fcbyk_cli-0.3.0/src/fcbyk/commands/config/__init__.py +1 -0
  19. fcbyk_cli-0.3.0/src/fcbyk/commands/config/cli.py +20 -0
  20. fcbyk_cli-0.3.0/src/fcbyk/commands/get/__init__.py +3 -0
  21. fcbyk_cli-0.3.0/src/fcbyk/commands/get/cli.py +85 -0
  22. fcbyk_cli-0.3.0/src/fcbyk/commands/lansend/cli.py +100 -0
  23. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/commands/lansend/controller.py +96 -2
  24. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/commands/lansend/service.py +256 -256
  25. fcbyk_cli-0.3.0/src/fcbyk/commands/pick/cli.py +84 -0
  26. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/commands/pick/controller.py +639 -579
  27. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/commands/pick/service.py +418 -317
  28. fcbyk_cli-0.3.0/src/fcbyk/commands/run/__init__.py +3 -0
  29. fcbyk_cli-0.3.0/src/fcbyk/commands/run/cli.py +125 -0
  30. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/commands/slide/cli.py +80 -62
  31. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/commands/slide/controller.py +351 -214
  32. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/commands/slide/service.py +229 -229
  33. fcbyk_cli-0.3.0/src/fcbyk/commands/svc/cli.py +145 -0
  34. fcbyk_cli-0.3.0/src/fcbyk/defaults.py +19 -0
  35. fcbyk_cli-0.3.0/src/fcbyk/svc.py +349 -0
  36. fcbyk_cli-0.3.0/src/fcbyk/utils/download.py +47 -0
  37. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/utils/network.py +106 -106
  38. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/web/R.py +18 -18
  39. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/web/app.py +60 -60
  40. fcbyk_cli-0.3.0/src/fcbyk/web/dist/assets/_plugin-vue_export-helper-D5bLm9b1.js +17 -0
  41. fcbyk_cli-0.3.0/src/fcbyk/web/dist/assets/chevron-right-V59kZ3xW.js +26 -0
  42. fcbyk_cli-0.3.0/src/fcbyk/web/dist/assets/lansend-B4y9i9OL.css +10 -0
  43. fcbyk_cli-0.3.0/src/fcbyk/web/dist/assets/lansend-DLZRdxlC.js +48 -0
  44. fcbyk_cli-0.3.0/src/fcbyk/web/dist/assets/pick-BAE_jh_k.js +14 -0
  45. fcbyk_cli-0.3.0/src/fcbyk/web/dist/assets/pick-D5sCttea.css +1 -0
  46. fcbyk_cli-0.3.0/src/fcbyk/web/dist/assets/slide-BNnt-vwc.css +1 -0
  47. fcbyk_cli-0.3.0/src/fcbyk/web/dist/assets/slide-DmAmqeim.js +48 -0
  48. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/web/dist/lansend.html +17 -16
  49. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/web/dist/pick.html +13 -13
  50. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/web/dist/slide.html +27 -26
  51. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk_cli.egg-info/SOURCES.txt +19 -49
  52. fcbyk_cli-0.2.2/README.md +0 -56
  53. fcbyk_cli-0.2.2/pyproject.toml +0 -42
  54. fcbyk_cli-0.2.2/src/fcbyk/cli_support/__init__.py +0 -7
  55. fcbyk_cli-0.2.2/src/fcbyk/cli_support/gui.py +0 -98
  56. fcbyk_cli-0.2.2/src/fcbyk/commands/__init__.py +0 -7
  57. fcbyk_cli-0.2.2/src/fcbyk/commands/alias.py +0 -95
  58. fcbyk_cli-0.2.2/src/fcbyk/commands/lansend/cli.py +0 -150
  59. fcbyk_cli-0.2.2/src/fcbyk/commands/pick/cli.py +0 -163
  60. fcbyk_cli-0.2.2/src/fcbyk/commands/slide/gui_server.py +0 -40
  61. fcbyk_cli-0.2.2/src/fcbyk/gui/__init__.py +0 -12
  62. fcbyk_cli-0.2.2/src/fcbyk/gui/__main__.py +0 -14
  63. fcbyk_cli-0.2.2/src/fcbyk/gui/app.py +0 -216
  64. fcbyk_cli-0.2.2/src/fcbyk/gui/assets/icon.png +0 -0
  65. fcbyk_cli-0.2.2/src/fcbyk/gui/core/compatibility.py +0 -116
  66. fcbyk_cli-0.2.2/src/fcbyk/gui/core/process.py +0 -103
  67. fcbyk_cli-0.2.2/src/fcbyk/gui/core/singleton.py +0 -79
  68. fcbyk_cli-0.2.2/src/fcbyk/gui/ui/lansend_page.py +0 -536
  69. fcbyk_cli-0.2.2/src/fcbyk/gui/ui/main_window.py +0 -239
  70. fcbyk_cli-0.2.2/src/fcbyk/gui/ui/pick_items_dialog.py +0 -156
  71. fcbyk_cli-0.2.2/src/fcbyk/gui/ui/pick_page.py +0 -475
  72. fcbyk_cli-0.2.2/src/fcbyk/gui/ui/resources.py +0 -121
  73. fcbyk_cli-0.2.2/src/fcbyk/gui/ui/slide_page.py +0 -293
  74. fcbyk_cli-0.2.2/src/fcbyk/tests/__init__.py +0 -0
  75. fcbyk_cli-0.2.2/src/fcbyk/tests/ai/__init__.py +0 -0
  76. fcbyk_cli-0.2.2/src/fcbyk/tests/ai/test_cli.py +0 -199
  77. fcbyk_cli-0.2.2/src/fcbyk/tests/ai/test_service.py +0 -262
  78. fcbyk_cli-0.2.2/src/fcbyk/tests/lansend/__init__.py +0 -0
  79. fcbyk_cli-0.2.2/src/fcbyk/tests/lansend/test_cli.py +0 -9
  80. fcbyk_cli-0.2.2/src/fcbyk/tests/lansend/test_controller_extra.py +0 -122
  81. fcbyk_cli-0.2.2/src/fcbyk/tests/lansend/test_controller_more.py +0 -36
  82. fcbyk_cli-0.2.2/src/fcbyk/tests/lansend/test_lansend.py +0 -110
  83. fcbyk_cli-0.2.2/src/fcbyk/tests/lansend/test_web.py +0 -45
  84. fcbyk_cli-0.2.2/src/fcbyk/tests/pick/__init__.py +0 -0
  85. fcbyk_cli-0.2.2/src/fcbyk/tests/pick/test_cli.py +0 -214
  86. fcbyk_cli-0.2.2/src/fcbyk/tests/pick/test_controller.py +0 -210
  87. fcbyk_cli-0.2.2/src/fcbyk/tests/pick/test_service.py +0 -75
  88. fcbyk_cli-0.2.2/src/fcbyk/tests/slide/__init__.py +0 -0
  89. fcbyk_cli-0.2.2/src/fcbyk/tests/slide/test_cli.py +0 -52
  90. fcbyk_cli-0.2.2/src/fcbyk/tests/slide/test_controller.py +0 -169
  91. fcbyk_cli-0.2.2/src/fcbyk/tests/slide/test_service.py +0 -221
  92. fcbyk_cli-0.2.2/src/fcbyk/tests/test_cli.py +0 -19
  93. fcbyk_cli-0.2.2/src/fcbyk/tests/utils/__init__.py +0 -0
  94. fcbyk_cli-0.2.2/src/fcbyk/tests/utils/test_network.py +0 -106
  95. fcbyk_cli-0.2.2/src/fcbyk/tests/utils/test_output.py +0 -54
  96. fcbyk_cli-0.2.2/src/fcbyk/tests/web/__init__.py +0 -0
  97. fcbyk_cli-0.2.2/src/fcbyk/tests/web/test_app.py +0 -48
  98. fcbyk_cli-0.2.2/src/fcbyk/utils/__init__.py +0 -0
  99. fcbyk_cli-0.2.2/src/fcbyk/web/__init__.py +0 -0
  100. fcbyk_cli-0.2.2/src/fcbyk/web/dist/assets/_plugin-vue_export-helper-B2FpY1bO.js +0 -17
  101. fcbyk_cli-0.2.2/src/fcbyk/web/dist/assets/lansend-1RmPJXbK.js +0 -3
  102. fcbyk_cli-0.2.2/src/fcbyk/web/dist/assets/lansend-Ca1IaQ5_.css +0 -10
  103. fcbyk_cli-0.2.2/src/fcbyk/web/dist/assets/pick-CeEklAKS.css +0 -1
  104. fcbyk_cli-0.2.2/src/fcbyk/web/dist/assets/pick-D7NjQrpm.js +0 -11
  105. fcbyk_cli-0.2.2/src/fcbyk/web/dist/assets/slide-B9qYfLS5.js +0 -66
  106. fcbyk_cli-0.2.2/src/fcbyk/web/dist/assets/slide-ButJcaV8.css +0 -1
  107. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/__init__.py +0 -0
  108. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/commands/ai/__init__.py +0 -0
  109. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/commands/ai/renderer.py +0 -0
  110. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/commands/lansend/__init__.py +0 -0
  111. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/commands/pick/__init__.py +0 -0
  112. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/commands/slide/__init__.py +0 -0
  113. {fcbyk_cli-0.2.2/src/fcbyk/gui/core → fcbyk_cli-0.3.0/src/fcbyk/commands/svc}/__init__.py +0 -0
  114. {fcbyk_cli-0.2.2/src/fcbyk/gui/ui → fcbyk_cli-0.3.0/src/fcbyk/utils}/__init__.py +0 -0
  115. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/utils/common.py +0 -0
  116. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/utils/files.py +0 -0
  117. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/utils/storage.py +0 -0
  118. {fcbyk_cli-0.2.2/src/fcbyk/gui/utils → fcbyk_cli-0.3.0/src/fcbyk/web}/__init__.py +0 -0
  119. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/web/dist/assets/space-mono-latin-400-normal-Rg4St2Dn.woff2 +0 -0
  120. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/web/dist/assets/space-mono-latin-400-normal-_3DlpgIW.woff +0 -0
  121. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/web/dist/assets/space-mono-latin-ext-400-normal-D4cJI_B-.woff +0 -0
  122. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/web/dist/assets/space-mono-latin-ext-400-normal-DTLbW2xa.woff2 +0 -0
  123. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/web/dist/assets/space-mono-vietnamese-400-normal-B0PMp_xB.woff +0 -0
  124. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/web/dist/assets/space-mono-vietnamese-400-normal-BNOj0Qhp.woff2 +0 -0
  125. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/web/dist/assets/syncopate-latin-700-normal-D6Fv_luC.woff2 +0 -0
  126. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/web/dist/assets/syncopate-latin-700-normal-ZVUETrF2.woff +0 -0
  127. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/web/dist/assets/syncopate-latin-ext-700-normal-DIzsNXDw.woff2 +0 -0
  128. {fcbyk_cli-0.2.2 → fcbyk_cli-0.3.0}/src/fcbyk/web/dist/assets/syncopate-latin-ext-700-normal-bvnP3szv.woff +0 -0
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Yoki
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Yoki
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.
@@ -1,18 +1,18 @@
1
- # Controls files included in the source distribution (sdist)
2
-
3
- # Ensure frontend build artifacts are included in sdist
4
- recursive-include src/fcbyk/web/dist *
5
-
6
- # Exclude Python bytecode caches
7
- global-exclude *.py[cod]
8
- global-exclude __pycache__/*
9
- global-exclude */__pycache__/*
10
-
11
- # Exclude common build/test caches and build outputs
12
- prune build
13
- prune dist
14
- prune .pytest_cache
15
- prune .mypy_cache
16
- prune .ruff_cache
17
- global-exclude *.egg-info/*
18
-
1
+ # Controls files included in the source distribution (sdist)
2
+
3
+ # Ensure frontend build artifacts are included in sdist
4
+ recursive-include src/fcbyk/web/dist *
5
+
6
+ # Exclude Python bytecode caches
7
+ global-exclude *.py[cod]
8
+ global-exclude __pycache__/*
9
+ global-exclude */__pycache__/*
10
+
11
+ # Exclude common build/test caches and build outputs
12
+ prune build
13
+ prune dist
14
+ prune .pytest_cache
15
+ prune .mypy_cache
16
+ prune .ruff_cache
17
+ global-exclude *.egg-info/*
18
+
@@ -1,103 +1,91 @@
1
- Metadata-Version: 2.4
2
- Name: fcbyk-cli
3
- Version: 0.2.2
4
- Summary: A CLI tool for fcbyk
5
- Author: fcbyk
6
- Author-email: 731240932@qq.com
7
- License: MIT
8
- Classifier: Development Status :: 3 - Alpha
9
- Classifier: Intended Audience :: Developers
10
- Classifier: License :: OSI Approved :: MIT License
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.6
13
- Classifier: Programming Language :: Python :: 3.7
14
- Classifier: Programming Language :: Python :: 3.8
15
- Classifier: Programming Language :: Python :: 3.9
16
- Classifier: Programming Language :: Python :: 3.10
17
- Classifier: Programming Language :: Python :: 3.11
18
- Classifier: Programming Language :: Python :: 3.12
19
- Classifier: Programming Language :: Python :: 3.13
20
- Requires-Python: >=3.6
21
- Description-Content-Type: text/markdown
22
- License-File: LICENSE
23
- Requires-Dist: click>=8; python_version >= "3.7"
24
- Requires-Dist: click<8.0; python_version < "3.7"
25
- Requires-Dist: rich>=10.0.0
26
- Requires-Dist: flask>=2.0; python_version >= "3.7"
27
- Requires-Dist: flask<2.1; python_version < "3.7"
28
- Requires-Dist: dataclasses; python_version < "3.7"
29
- Requires-Dist: flask-socketio==5.3.3
30
- Requires-Dist: python-socketio==5.9.0
31
- Requires-Dist: pyperclip<2.0.0,>=1.9.0
32
- Requires-Dist: importlib-metadata>=4.8.0; python_version < "3.8"
33
- Requires-Dist: requests>=2.28.0; python_version >= "3.7"
34
- Requires-Dist: requests>=2.27.0; python_version < "3.7"
35
- Requires-Dist: pyautogui<1.0.0,>=0.9.50
36
- Requires-Dist: psutil==5.8.0; python_version < "3.12"
37
- Requires-Dist: psutil>=5.9.0; python_version >= "3.12"
38
- Requires-Dist: waitress>=2.0.0
39
- Provides-Extra: test
40
- Requires-Dist: pytest<8.0.0,>=7.0.0; extra == "test"
41
- Requires-Dist: pytest-cov<5.0.0,>=4.0.0; extra == "test"
42
- Requires-Dist: beautifulsoup4<4.11.0,>=4.10.0; extra == "test"
43
- Provides-Extra: gui
44
- Requires-Dist: PySide6>=6.0.0; python_version >= "3.7" and extra == "gui"
45
- Requires-Dist: PyQt5<6; python_version < "3.7" and extra == "gui"
46
- Dynamic: license-file
47
-
48
- ![image](https://github.com/user-attachments/assets/655b2999-fd7a-4a63-bc54-c0297c16e0a8)
49
-
50
- [![PyPI](https://img.shields.io/pypi/v/fcbyk-cli.svg)](https://pypi.org/project/fcbyk-cli/)
51
- [![Tests](https://github.com/fcbyk/fcbyk-cli/actions/workflows/test.yml/badge.svg)](https://github.com/fcbyk/fcbyk-cli/actions/workflows/test.yml)
52
- [![codecov](https://codecov.io/gh/fcbyk/fcbyk-cli/branch/main/graph/badge.svg)](https://codecov.io/gh/fcbyk/fcbyk-cli)
53
- [![License](https://img.shields.io/github/license/fcbyk/fcbyk-cli.svg)](https://github.com/fcbyk/fcbyk-cli/blob/main/LICENSE)
54
-
55
- ## 子命令
56
-
57
- - `lansend`:在指定端口开启 `http服务器`,用于局域网内共享文件
58
- - `ai`:在控制台与 `ai` 聊天 (需自行配置`api-key`)
59
- - `pick`:随机抽取一个元素(可用于抽奖、随机选择等)
60
- - `slide`:同一局域网内,手机控制电脑PTT翻页
61
-
62
- ## 安装
63
-
64
- #### 使用 pip 安装
65
-
66
- ```bash
67
- pip install fcbyk-cli
68
- ```
69
-
70
- > GUI为可选依赖
71
-
72
- ```bash
73
- pip install fcbyk-cli[gui]
74
- ```
75
-
76
- #### 从源码安装(可按需调整代码)
77
-
78
- - 前端构建
79
- ```bash
80
- git clone https://github.com/fcbyk/fcbyk-cli.git
81
- cd web-ui
82
- npm install
83
- npm run build:flatten
84
- ```
85
-
86
- - 后端安装
87
- ```bash
88
- cd ..
89
- cd fcbyk-cli
90
- pip install -e .
91
- ```
92
-
93
- ## 查看帮助信息
94
-
95
- ```bash
96
- fcbyk --help
97
- fcbyk --version
98
- ```
99
-
100
- ## 系统要求
101
-
102
- - Python 3.6+
103
- - Windows
1
+ Metadata-Version: 2.4
2
+ Name: fcbyk-cli
3
+ Version: 0.3.0
4
+ Summary: A CLI tool for fcbyk
5
+ Author: fcbyk
6
+ Author-email: 731240932@qq.com
7
+ License: MIT
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.6
13
+ Classifier: Programming Language :: Python :: 3.7
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Requires-Python: >=3.6
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: click>=8; python_version >= "3.7"
24
+ Requires-Dist: click<8.0; python_version < "3.7"
25
+ Requires-Dist: rich>=10.0.0
26
+ Requires-Dist: flask>=2.0; python_version >= "3.7"
27
+ Requires-Dist: flask<2.1; python_version < "3.7"
28
+ Requires-Dist: dataclasses; python_version < "3.7"
29
+ Requires-Dist: flask-socketio==5.3.3
30
+ Requires-Dist: python-socketio==5.9.0
31
+ Requires-Dist: pyperclip<2.0.0,>=1.9.0
32
+ Requires-Dist: importlib-metadata>=4.8.0; python_version < "3.8"
33
+ Requires-Dist: requests>=2.28.0; python_version >= "3.7"
34
+ Requires-Dist: requests>=2.27.0; python_version < "3.7"
35
+ Requires-Dist: pyautogui<1.0.0,>=0.9.50
36
+ Requires-Dist: psutil==5.8.0; python_version < "3.12"
37
+ Requires-Dist: psutil>=5.9.0; python_version >= "3.12"
38
+ Requires-Dist: waitress>=2.0.0
39
+ Provides-Extra: dev
40
+ Requires-Dist: pytest<8.0.0,>=7.0.0; extra == "dev"
41
+ Requires-Dist: pytest-cov<5.0.0,>=4.0.0; extra == "dev"
42
+ Requires-Dist: beautifulsoup4<4.11.0,>=4.10.0; extra == "dev"
43
+ Requires-Dist: commitizen; extra == "dev"
44
+ Requires-Dist: build; extra == "dev"
45
+ Requires-Dist: twine; extra == "dev"
46
+ Dynamic: license-file
47
+
48
+ ## 简介
49
+
50
+ [![PyPI](https://img.shields.io/pypi/v/fcbyk-cli.svg)](https://pypi.org/project/fcbyk-cli/)
51
+ [![Tests](https://github.com/fcbyk/fcbyk-cli/actions/workflows/test.yml/badge.svg)](https://github.com/fcbyk/fcbyk-cli/actions/workflows/test.yml)
52
+ [![codecov](https://codecov.io/gh/fcbyk/fcbyk-cli/branch/main/graph/badge.svg)](https://codecov.io/gh/fcbyk/fcbyk-cli)
53
+ [![License](https://img.shields.io/github/license/fcbyk/fcbyk-cli.svg)](https://github.com/fcbyk/fcbyk-cli/blob/main/LICENSE)
54
+
55
+ **`fcbyk-cli`** 是一个轻量、实用的命令行工具集合,
56
+
57
+ 它用于通过终端快速完成一些 **零散但真实存在的需求**:
58
+ - 没有现成软件可用
59
+ - 或者已有软件过于臃肿、广告过多、不够轻量
60
+ - 又或者只是想用一条命令把事情做完
61
+
62
+ **`fcbyk-cli`** 的目标不是 “做一个大全”,
63
+ 而是用 **小而直接的工具**,解决当下遇到的问题。
64
+
65
+ 如果你有实际需求或好的想法,也欢迎提交 [**issue**](https://github.com/fcbyk/fcbyk-cli/issues) 一起讨论。
66
+
67
+ ## 已有功能 (子命令)
68
+
69
+ - [`lansend`](https://github.com/fcbyk/fcbyk-cli/blob/main/docs/LANSend.md):在指定端口开启 `http服务器`,用于局域网内共享文件
70
+ - [`ai`](https://github.com/fcbyk/fcbyk-cli/blob/main/docs/AI.md):在控制台与 `ai` 聊天 (需自行配置`api-key`)
71
+ - [`pick`](https://github.com/fcbyk/fcbyk-cli/blob/main/docs/Pick.md):随机抽取一个元素(可用于抽奖、随机选择等)
72
+ - [`slide`](https://github.com/fcbyk/fcbyk-cli/blob/main/docs/Slide.md):同一局域网内,手机控制电脑PTT翻页
73
+ - [`alias`](https://github.com/fcbyk/fcbyk-cli/blob/main/docs/Alias.md):为常用命令添加别名,方便快速执行
74
+ - [`run`](https://github.com/fcbyk/fcbyk-cli/blob/main/docs/Run.md):从 scripts.byk.json 文件中运行可重复使用的命令脚本
75
+ - [`get`](https://github.com/fcbyk/fcbyk-cli/blob/main/docs/Get.md):资源获取,支持下载和打开官网
76
+ - [`config`](https://github.com/fcbyk/fcbyk-cli/blob/main/docs/Config.md):查看数据目录、日志目录和配置文件路径
77
+ - [`svc`](https://github.com/fcbyk/fcbyk-cli/blob/main/docs/Svc.md):统一管理由各子命令启动的后台 Web 服务进程
78
+
79
+ ## 快速开始
80
+
81
+ - 使用 pip 安装
82
+
83
+ ```bash
84
+ pip install fcbyk-cli
85
+ ```
86
+
87
+ - 显示帮助信息
88
+
89
+ ```bash
90
+ fcbyk
91
+ ```
@@ -0,0 +1,44 @@
1
+ ## 简介
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/fcbyk-cli.svg)](https://pypi.org/project/fcbyk-cli/)
4
+ [![Tests](https://github.com/fcbyk/fcbyk-cli/actions/workflows/test.yml/badge.svg)](https://github.com/fcbyk/fcbyk-cli/actions/workflows/test.yml)
5
+ [![codecov](https://codecov.io/gh/fcbyk/fcbyk-cli/branch/main/graph/badge.svg)](https://codecov.io/gh/fcbyk/fcbyk-cli)
6
+ [![License](https://img.shields.io/github/license/fcbyk/fcbyk-cli.svg)](https://github.com/fcbyk/fcbyk-cli/blob/main/LICENSE)
7
+
8
+ **`fcbyk-cli`** 是一个轻量、实用的命令行工具集合,
9
+
10
+ 它用于通过终端快速完成一些 **零散但真实存在的需求**:
11
+ - 没有现成软件可用
12
+ - 或者已有软件过于臃肿、广告过多、不够轻量
13
+ - 又或者只是想用一条命令把事情做完
14
+
15
+ **`fcbyk-cli`** 的目标不是 “做一个大全”,
16
+ 而是用 **小而直接的工具**,解决当下遇到的问题。
17
+
18
+ 如果你有实际需求或好的想法,也欢迎提交 [**issue**](https://github.com/fcbyk/fcbyk-cli/issues) 一起讨论。
19
+
20
+ ## 已有功能 (子命令)
21
+
22
+ - [`lansend`](https://github.com/fcbyk/fcbyk-cli/blob/main/docs/LANSend.md):在指定端口开启 `http服务器`,用于局域网内共享文件
23
+ - [`ai`](https://github.com/fcbyk/fcbyk-cli/blob/main/docs/AI.md):在控制台与 `ai` 聊天 (需自行配置`api-key`)
24
+ - [`pick`](https://github.com/fcbyk/fcbyk-cli/blob/main/docs/Pick.md):随机抽取一个元素(可用于抽奖、随机选择等)
25
+ - [`slide`](https://github.com/fcbyk/fcbyk-cli/blob/main/docs/Slide.md):同一局域网内,手机控制电脑PTT翻页
26
+ - [`alias`](https://github.com/fcbyk/fcbyk-cli/blob/main/docs/Alias.md):为常用命令添加别名,方便快速执行
27
+ - [`run`](https://github.com/fcbyk/fcbyk-cli/blob/main/docs/Run.md):从 scripts.byk.json 文件中运行可重复使用的命令脚本
28
+ - [`get`](https://github.com/fcbyk/fcbyk-cli/blob/main/docs/Get.md):资源获取,支持下载和打开官网
29
+ - [`config`](https://github.com/fcbyk/fcbyk-cli/blob/main/docs/Config.md):查看数据目录、日志目录和配置文件路径
30
+ - [`svc`](https://github.com/fcbyk/fcbyk-cli/blob/main/docs/Svc.md):统一管理由各子命令启动的后台 Web 服务进程
31
+
32
+ ## 快速开始
33
+
34
+ - 使用 pip 安装
35
+
36
+ ```bash
37
+ pip install fcbyk-cli
38
+ ```
39
+
40
+ - 显示帮助信息
41
+
42
+ ```bash
43
+ fcbyk
44
+ ```
@@ -0,0 +1,48 @@
1
+ [build-system]
2
+ requires = ["setuptools>=40", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [tool.pytest.ini_options]
6
+ testpaths = ["src/fcbyk/tests"]
7
+ python_files = ["test_*.py"]
8
+ addopts = "-v --cov=fcbyk --cov-report=term-missing"
9
+
10
+ [tool.commitizen]
11
+ name = "cz_customize"
12
+ version = "0.3.0"
13
+ tag_format = "v$version"
14
+ changelog_file = "CHANGELOG.md"
15
+ bump_message = "release: v$new_version"
16
+ version_files = [
17
+ "setup.cfg:version =",
18
+ "pyproject.toml:version ="
19
+ ]
20
+
21
+ [tool.commitizen.customize]
22
+ # 兼容历史emoji提交(emoji可选存在)
23
+ commit_parser = '^(?:✨|🐛|♻️|📝|🎨|⚡️|✅|🔧\s*)?(?P<change_type>feat|fix|refactor|docs|perf|test|style|chore)(?:\((?P<scope>[^\)]+)\))?:\s*(?P<message>.+)$'
24
+ changelog_pattern = '^(?:(?:✨|🐛|♻️|📝|🎨|⚡️|✅|🔧)\s*)?(feat|fix|refactor|docs|perf|test|style|chore)'
25
+ change_type_order = [
26
+ "feat",
27
+ "fix",
28
+ "refactor",
29
+ "docs",
30
+ "style",
31
+ "perf",
32
+ "test",
33
+ "chore"
34
+ ]
35
+
36
+ message_template = """
37
+ {{ change_type }}{% if scope %}({{ scope }}){% endif %}: {{ message }}
38
+ """
39
+
40
+ [tool.commitizen.customize.change_type_map]
41
+ feat = "Features"
42
+ fix = "Bug Fixes"
43
+ refactor = "Refactor"
44
+ docs = "Documentation"
45
+ style = "Styles"
46
+ perf = "Performance"
47
+ test = "Tests"
48
+ chore = "Chores"
@@ -1,75 +1,75 @@
1
- [metadata]
2
- name = fcbyk-cli
3
- version = 0.2.2
4
- description = A CLI tool for fcbyk
5
- long_description = file: README.md
6
- long_description_content_type = text/markdown
7
- author = fcbyk
8
- author_email = 731240932@qq.com
9
- license = MIT
10
- license_files = LICENSE
11
- classifiers =
12
- Development Status :: 3 - Alpha
13
- Intended Audience :: Developers
14
- License :: OSI Approved :: MIT License
15
- Programming Language :: Python :: 3
16
- Programming Language :: Python :: 3.6
17
- Programming Language :: Python :: 3.7
18
- Programming Language :: Python :: 3.8
19
- Programming Language :: Python :: 3.9
20
- Programming Language :: Python :: 3.10
21
- Programming Language :: Python :: 3.11
22
- Programming Language :: Python :: 3.12
23
- Programming Language :: Python :: 3.13
24
-
25
- [options]
26
- packages = find:
27
- package_dir =
28
- = src
29
- python_requires = >=3.6
30
- install_requires =
31
- click>=8; python_version>="3.7"
32
- click<8.0; python_version<"3.7"
33
- rich>=10.0.0
34
- flask>=2.0; python_version>="3.7"
35
- flask<2.1; python_version<"3.7"
36
- dataclasses; python_version < "3.7"
37
- flask-socketio==5.3.3
38
- python-socketio==5.9.0
39
- pyperclip>=1.9.0,<2.0.0
40
- importlib-metadata>=4.8.0; python_version < "3.8"
41
- requests>=2.28.0; python_version>="3.7"
42
- requests>=2.27.0; python_version<"3.7"
43
- pyautogui>=0.9.50,<1.0.0
44
- psutil==5.8.0 ; python_version < "3.12"
45
- psutil>=5.9.0 ; python_version >= "3.12"
46
- waitress>=2.0.0
47
-
48
- [options.extras_require]
49
- test =
50
- pytest>=7.0.0,<8.0.0
51
- pytest-cov>=4.0.0,<5.0.0
52
- beautifulsoup4>=4.10.0,<4.11.0
53
- gui =
54
- PySide6>=6.0.0; python_version >= "3.7"
55
- PyQt5<6; python_version < "3.7"
56
-
57
- [options.packages.find]
58
- where = src
59
- exclude =
60
- fcbyk.tests
61
- fcbyk.tests.*
62
-
63
- [options.entry_points]
64
- console_scripts =
65
- fcbyk = fcbyk.cli:cli
66
-
67
- [options.package_data]
68
- fcbyk =
69
- gui/assets/*
70
- web/dist/**/*
71
-
72
- [egg_info]
73
- tag_build =
74
- tag_date = 0
75
-
1
+ [metadata]
2
+ name = fcbyk-cli
3
+ version = 0.3.0
4
+ description = A CLI tool for fcbyk
5
+ long_description = file: README.md
6
+ long_description_content_type = text/markdown
7
+ author = fcbyk
8
+ author_email = 731240932@qq.com
9
+ license = MIT
10
+ license_files = LICENSE
11
+ classifiers =
12
+ Development Status :: 3 - Alpha
13
+ Intended Audience :: Developers
14
+ License :: OSI Approved :: MIT License
15
+ Programming Language :: Python :: 3
16
+ Programming Language :: Python :: 3.6
17
+ Programming Language :: Python :: 3.7
18
+ Programming Language :: Python :: 3.8
19
+ Programming Language :: Python :: 3.9
20
+ Programming Language :: Python :: 3.10
21
+ Programming Language :: Python :: 3.11
22
+ Programming Language :: Python :: 3.12
23
+ Programming Language :: Python :: 3.13
24
+
25
+ [options]
26
+ packages = find:
27
+ package_dir =
28
+ = src
29
+ python_requires = >=3.6
30
+ install_requires =
31
+ click>=8; python_version>="3.7"
32
+ click<8.0; python_version<"3.7"
33
+ rich>=10.0.0
34
+ flask>=2.0; python_version>="3.7"
35
+ flask<2.1; python_version<"3.7"
36
+ dataclasses; python_version < "3.7"
37
+ flask-socketio==5.3.3
38
+ python-socketio==5.9.0
39
+ pyperclip>=1.9.0,<2.0.0
40
+ importlib-metadata>=4.8.0; python_version < "3.8"
41
+ requests>=2.28.0; python_version>="3.7"
42
+ requests>=2.27.0; python_version<"3.7"
43
+ pyautogui>=0.9.50,<1.0.0
44
+ psutil==5.8.0 ; python_version < "3.12"
45
+ psutil>=5.9.0 ; python_version >= "3.12"
46
+ waitress>=2.0.0
47
+
48
+ [options.extras_require]
49
+ dev =
50
+ pytest>=7.0.0,<8.0.0
51
+ pytest-cov>=4.0.0,<5.0.0
52
+ beautifulsoup4>=4.10.0,<4.11.0
53
+ commitizen
54
+ build
55
+ twine
56
+
57
+ [options.packages.find]
58
+ where = src
59
+ exclude =
60
+ fcbyk.tests
61
+ fcbyk.tests.*
62
+
63
+ [options.entry_points]
64
+ console_scripts =
65
+ fcbyk = fcbyk.cli:main
66
+ byk = fcbyk.cli:main
67
+
68
+ [options.package_data]
69
+ fcbyk =
70
+ web/dist/**/*
71
+
72
+ [egg_info]
73
+ tag_build =
74
+ tag_date = 0
75
+
@@ -1,4 +1,4 @@
1
- from setuptools import setup
2
-
3
- # 依赖/元数据主要放在 setup.cfg;这里保留最小 setup.py 以兼容老的构建工具。
4
- setup()
1
+ from setuptools import setup
2
+
3
+ # 依赖/元数据主要放在 setup.cfg;这里保留最小 setup.py 以兼容老的构建工具。
4
+ setup()
@@ -1,46 +1,51 @@
1
- #!/usr/bin/env python3
2
- import click,random
3
-
4
- from fcbyk import commands
5
- from fcbyk.commands.alias import AliasedGroup
6
- from fcbyk.cli_support import (
7
- version_callback,
8
- print_aliases,
9
- add_gui_options,
10
- banner
11
- )
12
-
13
-
14
- @click.group(
15
- cls=AliasedGroup,
16
- context_settings=dict(
17
- help_option_names=['-h', '--help']
18
- ),
19
- invoke_without_command=True
20
- )
21
- @click.option(
22
- '--version', '-v',
23
- is_flag=True,
24
- callback=version_callback,
25
- expose_value=False,
26
- is_eager=True,
27
- help='Show version and exit.'
28
- )
29
- @add_gui_options
30
- @click.pass_context
31
- def cli(ctx):
32
- if ctx.invoked_subcommand is None:
33
- banner_text = random.choice(banner)
34
-
35
- click.secho(banner_text, fg="white", dim=True)
36
- click.echo(ctx.get_help()) # 帮助信息
37
- print_aliases() # 打印别名,如果有
38
-
39
-
40
- # 注册子命令
41
- for cmd_name in commands.__all__:
42
- cli.add_command(getattr(commands, cmd_name))
43
-
44
-
45
- if __name__ == "__main__":
46
- cli()
1
+ #!/usr/bin/env python3
2
+ import click, random, os
3
+ from fcbyk import commands, defaults
4
+ from fcbyk.utils import storage
5
+ from fcbyk.commands.alias import AliasedGroup
6
+ from fcbyk.cli_support import (
7
+ version_callback,
8
+ print_aliases,
9
+ print_commands,
10
+ banner
11
+ )
12
+
13
+
14
+ @click.group(
15
+ cls=AliasedGroup,
16
+ context_settings=dict(
17
+ help_option_names=['-h', '--help']
18
+ ),
19
+ invoke_without_command=True
20
+ )
21
+ @click.option(
22
+ '--version', '-v',
23
+ is_flag=True,
24
+ callback=version_callback,
25
+ expose_value=False,
26
+ is_eager=True,
27
+ help='Show version and exit.'
28
+ )
29
+ @click.pass_context
30
+ def main(ctx):
31
+ # 初始化默认配置
32
+ config_path = storage.get_path(defaults.CONFIG_FILE)
33
+ if not os.path.exists(config_path):
34
+ storage.save_json(config_path, defaults.DEFAULT_CONFIG)
35
+
36
+ if ctx.invoked_subcommand is None:
37
+ banner_text = random.choice(banner)
38
+
39
+ click.secho(banner_text, fg="white", dim=True)
40
+ click.echo(ctx.get_help()) # 帮助信息
41
+ print_aliases() # 打印别名,如果有
42
+ print_commands(leading_newline=False, merge_local=True) # 打印已存脚本,如果有
43
+
44
+
45
+ # 注册子命令
46
+ for cmd_name in commands.__all__:
47
+ main.add_command(getattr(commands, cmd_name))
48
+
49
+
50
+ if __name__ == "__main__":
51
+ main()
@@ -0,0 +1,11 @@
1
+ """CLI 支持模块"""
2
+
3
+ from .callbacks import (
4
+ version_callback,
5
+ print_aliases,
6
+ print_commands
7
+ )
8
+
9
+ from .helpers import banner
10
+
11
+ __all__ = ['version_callback', 'print_aliases', 'banner', 'print_commands']