machineconfig 4.96__py3-none-any.whl → 4.97__py3-none-any.whl
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.
Potentially problematic release.
This version of machineconfig might be problematic. Click here for more details.
- machineconfig/jobs/installer/custom/gh.py +2 -15
- machineconfig/jobs/installer/custom_dev/alacritty.py +41 -26
- machineconfig/jobs/installer/custom_dev/brave.py +42 -28
- machineconfig/jobs/installer/custom_dev/bypass_paywall.py +30 -19
- machineconfig/jobs/installer/custom_dev/code.py +29 -20
- machineconfig/jobs/installer/custom_dev/espanso.py +64 -41
- machineconfig/jobs/installer/custom_dev/goes.py +41 -36
- machineconfig/jobs/installer/custom_dev/lvim.py +49 -33
- machineconfig/jobs/installer/custom_dev/nerdfont.py +71 -47
- machineconfig/jobs/installer/custom_dev/nerfont_windows_helper.py +25 -10
- machineconfig/jobs/installer/custom_dev/redis.py +51 -33
- machineconfig/jobs/installer/installer_data.json +17 -0
- machineconfig/jobs/installer/package_groups.py +271 -102
- machineconfig/jobs/python/python_cargo_build_share.py +0 -1
- machineconfig/jobs/python/python_ve_symlink.py +23 -15
- machineconfig/jobs/python/vscode/api.py +16 -8
- machineconfig/jobs/python/vscode/sync_code.py +42 -27
- machineconfig/scripts/python/cloud_repo_sync.py +8 -4
- machineconfig/scripts/python/devops_devapps_install.py +34 -26
- machineconfig/scripts/python/helpers/repo_sync_helpers.py +4 -2
- machineconfig/scripts/python/interactive.py +24 -23
- machineconfig/scripts/python/mount_nfs.py +3 -6
- machineconfig/scripts/python/mount_ssh.py +3 -4
- machineconfig/scripts/python/sessions.py +10 -9
- machineconfig/scripts/python/start_slidev.py +14 -4
- machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py +36 -22
- machineconfig/utils/code.py +11 -2
- machineconfig/utils/installer.py +15 -9
- machineconfig/utils/path_extended.py +49 -7
- machineconfig/utils/ssh.py +22 -12
- machineconfig/utils/terminal.py +66 -92
- {machineconfig-4.96.dist-info → machineconfig-4.97.dist-info}/METADATA +1 -1
- {machineconfig-4.96.dist-info → machineconfig-4.97.dist-info}/RECORD +36 -36
- {machineconfig-4.96.dist-info → machineconfig-4.97.dist-info}/WHEEL +0 -0
- {machineconfig-4.96.dist-info → machineconfig-4.97.dist-info}/entry_points.txt +0 -0
- {machineconfig-4.96.dist-info → machineconfig-4.97.dist-info}/top_level.txt +0 -0
|
@@ -1,157 +1,326 @@
|
|
|
1
1
|
from typing import Literal, TypeAlias, Union
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"Visual Studio Code",
|
|
3
|
+
# AI/LLM Tools - AI-powered coding and chat assistants
|
|
4
|
+
PACKAGES_AI_TOOLS = [
|
|
6
5
|
"aider",
|
|
7
6
|
"github-copilot-cli",
|
|
8
7
|
"gemini",
|
|
9
8
|
"crush",
|
|
10
9
|
"opencode-ai",
|
|
11
|
-
"
|
|
10
|
+
"ollama",
|
|
11
|
+
"chatgpt",
|
|
12
|
+
"mods",
|
|
12
13
|
"q",
|
|
13
14
|
"cursor-cli",
|
|
14
15
|
"droid",
|
|
16
|
+
"auggie",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
# Tunneling/Port Forwarding - Tools for exposing local services
|
|
20
|
+
PACKAGES_TUNNELING = [
|
|
21
|
+
"ngrok",
|
|
22
|
+
"devtunnel",
|
|
23
|
+
"cloudflared",
|
|
24
|
+
"forward-cli",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
# Terminal Emulators & Shells - Terminal applications, emulators, and shell environments
|
|
28
|
+
PACKAGES_TERMINAL_EMULATORS = [
|
|
15
29
|
"Alacritty",
|
|
30
|
+
"Wezterm",
|
|
31
|
+
"warp",
|
|
32
|
+
"vtm",
|
|
33
|
+
"edex-ui",
|
|
34
|
+
"extraterm",
|
|
35
|
+
"nushell",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
# Browsers - Web browsers and terminal browsers
|
|
39
|
+
PACKAGES_BROWSERS = [
|
|
16
40
|
"Brave",
|
|
17
41
|
"bypass-paywalls-chrome",
|
|
18
|
-
"Cursor",
|
|
19
|
-
"espanso",
|
|
20
|
-
"Gorilla",
|
|
21
|
-
"lvim",
|
|
22
|
-
"nerdfont",
|
|
23
|
-
"Redis",
|
|
24
|
-
"Wezterm",
|
|
25
|
-
"winget",
|
|
26
|
-
"ytui-music",
|
|
27
|
-
"youtube-tui",
|
|
28
|
-
"termusic",
|
|
29
|
-
"kronos",
|
|
30
|
-
"transmission",
|
|
31
|
-
"nnn",
|
|
32
|
-
"exa",
|
|
33
|
-
"bytehound",
|
|
34
|
-
"atuin",
|
|
35
42
|
"browsh",
|
|
36
43
|
"carbonyl",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
# Code Editors & IDEs - Code editing tools
|
|
47
|
+
PACKAGES_CODE_EDITORS = [
|
|
48
|
+
"Visual Studio Code",
|
|
49
|
+
"Cursor",
|
|
50
|
+
"lvim",
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
# Presentation & Text UI Tools - Markdown viewers, presentations, prompts, and text decoration
|
|
54
|
+
PACKAGES_PRESENTATION = [
|
|
37
55
|
"patat",
|
|
56
|
+
"marp",
|
|
57
|
+
"presenterm",
|
|
58
|
+
"glow",
|
|
59
|
+
"gum",
|
|
60
|
+
"boxes",
|
|
61
|
+
"hx",
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
# Database Tools - Database clients and visualizers
|
|
65
|
+
PACKAGES_DATABASE = [
|
|
38
66
|
"SqliteBrowser",
|
|
39
67
|
"DBeaver",
|
|
40
68
|
"rainfrog",
|
|
41
69
|
"duckdb",
|
|
42
|
-
|
|
43
|
-
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
# Documentation & Conversion - Document conversion, diagram tools, and fast file operations
|
|
73
|
+
PACKAGES_DOC_CONVERSION = [
|
|
44
74
|
"mermaid-cli",
|
|
45
75
|
"html2markdown",
|
|
46
|
-
"xcrawl3r",
|
|
47
|
-
"obsidian",
|
|
48
|
-
"marp",
|
|
49
|
-
"presenterm",
|
|
50
76
|
"pandoc",
|
|
51
|
-
"
|
|
52
|
-
"
|
|
77
|
+
"cpz",
|
|
78
|
+
"rmz",
|
|
79
|
+
]
|
|
80
|
+
|
|
81
|
+
# Media & Entertainment - Music players and media tools
|
|
82
|
+
PACKAGES_MEDIA = [
|
|
83
|
+
"ytui-music",
|
|
84
|
+
"youtube-tui",
|
|
85
|
+
"termusic",
|
|
86
|
+
"kronos",
|
|
53
87
|
"OBS Background removal",
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"ipinfo",
|
|
59
|
-
"dust",
|
|
60
|
-
"ots",
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
# File Sharing & Cloud - File sharing, transfer, backup, sync, and QR tools
|
|
91
|
+
PACKAGES_FILE_SHARING = [
|
|
61
92
|
"ffsend",
|
|
62
93
|
"portal",
|
|
63
94
|
"qrcp",
|
|
64
|
-
"qrscan",
|
|
65
95
|
"termscp",
|
|
66
|
-
"qr",
|
|
67
96
|
"filebrowser",
|
|
68
|
-
"
|
|
97
|
+
"qr",
|
|
98
|
+
"qrscan",
|
|
99
|
+
"sharewifi",
|
|
100
|
+
"share-wifi",
|
|
101
|
+
"easy-sharing",
|
|
102
|
+
"ezshare",
|
|
69
103
|
"restic",
|
|
70
104
|
"syncthing",
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
105
|
+
"cloudreve",
|
|
106
|
+
]
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
# Git & Docker Tools - Version control and container utilities
|
|
110
|
+
PACKAGES_GIT_DOCKER_TOOLS = [
|
|
76
111
|
"lazygit",
|
|
77
|
-
"lazydocker",
|
|
78
112
|
"onefetch",
|
|
79
113
|
"gitcs",
|
|
80
|
-
"
|
|
114
|
+
"lazydocker",
|
|
115
|
+
]
|
|
116
|
+
|
|
117
|
+
# Development Tools - Various development utilities
|
|
118
|
+
PACKAGES_DEV_UTILS = [
|
|
119
|
+
"devcontainer",
|
|
120
|
+
"rust-analyzer",
|
|
121
|
+
"evcxr",
|
|
122
|
+
"geckodriver",
|
|
123
|
+
"hyperfine",
|
|
124
|
+
]
|
|
125
|
+
|
|
126
|
+
# Code Analysis, Git & Docs - Code analysis, statistics, documentation, and Git tools
|
|
127
|
+
PACKAGES_CODE_ANALYSIS = [
|
|
128
|
+
"kondo",
|
|
129
|
+
"tokei",
|
|
81
130
|
"navi",
|
|
82
131
|
"tealdeer",
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
"
|
|
91
|
-
"
|
|
132
|
+
"gitui",
|
|
133
|
+
"delta",
|
|
134
|
+
"gh",
|
|
135
|
+
]
|
|
136
|
+
|
|
137
|
+
# Productivity & Utilities - Productivity tools, security, remote access, and terminal enhancements
|
|
138
|
+
PACKAGES_PRODUCTIVITY = [
|
|
139
|
+
"espanso",
|
|
140
|
+
"bitwarden",
|
|
141
|
+
"openpomodoro-cli",
|
|
142
|
+
"just",
|
|
143
|
+
"rustdesk",
|
|
144
|
+
"ots",
|
|
92
145
|
"lolcatjs",
|
|
93
146
|
"figlet-cli",
|
|
94
|
-
"sharewifi",
|
|
95
|
-
"share-wifi",
|
|
96
147
|
]
|
|
97
148
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
149
|
+
# Miscellaneous Tools - Other tools
|
|
150
|
+
PACKAGES_MISC_DEV = [
|
|
151
|
+
"Gorilla",
|
|
152
|
+
"nerdfont",
|
|
153
|
+
"Redis",
|
|
154
|
+
"winget",
|
|
155
|
+
"transmission",
|
|
156
|
+
"exa",
|
|
157
|
+
"bytehound",
|
|
158
|
+
"atuin",
|
|
159
|
+
"xcrawl3r",
|
|
160
|
+
"obsidian",
|
|
161
|
+
"istio",
|
|
162
|
+
"cointop",
|
|
163
|
+
"nnn",
|
|
164
|
+
]
|
|
165
|
+
|
|
166
|
+
# Main DEV package list - combines all subgroups
|
|
167
|
+
PACKAGES_NAMES_DEV = [
|
|
168
|
+
*PACKAGES_AI_TOOLS,
|
|
169
|
+
*PACKAGES_TUNNELING,
|
|
170
|
+
*PACKAGES_TERMINAL_EMULATORS,
|
|
171
|
+
*PACKAGES_BROWSERS,
|
|
172
|
+
*PACKAGES_CODE_EDITORS,
|
|
173
|
+
*PACKAGES_PRESENTATION,
|
|
174
|
+
*PACKAGES_DATABASE,
|
|
175
|
+
*PACKAGES_DOC_CONVERSION,
|
|
176
|
+
*PACKAGES_MEDIA,
|
|
177
|
+
*PACKAGES_FILE_SHARING,
|
|
178
|
+
*PACKAGES_GIT_DOCKER_TOOLS,
|
|
179
|
+
*PACKAGES_DEV_UTILS,
|
|
180
|
+
*PACKAGES_CODE_ANALYSIS,
|
|
181
|
+
*PACKAGES_PRODUCTIVITY,
|
|
182
|
+
*PACKAGES_MISC_DEV,
|
|
183
|
+
]
|
|
184
|
+
|
|
185
|
+
# System & Network Monitoring - System resource monitors, process viewers, network analysis, and system info tools
|
|
186
|
+
PACKAGES_SYSTEM_MONITORS = [
|
|
105
187
|
"btop",
|
|
106
|
-
"gotty",
|
|
107
|
-
"joshuto",
|
|
108
|
-
"zellij",
|
|
109
|
-
"boxes",
|
|
110
|
-
"ugrep",
|
|
111
|
-
"zoomit",
|
|
112
|
-
"ntop",
|
|
113
|
-
"devtunnel",
|
|
114
|
-
"bat",
|
|
115
|
-
"broot",
|
|
116
188
|
"btm",
|
|
117
|
-
"
|
|
118
|
-
"
|
|
189
|
+
"ntop",
|
|
190
|
+
"procs",
|
|
191
|
+
"bandwhich",
|
|
192
|
+
"ipinfo",
|
|
193
|
+
"sniffnet",
|
|
119
194
|
"cpufetch",
|
|
120
|
-
"delta",
|
|
121
|
-
"dua",
|
|
122
195
|
"fastfetch",
|
|
123
|
-
"
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
196
|
+
"topgrade",
|
|
197
|
+
]
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
# File Tools - File browsing, navigation, listing, directory jumping, and disk usage analysis
|
|
201
|
+
PACKAGES_FILE_TOOLS = [
|
|
202
|
+
"xplr",
|
|
203
|
+
"joshuto",
|
|
128
204
|
"lf",
|
|
205
|
+
"tere",
|
|
206
|
+
"yazi",
|
|
129
207
|
"lsd",
|
|
130
|
-
"
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
208
|
+
"zoxide",
|
|
209
|
+
"diskonaut",
|
|
210
|
+
"dua",
|
|
211
|
+
"dust",
|
|
212
|
+
]
|
|
213
|
+
|
|
214
|
+
# File Viewers - File preview and viewing tools
|
|
215
|
+
PACKAGES_FILE_VIEWERS = [
|
|
216
|
+
"pistol",
|
|
217
|
+
"bat",
|
|
218
|
+
"viu",
|
|
219
|
+
]
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
# Search & Archive Tools - File and content search utilities, archive management
|
|
223
|
+
PACKAGES_SEARCH = [
|
|
224
|
+
"fd",
|
|
225
|
+
"fzf",
|
|
226
|
+
"broot",
|
|
137
227
|
"rg",
|
|
138
228
|
"rga",
|
|
229
|
+
"ugrep",
|
|
230
|
+
"ouch",
|
|
231
|
+
]
|
|
232
|
+
|
|
233
|
+
# Terminal & Shell Enhancements - Terminal multiplexers, shell history, and prompts
|
|
234
|
+
PACKAGES_TERMINAL_SHELL = [
|
|
235
|
+
"zellij",
|
|
236
|
+
"mprocs",
|
|
237
|
+
"mcfly",
|
|
139
238
|
"starship",
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
239
|
+
]
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
# Cloud & Utilities - Cloud storage, file watching, web terminal, and presentation tools
|
|
244
|
+
PACKAGES_CLOUD_UTILS = [
|
|
245
|
+
"rclone",
|
|
144
246
|
"watchexec",
|
|
145
|
-
"
|
|
146
|
-
"
|
|
247
|
+
"m365",
|
|
248
|
+
"zoomit",
|
|
249
|
+
"speedtest",
|
|
250
|
+
]
|
|
251
|
+
|
|
252
|
+
# Web Sharing - Share terminal over web
|
|
253
|
+
PACKAGES_WEB_TERMINAL = [
|
|
254
|
+
"gotty",
|
|
255
|
+
"ttyd",
|
|
147
256
|
]
|
|
148
257
|
|
|
149
|
-
|
|
258
|
+
|
|
259
|
+
# Main ESSENTIAL package list - combines all subgroups
|
|
260
|
+
PACKAGES_NAMES_ESSENTIAL = [
|
|
261
|
+
*PACKAGES_CODE_ANALYSIS,
|
|
262
|
+
*PACKAGES_PRESENTATION,
|
|
263
|
+
*PACKAGES_FILE_VIEWERS,
|
|
264
|
+
*PACKAGES_FILE_TOOLS,
|
|
265
|
+
*PACKAGES_SYSTEM_MONITORS,
|
|
266
|
+
*PACKAGES_WEB_TERMINAL,
|
|
267
|
+
*PACKAGES_TERMINAL_SHELL,
|
|
268
|
+
*PACKAGES_SEARCH,
|
|
269
|
+
*PACKAGES_AI_TOOLS,
|
|
270
|
+
*PACKAGES_CLOUD_UTILS,
|
|
271
|
+
]
|
|
272
|
+
|
|
273
|
+
PACKAGE_GROUPS: TypeAlias = Literal[
|
|
274
|
+
"ESSENTIAL",
|
|
275
|
+
"DEV",
|
|
276
|
+
"AI_TOOLS",
|
|
277
|
+
"TUNNELING",
|
|
278
|
+
"TERMINAL_EMULATORS",
|
|
279
|
+
"BROWSERS",
|
|
280
|
+
"CODE_EDITORS",
|
|
281
|
+
"PRESENTATION",
|
|
282
|
+
"DATABASE",
|
|
283
|
+
"DOC_CONVERSION",
|
|
284
|
+
"MEDIA",
|
|
285
|
+
"FILE_SHARING",
|
|
286
|
+
"GIT_DOCKER_TOOLS",
|
|
287
|
+
"DEV_UTILS",
|
|
288
|
+
"CODE_ANALYSIS",
|
|
289
|
+
"PRODUCTIVITY",
|
|
290
|
+
"MISC_DEV",
|
|
291
|
+
"SYSTEM_MONITORS",
|
|
292
|
+
"FILE_TOOLS",
|
|
293
|
+
"FILE_VIEWERS",
|
|
294
|
+
"SEARCH",
|
|
295
|
+
"TERMINAL_SHELL",
|
|
296
|
+
"CLOUD_UTILS",
|
|
297
|
+
"WEB_TERMINAL",
|
|
298
|
+
]
|
|
150
299
|
PACKAGE_GROUP2NAMES: dict[PACKAGE_GROUPS, list[str]] = {
|
|
151
|
-
"ESSENTIAL":
|
|
152
|
-
"DEV":
|
|
153
|
-
"
|
|
154
|
-
"
|
|
300
|
+
"ESSENTIAL": PACKAGES_NAMES_ESSENTIAL,
|
|
301
|
+
"DEV": PACKAGES_NAMES_DEV,
|
|
302
|
+
"AI_TOOLS": PACKAGES_AI_TOOLS,
|
|
303
|
+
"TUNNELING": PACKAGES_TUNNELING,
|
|
304
|
+
"TERMINAL_EMULATORS": PACKAGES_TERMINAL_EMULATORS,
|
|
305
|
+
"BROWSERS": PACKAGES_BROWSERS,
|
|
306
|
+
"CODE_EDITORS": PACKAGES_CODE_EDITORS,
|
|
307
|
+
"PRESENTATION": PACKAGES_PRESENTATION,
|
|
308
|
+
"DATABASE": PACKAGES_DATABASE,
|
|
309
|
+
"DOC_CONVERSION": PACKAGES_DOC_CONVERSION,
|
|
310
|
+
"MEDIA": PACKAGES_MEDIA,
|
|
311
|
+
"FILE_SHARING": PACKAGES_FILE_SHARING,
|
|
312
|
+
"GIT_DOCKER_TOOLS": PACKAGES_GIT_DOCKER_TOOLS,
|
|
313
|
+
"DEV_UTILS": PACKAGES_DEV_UTILS,
|
|
314
|
+
"CODE_ANALYSIS": PACKAGES_CODE_ANALYSIS,
|
|
315
|
+
"PRODUCTIVITY": PACKAGES_PRODUCTIVITY,
|
|
316
|
+
"MISC_DEV": PACKAGES_MISC_DEV,
|
|
317
|
+
"SYSTEM_MONITORS": PACKAGES_SYSTEM_MONITORS,
|
|
318
|
+
"FILE_TOOLS": PACKAGES_FILE_TOOLS,
|
|
319
|
+
"FILE_VIEWERS": PACKAGES_FILE_VIEWERS,
|
|
320
|
+
"SEARCH": PACKAGES_SEARCH,
|
|
321
|
+
"TERMINAL_SHELL": PACKAGES_TERMINAL_SHELL,
|
|
322
|
+
"CLOUD_UTILS": PACKAGES_CLOUD_UTILS,
|
|
323
|
+
"WEB_TERMINAL": PACKAGES_WEB_TERMINAL,
|
|
155
324
|
}
|
|
156
325
|
|
|
157
|
-
_ = Union
|
|
326
|
+
_ = Union, Literal
|
|
@@ -1,28 +1,36 @@
|
|
|
1
1
|
"""Symlinks"""
|
|
2
2
|
|
|
3
|
+
from rich import box
|
|
4
|
+
from rich.console import Console
|
|
5
|
+
from rich.panel import Panel
|
|
6
|
+
|
|
3
7
|
from machineconfig.utils.path_extended import PathExtended as PathExtended
|
|
4
|
-
# from machineconfig.utils.utils import choose_from_options
|
|
5
8
|
|
|
6
9
|
|
|
7
|
-
def main():
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
""
|
|
10
|
+
def main() -> None:
|
|
11
|
+
console = Console()
|
|
12
|
+
console.print(
|
|
13
|
+
Panel.fit(
|
|
14
|
+
"\n".join(["Create symlinks for virtual environments"]),
|
|
15
|
+
title="🔗 Symlink Creator",
|
|
16
|
+
border_style="cyan",
|
|
17
|
+
box=box.ROUNDED,
|
|
18
|
+
)
|
|
19
|
+
)
|
|
13
20
|
target = PathExtended(input("🎯 Symlink to which target? ")).expanduser().absolute()
|
|
14
21
|
source = input(f"📍 Symlink from which source? [default to: CWD/{target.name}] ") or PathExtended.cwd().joinpath(target.name)
|
|
15
22
|
if isinstance(source, str):
|
|
16
23
|
source = PathExtended(source).expanduser().absolute()
|
|
17
24
|
source.symlink_to(target, overwrite=True)
|
|
18
|
-
print(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
console.print(
|
|
26
|
+
Panel.fit(
|
|
27
|
+
"\n".join([f"📍 Source: {source}", f"🎯 Target: {target}"]),
|
|
28
|
+
title="✅ Symlink Created",
|
|
29
|
+
border_style="green",
|
|
30
|
+
box=box.ROUNDED,
|
|
31
|
+
)
|
|
32
|
+
)
|
|
33
|
+
console.print("🔗 Finished creating symlink.", style="bold cyan")
|
|
26
34
|
|
|
27
35
|
|
|
28
36
|
if __name__ == "__main__":
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
|
-
from machineconfig.utils.accessories import randstr
|
|
3
2
|
from typing import Annotated
|
|
3
|
+
|
|
4
4
|
import typer
|
|
5
|
+
from rich import box
|
|
6
|
+
from rich.console import Console
|
|
7
|
+
from rich.panel import Panel
|
|
8
|
+
from rich.syntax import Syntax
|
|
9
|
+
|
|
10
|
+
from machineconfig.utils.accessories import randstr
|
|
5
11
|
|
|
6
12
|
|
|
7
13
|
def open_file_in_new_instance(file_path: str):
|
|
@@ -19,14 +25,16 @@ ln -s {repo_path} {copy_path}
|
|
|
19
25
|
cd {copy_path}
|
|
20
26
|
code --profile bitProfile --new-window {file_path}
|
|
21
27
|
"""
|
|
22
|
-
from rich.console import Console
|
|
23
|
-
from rich.syntax import Syntax
|
|
24
|
-
from rich.panel import Panel
|
|
25
|
-
|
|
26
28
|
console = Console()
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
panel = Panel(
|
|
30
|
+
Syntax(code, lexer="bash"),
|
|
31
|
+
title="🔍 VS CODE API | Opening file in new instance",
|
|
32
|
+
subtitle=f"📂 {file_path}",
|
|
33
|
+
border_style="bright_blue",
|
|
34
|
+
box=box.DOUBLE,
|
|
35
|
+
padding=(1, 2),
|
|
36
|
+
)
|
|
37
|
+
console.print(panel)
|
|
30
38
|
|
|
31
39
|
code_path = Path.home().joinpath(".config", "machingconfig", "vscode_api", "code_temp")
|
|
32
40
|
code_path.parent.mkdir(parents=True, exist_ok=True)
|
|
@@ -1,58 +1,73 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
2
|
from configparser import SectionProxy
|
|
3
|
+
from rich import box
|
|
4
|
+
from rich.console import Console
|
|
5
|
+
from rich.panel import Panel
|
|
6
|
+
from rich.syntax import Syntax
|
|
3
7
|
from machineconfig.utils.io import read_ini
|
|
4
8
|
|
|
5
9
|
config = read_ini(Path.home().joinpath(".ssh", "config"))
|
|
6
10
|
|
|
7
11
|
|
|
8
|
-
def sync_remote(machine_name: str):
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
🖥️ Target machine: {machine_name}
|
|
13
|
-
|
|
14
|
-
""
|
|
12
|
+
def sync_remote(machine_name: str) -> None:
|
|
13
|
+
console = Console()
|
|
14
|
+
console.print(
|
|
15
|
+
Panel.fit(
|
|
16
|
+
"\n".join([f"🖥️ Target machine: {machine_name}"]),
|
|
17
|
+
title="🔄 Sync Remote",
|
|
18
|
+
border_style="cyan",
|
|
19
|
+
box=box.ROUNDED,
|
|
20
|
+
)
|
|
21
|
+
)
|
|
15
22
|
|
|
16
|
-
# Handle config as a ConfigParser object
|
|
17
23
|
machine_config: SectionProxy | None = None
|
|
18
24
|
if machine_name in config:
|
|
19
25
|
machine_config = config[machine_name]
|
|
20
26
|
|
|
21
27
|
if machine_config is None:
|
|
22
28
|
error_msg = f"Machine {machine_name} not found in SSH config."
|
|
23
|
-
print(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
""
|
|
29
|
+
console.print(
|
|
30
|
+
Panel.fit(
|
|
31
|
+
"\n".join([error_msg]),
|
|
32
|
+
title="❌ Error",
|
|
33
|
+
subtitle="⚠️ Unknown target machine",
|
|
34
|
+
border_style="red",
|
|
35
|
+
box=box.ROUNDED,
|
|
36
|
+
)
|
|
37
|
+
)
|
|
28
38
|
raise ValueError(error_msg)
|
|
29
39
|
|
|
30
40
|
code = f"""
|
|
31
41
|
ssh -o "HostName={machine_config["HostName"]}" -o "User={machine_config["User"]}" -o "ProxyCommand=cloudflared access ssh --hostname %h" -o "Port={machine_config["Port"]}" -o "RequestTTY=yes" -o "RemoteCommand=devops --which update; bash" {machine_name}
|
|
32
42
|
"""
|
|
33
|
-
from rich.console import Console
|
|
34
|
-
from rich.syntax import Syntax
|
|
35
|
-
from rich.panel import Panel
|
|
36
43
|
|
|
37
|
-
|
|
38
|
-
console.print(
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
syntax = Syntax(code, "bash", line_numbers=False, word_wrap=True)
|
|
45
|
+
console.print(
|
|
46
|
+
Panel(
|
|
47
|
+
syntax,
|
|
48
|
+
title=f"🔄 Sync Command | {machine_name}",
|
|
49
|
+
subtitle=f"🌐 Host: {machine_config['HostName']}",
|
|
50
|
+
border_style="blue",
|
|
51
|
+
box=box.ROUNDED,
|
|
52
|
+
)
|
|
53
|
+
)
|
|
41
54
|
|
|
42
55
|
code_path = Path.home().joinpath(".config", "machingconfig", "vscode_api", "code_temp")
|
|
43
56
|
code_path.parent.mkdir(parents=True, exist_ok=True)
|
|
44
57
|
code_path.write_text(code, encoding="utf-8")
|
|
45
58
|
code_path.chmod(0o755)
|
|
46
59
|
|
|
47
|
-
print(f"🚀 Executing sync command for {machine_name}...")
|
|
60
|
+
console.print(f"🚀 Executing sync command for {machine_name}...", style="bold yellow")
|
|
48
61
|
|
|
49
62
|
import subprocess
|
|
50
63
|
|
|
51
64
|
subprocess.run([str(code_path)], shell=True, check=True)
|
|
52
65
|
|
|
53
|
-
print(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
66
|
+
console.print(
|
|
67
|
+
Panel.fit(
|
|
68
|
+
"\n".join([f"🖥️ Machine: {machine_name}"]),
|
|
69
|
+
title="✅ Sync Completed",
|
|
70
|
+
border_style="green",
|
|
71
|
+
box=box.ROUNDED,
|
|
72
|
+
)
|
|
73
|
+
)
|
|
@@ -4,13 +4,14 @@ from pathlib import Path
|
|
|
4
4
|
import git
|
|
5
5
|
from machineconfig.utils.io import read_ini
|
|
6
6
|
from machineconfig.utils.path_extended import PathExtended as PathExtended
|
|
7
|
-
from machineconfig.utils.terminal import
|
|
7
|
+
from machineconfig.utils.terminal import Response
|
|
8
8
|
|
|
9
9
|
from machineconfig.scripts.python.helpers.repo_sync_helpers import fetch_dotfiles
|
|
10
10
|
from machineconfig.utils.source_of_truth import CONFIG_PATH, DEFAULTS_PATH
|
|
11
11
|
from machineconfig.utils.options import choose_from_options
|
|
12
12
|
from machineconfig.utils.code import get_shell_file_executing_python_script, write_shell_script_to_file
|
|
13
13
|
import platform
|
|
14
|
+
import subprocess
|
|
14
15
|
from typing import Optional, Literal
|
|
15
16
|
from rich.console import Console
|
|
16
17
|
from rich.panel import Panel
|
|
@@ -73,7 +74,12 @@ git pull originEnc master
|
|
|
73
74
|
"""
|
|
74
75
|
|
|
75
76
|
shell_path = write_shell_script_to_file(shell_script=script)
|
|
76
|
-
|
|
77
|
+
command = f". {shell_path}"
|
|
78
|
+
if platform.system() == "Windows":
|
|
79
|
+
completed = subprocess.run(["powershell", "-Command", command], capture_output=True, check=False, text=True)
|
|
80
|
+
else:
|
|
81
|
+
completed = subprocess.run(command, shell=True, capture_output=True, check=False, text=True)
|
|
82
|
+
res = Response.from_completed_process(completed).capture().print()
|
|
77
83
|
|
|
78
84
|
if res.is_successful(strict_err=True, strict_returcode=True):
|
|
79
85
|
console.print(Panel("✅ Pull succeeded!\n🧹 Removing originEnc remote and local copy\n📤 Pushing merged repository to cloud storage", title="Success", border_style="green"))
|
|
@@ -161,8 +167,6 @@ git commit -am "finished merging"
|
|
|
161
167
|
case _:
|
|
162
168
|
raise ValueError(f"Unknown action: {action}")
|
|
163
169
|
# PROGRAM_PATH.write_text(program_content, encoding="utf-8")
|
|
164
|
-
import subprocess
|
|
165
|
-
|
|
166
170
|
subprocess.run(program_content, shell=True, check=True)
|
|
167
171
|
|
|
168
172
|
return program_content
|