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.

Files changed (36) hide show
  1. machineconfig/jobs/installer/custom/gh.py +2 -15
  2. machineconfig/jobs/installer/custom_dev/alacritty.py +41 -26
  3. machineconfig/jobs/installer/custom_dev/brave.py +42 -28
  4. machineconfig/jobs/installer/custom_dev/bypass_paywall.py +30 -19
  5. machineconfig/jobs/installer/custom_dev/code.py +29 -20
  6. machineconfig/jobs/installer/custom_dev/espanso.py +64 -41
  7. machineconfig/jobs/installer/custom_dev/goes.py +41 -36
  8. machineconfig/jobs/installer/custom_dev/lvim.py +49 -33
  9. machineconfig/jobs/installer/custom_dev/nerdfont.py +71 -47
  10. machineconfig/jobs/installer/custom_dev/nerfont_windows_helper.py +25 -10
  11. machineconfig/jobs/installer/custom_dev/redis.py +51 -33
  12. machineconfig/jobs/installer/installer_data.json +17 -0
  13. machineconfig/jobs/installer/package_groups.py +271 -102
  14. machineconfig/jobs/python/python_cargo_build_share.py +0 -1
  15. machineconfig/jobs/python/python_ve_symlink.py +23 -15
  16. machineconfig/jobs/python/vscode/api.py +16 -8
  17. machineconfig/jobs/python/vscode/sync_code.py +42 -27
  18. machineconfig/scripts/python/cloud_repo_sync.py +8 -4
  19. machineconfig/scripts/python/devops_devapps_install.py +34 -26
  20. machineconfig/scripts/python/helpers/repo_sync_helpers.py +4 -2
  21. machineconfig/scripts/python/interactive.py +24 -23
  22. machineconfig/scripts/python/mount_nfs.py +3 -6
  23. machineconfig/scripts/python/mount_ssh.py +3 -4
  24. machineconfig/scripts/python/sessions.py +10 -9
  25. machineconfig/scripts/python/start_slidev.py +14 -4
  26. machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py +36 -22
  27. machineconfig/utils/code.py +11 -2
  28. machineconfig/utils/installer.py +15 -9
  29. machineconfig/utils/path_extended.py +49 -7
  30. machineconfig/utils/ssh.py +22 -12
  31. machineconfig/utils/terminal.py +66 -92
  32. {machineconfig-4.96.dist-info → machineconfig-4.97.dist-info}/METADATA +1 -1
  33. {machineconfig-4.96.dist-info → machineconfig-4.97.dist-info}/RECORD +36 -36
  34. {machineconfig-4.96.dist-info → machineconfig-4.97.dist-info}/WHEEL +0 -0
  35. {machineconfig-4.96.dist-info → machineconfig-4.97.dist-info}/entry_points.txt +0 -0
  36. {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
- PACKAGES_NAMES_DEV = Literal[
4
- "ngrok",
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
- "warp",
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
- "cpz",
43
- "rmz",
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
- "devcontainer",
52
- "bitwarden",
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
- "rustdesk",
55
- "evcxr",
56
- "forward-cli",
57
- "bandwhich",
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
- "cloudreve",
97
+ "qr",
98
+ "qrscan",
99
+ "sharewifi",
100
+ "share-wifi",
101
+ "easy-sharing",
102
+ "ezshare",
69
103
  "restic",
70
104
  "syncthing",
71
- "istio",
72
- "openpomodoro-cli",
73
- "rust-analyzer",
74
- "kondo",
75
- "tokei",
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
- "just",
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
- "sniffnet",
84
- "hyperfine",
85
- "ollama",
86
- "cointop",
87
- "vtm",
88
- "edex-ui",
89
- "extraterm",
90
- "nushell",
91
- "geckodriver",
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
- PACKAGES_NAMES_ESSENTIAL = Literal[
99
- "gh",
100
- "hx",
101
- "speedtest",
102
- "pistol",
103
- "diskonaut",
104
- "xplr",
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
- "chatgpt",
118
- "cloudflared",
189
+ "ntop",
190
+ "procs",
191
+ "bandwhich",
192
+ "ipinfo",
193
+ "sniffnet",
119
194
  "cpufetch",
120
- "delta",
121
- "dua",
122
195
  "fastfetch",
123
- "fd",
124
- "fzf",
125
- "gitui",
126
- "glow",
127
- "gum",
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
- "m365",
131
- "mcfly",
132
- "mods",
133
- "mprocs",
134
- "ouch",
135
- "procs",
136
- "rclone",
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
- "tere",
141
- "topgrade",
142
- "ttyd",
143
- "viu",
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
- "yazi",
146
- "zoxide",
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
- PACKAGE_GROUPS: TypeAlias = Literal["ESSENTIAL", "DEV", "ESSENTIAL_SYSTEM", "DEV_SYSTEM"]
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": list(PACKAGES_NAMES_ESSENTIAL.__args__),
152
- "DEV": list(PACKAGES_NAMES_DEV.__args__),
153
- "ESSENTIAL_SYSTEM": [],
154
- "DEV_SYSTEM": [],
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
@@ -2,7 +2,6 @@
2
2
  cargo install
3
3
  """
4
4
 
5
- # from machineconfig.utils.terminal import Terminal
6
5
  # from machineconfig.utils.path_reduced import P as PathExtended
7
6
  # import platform
8
7
 
@@ -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
- print(f"""
9
- {"=" * 150}
10
- 🔗 SYMLINK CREATOR | Create symlinks for virtual environments
11
- {"=" * 150}
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(f"""
19
- {"=" * 150}
20
- SUCCESS | Symlink created successfully
21
- 📍 Source: {source}
22
- 🎯 Target: {target}
23
- {"=" * 150}
24
- """)
25
- print("🔗 Finished creating symlink.")
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
- console.print(f"\n{'=' * 150}")
28
- console.print(Panel(Syntax(code, lexer="bash"), title="🔍 VS CODE API | Opening file in new instance", subtitle=f"📂 {file_path}"), style="bold blue")
29
- console.print(f"{'=' * 150}\n")
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
- print(f"""
10
- {"=" * 150}
11
- 🔄 SYNC REMOTE | Initiating remote code synchronization
12
- 🖥️ Target machine: {machine_name}
13
- {"=" * 150}
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(f"""
24
- {"⚠️" * 20}
25
- ❌ ERROR | {error_msg}
26
- {"⚠️" * 20}
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
- console = Console()
38
- console.print(f"\n{'=' * 150}")
39
- console.print(Panel(Syntax(code, lexer="bash"), title=f"🔄 SYNC COMMAND | Connecting to {machine_name}", subtitle=f"🌐 Host: {machine_config['HostName']}"), style="bold blue")
40
- console.print(f"{'=' * 150}\n")
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(f"""
54
- {"=" * 150}
55
- SUCCESS | Remote sync completed successfully
56
- 🖥️ Machine: {machine_name}
57
- {"=" * 150}
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 Terminal
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
- res = Terminal().run(f". {shell_path}", shell="powershell").capture().print()
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