machineconfig 4.96__py3-none-any.whl → 4.98__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 +18 -1
- machineconfig/jobs/installer/package_groups.py +272 -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.py +1 -1
- machineconfig/scripts/python/helpers/repo_sync_helpers.py +4 -2
- machineconfig/scripts/python/interactive.py +25 -24
- 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/share_terminal.py +1 -1
- 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/{scripts/python/devops_devapps_install.py → utils/installer_utils/installer.py} +36 -29
- machineconfig/utils/path_extended.py +51 -7
- machineconfig/utils/ssh.py +22 -12
- machineconfig/utils/terminal.py +66 -92
- {machineconfig-4.96.dist-info → machineconfig-4.98.dist-info}/METADATA +1 -1
- {machineconfig-4.96.dist-info → machineconfig-4.98.dist-info}/RECORD +38 -38
- {machineconfig-4.96.dist-info → machineconfig-4.98.dist-info}/WHEEL +0 -0
- {machineconfig-4.96.dist-info → machineconfig-4.98.dist-info}/entry_points.txt +0 -0
- {machineconfig-4.96.dist-info → machineconfig-4.98.dist-info}/top_level.txt +0 -0
|
@@ -1,157 +1,327 @@
|
|
|
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
|
+
# NOTE: Entries must match the corresponding `appName` in installer_data.json for filtering to work.
|
|
48
|
+
PACKAGES_CODE_EDITORS = [
|
|
49
|
+
"code",
|
|
50
|
+
"Cursor",
|
|
51
|
+
"lvim",
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
# Presentation & Text UI Tools - Markdown viewers, presentations, prompts, and text decoration
|
|
55
|
+
PACKAGES_PRESENTATION = [
|
|
37
56
|
"patat",
|
|
57
|
+
"marp",
|
|
58
|
+
"presenterm",
|
|
59
|
+
"glow",
|
|
60
|
+
"gum",
|
|
61
|
+
"boxes",
|
|
62
|
+
"hx",
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
# Database Tools - Database clients and visualizers
|
|
66
|
+
PACKAGES_DATABASE = [
|
|
38
67
|
"SqliteBrowser",
|
|
39
68
|
"DBeaver",
|
|
40
69
|
"rainfrog",
|
|
41
70
|
"duckdb",
|
|
42
|
-
|
|
43
|
-
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
# Documentation & Conversion - Document conversion, diagram tools, and fast file operations
|
|
74
|
+
PACKAGES_DOC_CONVERSION = [
|
|
44
75
|
"mermaid-cli",
|
|
45
76
|
"html2markdown",
|
|
46
|
-
"xcrawl3r",
|
|
47
|
-
"obsidian",
|
|
48
|
-
"marp",
|
|
49
|
-
"presenterm",
|
|
50
77
|
"pandoc",
|
|
51
|
-
"
|
|
52
|
-
"
|
|
78
|
+
"cpz",
|
|
79
|
+
"rmz",
|
|
80
|
+
]
|
|
81
|
+
|
|
82
|
+
# Media & Entertainment - Music players and media tools
|
|
83
|
+
PACKAGES_MEDIA = [
|
|
84
|
+
"ytui-music",
|
|
85
|
+
"youtube-tui",
|
|
86
|
+
"termusic",
|
|
87
|
+
"kronos",
|
|
53
88
|
"OBS Background removal",
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"ipinfo",
|
|
59
|
-
"dust",
|
|
60
|
-
"ots",
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
# File Sharing & Cloud - File sharing, transfer, backup, sync, and QR tools
|
|
92
|
+
PACKAGES_FILE_SHARING = [
|
|
61
93
|
"ffsend",
|
|
62
94
|
"portal",
|
|
63
95
|
"qrcp",
|
|
64
|
-
"qrscan",
|
|
65
96
|
"termscp",
|
|
66
|
-
"qr",
|
|
67
97
|
"filebrowser",
|
|
68
|
-
"
|
|
98
|
+
"qr",
|
|
99
|
+
"qrscan",
|
|
100
|
+
"sharewifi",
|
|
101
|
+
"share-wifi",
|
|
102
|
+
"easy-sharing",
|
|
103
|
+
"ezshare",
|
|
69
104
|
"restic",
|
|
70
105
|
"syncthing",
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
106
|
+
"cloudreve",
|
|
107
|
+
]
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
# Git & Docker Tools - Version control and container utilities
|
|
111
|
+
PACKAGES_GIT_DOCKER_TOOLS = [
|
|
76
112
|
"lazygit",
|
|
77
|
-
"lazydocker",
|
|
78
113
|
"onefetch",
|
|
79
114
|
"gitcs",
|
|
80
|
-
"
|
|
115
|
+
"lazydocker",
|
|
116
|
+
]
|
|
117
|
+
|
|
118
|
+
# Development Tools - Various development utilities
|
|
119
|
+
PACKAGES_DEV_UTILS = [
|
|
120
|
+
"devcontainer",
|
|
121
|
+
"rust-analyzer",
|
|
122
|
+
"evcxr",
|
|
123
|
+
"geckodriver",
|
|
124
|
+
"hyperfine",
|
|
125
|
+
]
|
|
126
|
+
|
|
127
|
+
# Code Analysis, Git & Docs - Code analysis, statistics, documentation, and Git tools
|
|
128
|
+
PACKAGES_CODE_ANALYSIS = [
|
|
129
|
+
"kondo",
|
|
130
|
+
"tokei",
|
|
81
131
|
"navi",
|
|
82
132
|
"tealdeer",
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
"
|
|
91
|
-
"
|
|
133
|
+
"gitui",
|
|
134
|
+
"delta",
|
|
135
|
+
"gh",
|
|
136
|
+
]
|
|
137
|
+
|
|
138
|
+
# Productivity & Utilities - Productivity tools, security, remote access, and terminal enhancements
|
|
139
|
+
PACKAGES_PRODUCTIVITY = [
|
|
140
|
+
"espanso",
|
|
141
|
+
"bitwarden",
|
|
142
|
+
"openpomodoro-cli",
|
|
143
|
+
"just",
|
|
144
|
+
"rustdesk",
|
|
145
|
+
"ots",
|
|
92
146
|
"lolcatjs",
|
|
93
147
|
"figlet-cli",
|
|
94
|
-
"sharewifi",
|
|
95
|
-
"share-wifi",
|
|
96
148
|
]
|
|
97
149
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
150
|
+
# Miscellaneous Tools - Other tools
|
|
151
|
+
PACKAGES_MISC_DEV = [
|
|
152
|
+
"Gorilla",
|
|
153
|
+
"nerdfont",
|
|
154
|
+
"Redis",
|
|
155
|
+
"winget",
|
|
156
|
+
"transmission",
|
|
157
|
+
"exa",
|
|
158
|
+
"bytehound",
|
|
159
|
+
"atuin",
|
|
160
|
+
"xcrawl3r",
|
|
161
|
+
"obsidian",
|
|
162
|
+
"istio",
|
|
163
|
+
"cointop",
|
|
164
|
+
"nnn",
|
|
165
|
+
]
|
|
166
|
+
|
|
167
|
+
# Main DEV package list - combines all subgroups
|
|
168
|
+
PACKAGES_NAMES_DEV = [
|
|
169
|
+
*PACKAGES_AI_TOOLS,
|
|
170
|
+
*PACKAGES_TUNNELING,
|
|
171
|
+
*PACKAGES_TERMINAL_EMULATORS,
|
|
172
|
+
*PACKAGES_BROWSERS,
|
|
173
|
+
*PACKAGES_CODE_EDITORS,
|
|
174
|
+
*PACKAGES_PRESENTATION,
|
|
175
|
+
*PACKAGES_DATABASE,
|
|
176
|
+
*PACKAGES_DOC_CONVERSION,
|
|
177
|
+
*PACKAGES_MEDIA,
|
|
178
|
+
*PACKAGES_FILE_SHARING,
|
|
179
|
+
*PACKAGES_GIT_DOCKER_TOOLS,
|
|
180
|
+
*PACKAGES_DEV_UTILS,
|
|
181
|
+
*PACKAGES_CODE_ANALYSIS,
|
|
182
|
+
*PACKAGES_PRODUCTIVITY,
|
|
183
|
+
*PACKAGES_MISC_DEV,
|
|
184
|
+
]
|
|
185
|
+
|
|
186
|
+
# System & Network Monitoring - System resource monitors, process viewers, network analysis, and system info tools
|
|
187
|
+
PACKAGES_SYSTEM_MONITORS = [
|
|
105
188
|
"btop",
|
|
106
|
-
"gotty",
|
|
107
|
-
"joshuto",
|
|
108
|
-
"zellij",
|
|
109
|
-
"boxes",
|
|
110
|
-
"ugrep",
|
|
111
|
-
"zoomit",
|
|
112
|
-
"ntop",
|
|
113
|
-
"devtunnel",
|
|
114
|
-
"bat",
|
|
115
|
-
"broot",
|
|
116
189
|
"btm",
|
|
117
|
-
"
|
|
118
|
-
"
|
|
190
|
+
"ntop",
|
|
191
|
+
"procs",
|
|
192
|
+
"bandwhich",
|
|
193
|
+
"ipinfo",
|
|
194
|
+
"sniffnet",
|
|
119
195
|
"cpufetch",
|
|
120
|
-
"delta",
|
|
121
|
-
"dua",
|
|
122
196
|
"fastfetch",
|
|
123
|
-
"
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
197
|
+
"topgrade",
|
|
198
|
+
]
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
# File Tools - File browsing, navigation, listing, directory jumping, and disk usage analysis
|
|
202
|
+
PACKAGES_FILE_TOOLS = [
|
|
203
|
+
"xplr",
|
|
204
|
+
"joshuto",
|
|
128
205
|
"lf",
|
|
206
|
+
"tere",
|
|
207
|
+
"yazi",
|
|
129
208
|
"lsd",
|
|
130
|
-
"
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
209
|
+
"zoxide",
|
|
210
|
+
"diskonaut",
|
|
211
|
+
"dua",
|
|
212
|
+
"dust",
|
|
213
|
+
]
|
|
214
|
+
|
|
215
|
+
# File Viewers - File preview and viewing tools
|
|
216
|
+
PACKAGES_FILE_VIEWERS = [
|
|
217
|
+
"pistol",
|
|
218
|
+
"bat",
|
|
219
|
+
"viu",
|
|
220
|
+
]
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
# Search & Archive Tools - File and content search utilities, archive management
|
|
224
|
+
PACKAGES_SEARCH = [
|
|
225
|
+
"fd",
|
|
226
|
+
"fzf",
|
|
227
|
+
"broot",
|
|
137
228
|
"rg",
|
|
138
229
|
"rga",
|
|
230
|
+
"ugrep",
|
|
231
|
+
"ouch",
|
|
232
|
+
]
|
|
233
|
+
|
|
234
|
+
# Terminal & Shell Enhancements - Terminal multiplexers, shell history, and prompts
|
|
235
|
+
PACKAGES_TERMINAL_SHELL = [
|
|
236
|
+
"zellij",
|
|
237
|
+
"mprocs",
|
|
238
|
+
"mcfly",
|
|
139
239
|
"starship",
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
240
|
+
]
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
# Cloud & Utilities - Cloud storage, file watching, web terminal, and presentation tools
|
|
245
|
+
PACKAGES_CLOUD_UTILS = [
|
|
246
|
+
"rclone",
|
|
144
247
|
"watchexec",
|
|
145
|
-
"
|
|
146
|
-
"
|
|
248
|
+
"m365",
|
|
249
|
+
"zoomit",
|
|
250
|
+
"speedtest",
|
|
251
|
+
]
|
|
252
|
+
|
|
253
|
+
# Web Sharing - Share terminal over web
|
|
254
|
+
PACKAGES_WEB_TERMINAL = [
|
|
255
|
+
"gotty",
|
|
256
|
+
"ttyd",
|
|
147
257
|
]
|
|
148
258
|
|
|
149
|
-
|
|
259
|
+
|
|
260
|
+
# Main ESSENTIAL package list - combines all subgroups
|
|
261
|
+
PACKAGES_NAMES_ESSENTIAL = [
|
|
262
|
+
*PACKAGES_CODE_ANALYSIS,
|
|
263
|
+
*PACKAGES_PRESENTATION,
|
|
264
|
+
*PACKAGES_FILE_VIEWERS,
|
|
265
|
+
*PACKAGES_FILE_TOOLS,
|
|
266
|
+
*PACKAGES_SYSTEM_MONITORS,
|
|
267
|
+
*PACKAGES_WEB_TERMINAL,
|
|
268
|
+
*PACKAGES_TERMINAL_SHELL,
|
|
269
|
+
*PACKAGES_SEARCH,
|
|
270
|
+
*PACKAGES_AI_TOOLS,
|
|
271
|
+
*PACKAGES_CLOUD_UTILS,
|
|
272
|
+
]
|
|
273
|
+
|
|
274
|
+
PACKAGE_GROUPS: TypeAlias = Literal[
|
|
275
|
+
"ESSENTIAL",
|
|
276
|
+
"DEV",
|
|
277
|
+
"AI_TOOLS",
|
|
278
|
+
"TUNNELING",
|
|
279
|
+
"TERMINAL_EMULATORS",
|
|
280
|
+
"BROWSERS",
|
|
281
|
+
"CODE_EDITORS",
|
|
282
|
+
"PRESENTATION",
|
|
283
|
+
"DATABASE",
|
|
284
|
+
"DOC_CONVERSION",
|
|
285
|
+
"MEDIA",
|
|
286
|
+
"FILE_SHARING",
|
|
287
|
+
"GIT_DOCKER_TOOLS",
|
|
288
|
+
"DEV_UTILS",
|
|
289
|
+
"CODE_ANALYSIS",
|
|
290
|
+
"PRODUCTIVITY",
|
|
291
|
+
"MISC_DEV",
|
|
292
|
+
"SYSTEM_MONITORS",
|
|
293
|
+
"FILE_TOOLS",
|
|
294
|
+
"FILE_VIEWERS",
|
|
295
|
+
"SEARCH",
|
|
296
|
+
"TERMINAL_SHELL",
|
|
297
|
+
"CLOUD_UTILS",
|
|
298
|
+
"WEB_TERMINAL",
|
|
299
|
+
]
|
|
150
300
|
PACKAGE_GROUP2NAMES: dict[PACKAGE_GROUPS, list[str]] = {
|
|
151
|
-
"ESSENTIAL":
|
|
152
|
-
"DEV":
|
|
153
|
-
"
|
|
154
|
-
"
|
|
301
|
+
"ESSENTIAL": PACKAGES_NAMES_ESSENTIAL,
|
|
302
|
+
"DEV": PACKAGES_NAMES_DEV,
|
|
303
|
+
"AI_TOOLS": PACKAGES_AI_TOOLS,
|
|
304
|
+
"TUNNELING": PACKAGES_TUNNELING,
|
|
305
|
+
"TERMINAL_EMULATORS": PACKAGES_TERMINAL_EMULATORS,
|
|
306
|
+
"BROWSERS": PACKAGES_BROWSERS,
|
|
307
|
+
"CODE_EDITORS": PACKAGES_CODE_EDITORS,
|
|
308
|
+
"PRESENTATION": PACKAGES_PRESENTATION,
|
|
309
|
+
"DATABASE": PACKAGES_DATABASE,
|
|
310
|
+
"DOC_CONVERSION": PACKAGES_DOC_CONVERSION,
|
|
311
|
+
"MEDIA": PACKAGES_MEDIA,
|
|
312
|
+
"FILE_SHARING": PACKAGES_FILE_SHARING,
|
|
313
|
+
"GIT_DOCKER_TOOLS": PACKAGES_GIT_DOCKER_TOOLS,
|
|
314
|
+
"DEV_UTILS": PACKAGES_DEV_UTILS,
|
|
315
|
+
"CODE_ANALYSIS": PACKAGES_CODE_ANALYSIS,
|
|
316
|
+
"PRODUCTIVITY": PACKAGES_PRODUCTIVITY,
|
|
317
|
+
"MISC_DEV": PACKAGES_MISC_DEV,
|
|
318
|
+
"SYSTEM_MONITORS": PACKAGES_SYSTEM_MONITORS,
|
|
319
|
+
"FILE_TOOLS": PACKAGES_FILE_TOOLS,
|
|
320
|
+
"FILE_VIEWERS": PACKAGES_FILE_VIEWERS,
|
|
321
|
+
"SEARCH": PACKAGES_SEARCH,
|
|
322
|
+
"TERMINAL_SHELL": PACKAGES_TERMINAL_SHELL,
|
|
323
|
+
"CLOUD_UTILS": PACKAGES_CLOUD_UTILS,
|
|
324
|
+
"WEB_TERMINAL": PACKAGES_WEB_TERMINAL,
|
|
155
325
|
}
|
|
156
326
|
|
|
157
|
-
_ = Union
|
|
327
|
+
_ = 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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""devops with emojis"""
|
|
2
2
|
|
|
3
|
-
import machineconfig.
|
|
3
|
+
import machineconfig.utils.installer_utils.installer as installer_entry_point
|
|
4
4
|
import machineconfig.scripts.python.share_terminal as share_terminal
|
|
5
5
|
import machineconfig.scripts.python.repos as repos
|
|
6
6
|
|