machineconfig 6.82__py3-none-any.whl → 7.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.
Files changed (294) hide show
  1. machineconfig/cluster/remote/cloud_manager.py +1 -1
  2. machineconfig/cluster/sessions_managers/utils/maker.py +25 -13
  3. machineconfig/cluster/sessions_managers/wt_local.py +16 -221
  4. machineconfig/cluster/sessions_managers/wt_local_manager.py +55 -193
  5. machineconfig/cluster/sessions_managers/wt_remote_manager.py +42 -198
  6. machineconfig/cluster/sessions_managers/wt_utils/manager_persistence.py +52 -0
  7. machineconfig/cluster/sessions_managers/wt_utils/monitoring_helpers.py +50 -0
  8. machineconfig/cluster/sessions_managers/wt_utils/status_reporting.py +76 -0
  9. machineconfig/cluster/sessions_managers/wt_utils/wt_helpers.py +199 -0
  10. machineconfig/cluster/sessions_managers/zellij_local_manager.py +3 -1
  11. machineconfig/cluster/sessions_managers/zellij_remote_manager.py +3 -2
  12. machineconfig/cluster/sessions_managers/zellij_utils/process_monitor.py +2 -2
  13. machineconfig/jobs/installer/custom/boxes.py +2 -2
  14. machineconfig/jobs/installer/custom/hx.py +75 -18
  15. machineconfig/jobs/installer/custom/yazi.py +119 -0
  16. machineconfig/jobs/installer/custom_dev/brave.py +5 -3
  17. machineconfig/jobs/installer/custom_dev/cloudflare_warp_cli.py +23 -0
  18. machineconfig/jobs/installer/custom_dev/code.py +4 -1
  19. machineconfig/jobs/installer/custom_dev/dubdb_adbc.py +1 -1
  20. machineconfig/jobs/installer/custom_dev/nerdfont.py +1 -1
  21. machineconfig/jobs/installer/custom_dev/nerfont_windows_helper.py +27 -22
  22. machineconfig/jobs/installer/custom_dev/sysabc.py +139 -0
  23. machineconfig/jobs/installer/custom_dev/wezterm.py +2 -19
  24. machineconfig/jobs/installer/custom_dev/winget.py +10 -14
  25. machineconfig/jobs/installer/installer_data.json +1287 -216
  26. machineconfig/jobs/installer/linux_scripts/q.sh +10 -7
  27. machineconfig/jobs/installer/linux_scripts/redis.sh +1 -0
  28. machineconfig/jobs/installer/package_groups.py +58 -89
  29. machineconfig/jobs/installer/powershell_scripts/install_fonts.ps1 +129 -34
  30. machineconfig/logger.py +0 -1
  31. machineconfig/profile/create_helper.py +43 -16
  32. machineconfig/profile/create_links.py +2 -1
  33. machineconfig/profile/create_links_export.py +64 -18
  34. machineconfig/profile/create_shell_profile.py +78 -127
  35. machineconfig/profile/mapper.toml +15 -8
  36. machineconfig/scripts/__init__.py +0 -4
  37. machineconfig/scripts/linux/wrap_mcfg +46 -0
  38. machineconfig/scripts/nu/wrap_mcfg.nu +69 -0
  39. machineconfig/scripts/python/agents.py +52 -37
  40. machineconfig/scripts/python/ai/initai.py +1 -1
  41. machineconfig/scripts/python/ai/scripts/command_runner.ps1 +33 -0
  42. machineconfig/scripts/python/ai/{command_runner → scripts}/command_runner.sh +1 -1
  43. machineconfig/scripts/python/ai/solutions/copilot/{chatmodes/Thinking-Beast-Mode.chatmode.md → agents/Thinking-Beast-Mode.agent.md} +0 -1
  44. machineconfig/scripts/python/ai/solutions/copilot/{chatmodes/Ultimate-Transparent-Thinking-Beast-Mode.chatmode.md → agents/Ultimate-Transparent-Thinking-Beast-Mode.agent.md} +0 -1
  45. machineconfig/scripts/python/ai/solutions/copilot/{chatmodes/deepResearch.chatmode.md → agents/deepResearch.agent.md} +2 -2
  46. machineconfig/scripts/python/ai/solutions/copilot/github_copilot.py +5 -5
  47. machineconfig/scripts/python/ai/solutions/copilot/instructions/python/dev.instructions.md +4 -0
  48. machineconfig/scripts/python/ai/solutions/copilot/instructions/python/watch_exec.prompt.md +20 -0
  49. machineconfig/scripts/python/ai/solutions/generic.py +1 -1
  50. machineconfig/scripts/python/ai/{generate_files.py → utils/generate_files.py} +2 -2
  51. machineconfig/scripts/python/ai/{vscode_tasks.py → utils/vscode_tasks.py} +7 -2
  52. machineconfig/scripts/python/croshell.py +77 -78
  53. machineconfig/scripts/python/devops.py +39 -21
  54. machineconfig/scripts/python/devops_navigator.py +0 -4
  55. machineconfig/scripts/python/env_manager/env_manager_tui.py +204 -0
  56. machineconfig/scripts/python/env_manager/path_manager_tui.py +1 -1
  57. machineconfig/scripts/python/fire_jobs.py +84 -115
  58. machineconfig/scripts/python/ftpx.py +42 -16
  59. machineconfig/scripts/python/helpers/ast_search.py +74 -0
  60. machineconfig/scripts/python/helpers/qr_code.py +166 -0
  61. machineconfig/scripts/python/helpers/repo_rag.py +325 -0
  62. machineconfig/scripts/python/helpers/run_py_script.py +79 -0
  63. machineconfig/scripts/python/helpers/symantic_search.py +25 -0
  64. machineconfig/scripts/python/helpers/tmp_py_scripts/a.py +26 -0
  65. machineconfig/scripts/python/{helpers_fire → helpers_agents}/agentic_frameworks/fire_crush.json +1 -1
  66. machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_crush.py +39 -0
  67. machineconfig/scripts/python/{helpers_fire → helpers_agents}/agentic_frameworks/fire_cursor_agents.py +3 -4
  68. machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_gemini.py +55 -0
  69. machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_qwen.py +30 -0
  70. machineconfig/scripts/python/{helpers_fire → helpers_agents}/fire_agents_help_launch.py +32 -13
  71. machineconfig/scripts/python/{helpers_fire → helpers_agents}/fire_agents_helper_types.py +11 -14
  72. machineconfig/scripts/python/helpers_agents/templates/prompt.txt +10 -0
  73. machineconfig/scripts/python/helpers_agents/templates/template.sh +32 -0
  74. machineconfig/scripts/python/helpers_cloud/cloud_copy.py +28 -21
  75. machineconfig/scripts/python/helpers_cloud/cloud_helpers.py +1 -1
  76. machineconfig/scripts/python/helpers_cloud/cloud_mount.py +19 -17
  77. machineconfig/scripts/python/helpers_cloud/cloud_sync.py +8 -7
  78. machineconfig/scripts/python/helpers_croshell/crosh.py +3 -3
  79. machineconfig/scripts/python/helpers_croshell/start_slidev.py +6 -7
  80. machineconfig/scripts/python/helpers_devops/cli_config.py +46 -61
  81. machineconfig/scripts/python/helpers_devops/cli_config_dotfile.py +67 -55
  82. machineconfig/scripts/python/helpers_devops/cli_nw.py +157 -16
  83. machineconfig/scripts/python/helpers_devops/cli_repos.py +55 -21
  84. machineconfig/scripts/python/helpers_devops/cli_self.py +98 -48
  85. machineconfig/scripts/python/helpers_devops/cli_share_file.py +137 -0
  86. machineconfig/scripts/python/helpers_devops/cli_share_server.py +80 -42
  87. machineconfig/scripts/python/helpers_devops/{cli_terminal.py → cli_share_terminal.py} +15 -17
  88. machineconfig/scripts/python/helpers_devops/cli_utils.py +3 -128
  89. machineconfig/scripts/python/helpers_devops/devops_backup_retrieve.py +4 -4
  90. machineconfig/scripts/python/helpers_devops/devops_status.py +7 -19
  91. machineconfig/scripts/python/helpers_devops/themes/choose_wezterm_theme.py +1 -1
  92. machineconfig/scripts/python/{helpers_fire/helpers4.py → helpers_fire_command/file_wrangler.py} +56 -20
  93. machineconfig/scripts/python/helpers_fire_command/fire_jobs_route_helper.py +26 -16
  94. machineconfig/scripts/python/helpers_msearch/__init__.py +5 -0
  95. machineconfig/scripts/{linux → python/helpers_msearch/scripts_linux}/fzfg +3 -3
  96. machineconfig/scripts/python/helpers_msearch/scripts_windows/fzfg.ps1 +59 -0
  97. machineconfig/scripts/python/helpers_navigator/command_tree.py +50 -18
  98. machineconfig/scripts/python/helpers_network/address.py +132 -0
  99. machineconfig/scripts/python/{nw → helpers_network}/devops_add_ssh_key.py +24 -5
  100. machineconfig/scripts/python/{nw → helpers_network}/mount_nfs +0 -1
  101. machineconfig/scripts/python/{nw → helpers_network}/mount_nfs.py +2 -2
  102. machineconfig/scripts/python/{nw → helpers_network}/mount_ssh.py +1 -1
  103. machineconfig/scripts/python/{nw → helpers_network}/ssh_debug_linux.py +7 -7
  104. machineconfig/scripts/python/{nw → helpers_network}/ssh_debug_windows.py +4 -4
  105. machineconfig/scripts/python/{nw → helpers_network}/wifi_conn.py +1 -53
  106. machineconfig/scripts/python/{nw → helpers_network}/wsl_windows_transfer.py +3 -2
  107. machineconfig/scripts/python/helpers_repos/clone.py +0 -1
  108. machineconfig/scripts/python/helpers_repos/cloud_repo_sync.py +46 -19
  109. machineconfig/scripts/python/helpers_repos/entrypoint.py +2 -1
  110. machineconfig/scripts/python/helpers_repos/grource.py +1 -1
  111. machineconfig/scripts/python/helpers_repos/record.py +2 -1
  112. machineconfig/scripts/python/helpers_repos/repo_analyzer_1.py +160 -0
  113. machineconfig/scripts/python/helpers_repos/{count_lines.py → repo_analyzer_2.py} +113 -192
  114. machineconfig/scripts/python/helpers_sessions/sessions_multiprocess.py +20 -13
  115. machineconfig/scripts/python/helpers_utils/download.py +150 -0
  116. machineconfig/scripts/python/helpers_utils/path.py +185 -0
  117. machineconfig/scripts/python/interactive.py +19 -26
  118. machineconfig/scripts/python/{mcfg.py → mcfg_entry.py} +10 -0
  119. machineconfig/scripts/python/msearch.py +71 -0
  120. machineconfig/scripts/python/sessions.py +94 -25
  121. machineconfig/scripts/python/terminal.py +133 -0
  122. machineconfig/scripts/python/utils.py +28 -30
  123. machineconfig/scripts/windows/mounts/mount_ssh.ps1 +1 -1
  124. machineconfig/scripts/windows/wrap_mcfg.ps1 +63 -0
  125. machineconfig/settings/broot/conf.toml +1 -1
  126. machineconfig/settings/helix/config.toml +16 -0
  127. machineconfig/settings/helix/languages.toml +13 -4
  128. machineconfig/settings/helix/yazi-picker.sh +12 -0
  129. machineconfig/settings/lf/linux/exe/lfcd.sh +1 -0
  130. machineconfig/settings/lf/linux/exe/previewer.sh +3 -2
  131. machineconfig/settings/lf/windows/lfcd.ps1 +1 -1
  132. machineconfig/settings/lf/windows/lfrc +14 -16
  133. machineconfig/settings/marimo/marimo.toml +1 -1
  134. machineconfig/settings/marimo/snippets/globalize.py +34 -0
  135. machineconfig/settings/shells/bash/init.sh +43 -11
  136. machineconfig/settings/shells/ipy/profiles/default/startup/playext.py +1 -1
  137. machineconfig/settings/shells/nushell/config.nu +2 -32
  138. machineconfig/settings/shells/nushell/env.nu +45 -6
  139. machineconfig/settings/shells/nushell/init.nu +314 -0
  140. machineconfig/settings/shells/pwsh/init.ps1 +40 -14
  141. machineconfig/settings/shells/starship/starship.toml +16 -0
  142. machineconfig/settings/shells/wezterm/wezterm.lua +2 -0
  143. machineconfig/settings/shells/wt/settings.json +14 -5
  144. machineconfig/settings/shells/zsh/init.sh +17 -19
  145. machineconfig/settings/television/cable_unix/alias.toml +8 -0
  146. machineconfig/settings/television/cable_unix/aws-buckets.toml +14 -0
  147. machineconfig/settings/television/cable_unix/aws-instances.toml +13 -0
  148. machineconfig/settings/television/cable_unix/bash-history.toml +8 -0
  149. machineconfig/settings/television/cable_unix/channels.toml +19 -0
  150. machineconfig/settings/television/cable_unix/dirs.toml +13 -0
  151. machineconfig/settings/television/cable_unix/distrobox-list.toml +42 -0
  152. machineconfig/settings/television/cable_unix/docker-images.toml +13 -0
  153. machineconfig/settings/television/cable_unix/dotfiles.toml +11 -0
  154. machineconfig/settings/television/cable_unix/env.toml +17 -0
  155. machineconfig/settings/television/cable_unix/files.toml +11 -0
  156. machineconfig/settings/television/cable_unix/fish-history.toml +8 -0
  157. machineconfig/settings/television/cable_unix/git-branch.toml +11 -0
  158. machineconfig/settings/television/cable_unix/git-diff.toml +10 -0
  159. machineconfig/settings/television/cable_unix/git-log.toml +12 -0
  160. machineconfig/settings/television/cable_unix/git-reflog.toml +12 -0
  161. machineconfig/settings/television/cable_unix/git-repos.toml +16 -0
  162. machineconfig/settings/television/cable_unix/guix.toml +20 -0
  163. machineconfig/settings/television/cable_unix/just-recipes.toml +18 -0
  164. machineconfig/settings/television/cable_unix/k8s-deployments.toml +36 -0
  165. machineconfig/settings/television/cable_unix/k8s-pods.toml +50 -0
  166. machineconfig/settings/television/cable_unix/k8s-services.toml +36 -0
  167. machineconfig/settings/television/cable_unix/man-pages.toml +24 -0
  168. machineconfig/settings/television/cable_unix/nu-history.toml +7 -0
  169. machineconfig/settings/television/cable_unix/procs.toml +20 -0
  170. machineconfig/settings/television/cable_unix/text.toml +17 -0
  171. machineconfig/settings/television/cable_unix/tldr.toml +18 -0
  172. machineconfig/settings/television/cable_unix/zsh-history.toml +9 -0
  173. machineconfig/settings/television/cable_windows/alias.toml +7 -0
  174. machineconfig/settings/television/cable_windows/dirs.toml +13 -0
  175. machineconfig/settings/television/cable_windows/docker-images.toml +13 -0
  176. machineconfig/settings/television/cable_windows/dotfiles.toml +11 -0
  177. machineconfig/settings/television/cable_windows/env.toml +17 -0
  178. machineconfig/settings/television/cable_windows/files.toml +14 -0
  179. machineconfig/settings/television/cable_windows/git-branch.toml +11 -0
  180. machineconfig/settings/television/cable_windows/git-diff.toml +10 -0
  181. machineconfig/settings/television/cable_windows/git-log.toml +11 -0
  182. machineconfig/settings/television/cable_windows/git-reflog.toml +11 -0
  183. machineconfig/settings/television/cable_windows/git-repos.toml +15 -0
  184. machineconfig/settings/television/cable_windows/nu-history.toml +7 -0
  185. machineconfig/settings/television/cable_windows/pwsh-history.toml +6 -0
  186. machineconfig/settings/television/cable_windows/text.toml +17 -0
  187. machineconfig/settings/yazi/init.lua +61 -0
  188. machineconfig/settings/yazi/keymap_linux.toml +94 -0
  189. machineconfig/settings/yazi/keymap_windows.toml +78 -0
  190. machineconfig/settings/yazi/shell/yazi_cd.ps1 +33 -0
  191. machineconfig/settings/yazi/shell/yazi_cd.sh +8 -0
  192. machineconfig/settings/yazi/theme.toml +4 -0
  193. machineconfig/settings/yazi/yazi_linux.toml +84 -0
  194. machineconfig/settings/yazi/yazi_windows.toml +58 -0
  195. machineconfig/setup_linux/__init__.py +2 -1
  196. machineconfig/setup_linux/web_shortcuts/interactive.sh +27 -12
  197. machineconfig/setup_linux/web_shortcuts/live_from_github.sh +31 -0
  198. machineconfig/setup_mac/__init__.py +2 -3
  199. machineconfig/setup_mac/apps_gui.sh +248 -0
  200. machineconfig/setup_windows/__init__.py +3 -3
  201. machineconfig/setup_windows/uv.ps1 +8 -1
  202. machineconfig/setup_windows/web_shortcuts/interactive.ps1 +26 -11
  203. machineconfig/setup_windows/web_shortcuts/live_from_github.ps1 +30 -0
  204. machineconfig/setup_windows/web_shortcuts/quick_init.ps1 +17 -0
  205. machineconfig/utils/accessories.py +7 -4
  206. machineconfig/utils/code.py +99 -32
  207. machineconfig/utils/files/ascii_art.py +1 -1
  208. machineconfig/utils/files/headers.py +3 -2
  209. machineconfig/utils/installer_utils/github_release_bulk.py +156 -119
  210. machineconfig/utils/installer_utils/install_from_url.py +183 -0
  211. machineconfig/utils/installer_utils/installer_class.py +42 -99
  212. machineconfig/utils/installer_utils/installer_cli.py +175 -0
  213. machineconfig/utils/installer_utils/installer_helper.py +129 -0
  214. machineconfig/utils/installer_utils/{installer_abc.py → installer_locator_utils.py} +36 -85
  215. machineconfig/utils/{installer.py → installer_utils/installer_runner.py} +16 -61
  216. machineconfig/utils/io.py +69 -1
  217. machineconfig/utils/links.py +56 -38
  218. machineconfig/utils/meta.py +33 -18
  219. machineconfig/utils/options.py +46 -18
  220. machineconfig/utils/options_tv.py +119 -0
  221. machineconfig/utils/path_extended.py +44 -95
  222. machineconfig/utils/path_helper.py +76 -23
  223. machineconfig/utils/procs.py +1 -1
  224. machineconfig/utils/scheduler.py +20 -53
  225. machineconfig/utils/scheduling.py +0 -2
  226. machineconfig/utils/schemas/fire_agents/fire_agents_input.py +1 -1
  227. machineconfig/utils/schemas/layouts/layout_types.py +1 -1
  228. machineconfig/utils/ssh.py +159 -412
  229. machineconfig/utils/ssh_utils/abc.py +5 -0
  230. machineconfig/utils/ssh_utils/copy_from_here.py +111 -0
  231. machineconfig/utils/ssh_utils/copy_to_here.py +302 -0
  232. machineconfig/utils/ssh_utils/utils.py +142 -0
  233. machineconfig/utils/ssh_utils/wsl.py +210 -0
  234. machineconfig/utils/terminal.py +1 -0
  235. machineconfig/utils/upgrade_packages.py +104 -28
  236. machineconfig/utils/ve.py +12 -4
  237. machineconfig-7.98.dist-info/METADATA +132 -0
  238. {machineconfig-6.82.dist-info → machineconfig-7.98.dist-info}/RECORD +259 -196
  239. {machineconfig-6.82.dist-info → machineconfig-7.98.dist-info}/entry_points.txt +4 -1
  240. machineconfig/jobs/installer/linux_scripts/pgsql.sh +0 -41
  241. machineconfig/jobs/installer/linux_scripts/timescaledb.sh +0 -71
  242. machineconfig/jobs/installer/powershell_scripts/archive_pygraphviz.ps1 +0 -12
  243. machineconfig/scripts/linux/fzf2g +0 -21
  244. machineconfig/scripts/linux/fzfag +0 -17
  245. machineconfig/scripts/linux/fzffg +0 -25
  246. machineconfig/scripts/linux/fzfrga +0 -21
  247. machineconfig/scripts/linux/mcfgs +0 -38
  248. machineconfig/scripts/linux/other/share_smb +0 -1
  249. machineconfig/scripts/linux/skrg +0 -4
  250. machineconfig/scripts/linux/warp-cli.sh +0 -122
  251. machineconfig/scripts/linux/z_ls +0 -104
  252. machineconfig/scripts/python/ai/command_runner/prompt.txt +0 -9
  253. machineconfig/scripts/python/helpers_fire/agentic_frameworks/fire_crush.py +0 -37
  254. machineconfig/scripts/python/helpers_fire/agentic_frameworks/fire_gemini.py +0 -44
  255. machineconfig/scripts/python/helpers_fire/agentic_frameworks/fire_qwen.py +0 -43
  256. machineconfig/scripts/python/helpers_fire/prompt.txt +0 -2
  257. machineconfig/scripts/python/helpers_fire/template.sh +0 -15
  258. machineconfig/scripts/python/helpers_repos/count_lines_frontend.py +0 -17
  259. machineconfig/scripts/python/helpers_repos/secure_repo.py +0 -15
  260. machineconfig/scripts/python/nw/add_ssh_key.py +0 -148
  261. machineconfig/scripts/windows/fzfb.ps1 +0 -3
  262. machineconfig/scripts/windows/fzfg.ps1 +0 -2
  263. machineconfig/scripts/windows/fzfrga.bat +0 -20
  264. machineconfig/scripts/windows/mcfgs.ps1 +0 -17
  265. machineconfig/settings/lf/linux/exe/fzf_nano.sh +0 -16
  266. machineconfig/settings/lf/windows/fzf_edit.ps1 +0 -6
  267. machineconfig/settings/lf/windows/tst.ps1 +0 -1
  268. machineconfig/settings/yazi/yazi.toml +0 -4
  269. machineconfig/setup_linux/apps.sh +0 -66
  270. machineconfig/setup_linux/others/cli_installation.sh +0 -137
  271. machineconfig/setup_mac/apps.sh +0 -73
  272. machineconfig/setup_windows/apps.ps1 +0 -62
  273. machineconfig/utils/installer_utils/installer.py +0 -225
  274. machineconfig-6.82.dist-info/METADATA +0 -82
  275. /machineconfig/jobs/installer/linux_scripts/{warp-cli.sh → cloudflare_warp_cli.sh} +0 -0
  276. /machineconfig/scripts/python/{helpers_fire → ai/utils}/__init__.py +0 -0
  277. /machineconfig/scripts/python/{helpers_fire/agentic_frameworks → helpers_agents}/__init__.py +0 -0
  278. /machineconfig/scripts/python/{nw → helpers_agents/agentic_frameworks}/__init__.py +0 -0
  279. /machineconfig/scripts/python/{helpers_fire → helpers_agents}/fire_agents_help_search.py +0 -0
  280. /machineconfig/scripts/python/{helpers_fire → helpers_agents}/fire_agents_load_balancer.py +0 -0
  281. /machineconfig/scripts/python/{helpers_fire → helpers_agents/templates}/template.ps1 +0 -0
  282. /machineconfig/{settings/shells/pwsh/profile.ps1 → scripts/python/helpers_fire_command/f.py} +0 -0
  283. /machineconfig/{settings/yazi/keymap.toml → scripts/python/helpers_network/__init__.py} +0 -0
  284. /machineconfig/scripts/python/{nw → helpers_network}/devops_add_identity.py +0 -0
  285. /machineconfig/scripts/python/{nw → helpers_network}/mount_drive +0 -0
  286. /machineconfig/scripts/python/{nw → helpers_network}/mount_nw_drive +0 -0
  287. /machineconfig/scripts/python/{nw → helpers_network}/mount_nw_drive.py +0 -0
  288. /machineconfig/scripts/python/{nw → helpers_network}/mount_smb +0 -0
  289. /machineconfig/scripts/python/{nw → helpers_network}/onetimeshare.py +0 -0
  290. /machineconfig/scripts/{Restore-ThunderbirdProfile.ps1 → windows/mounts/Restore-ThunderbirdProfile.ps1} +0 -0
  291. /machineconfig/{jobs/installer/powershell_scripts → setup_windows/ssh}/openssh-server_add_key.ps1 +0 -0
  292. /machineconfig/{jobs/installer/powershell_scripts → setup_windows/ssh}/openssh-server_copy-ssh-id.ps1 +0 -0
  293. {machineconfig-6.82.dist-info → machineconfig-7.98.dist-info}/WHEEL +0 -0
  294. {machineconfig-6.82.dist-info → machineconfig-7.98.dist-info}/top_level.txt +0 -0
@@ -1,55 +1,24 @@
1
1
 
2
2
 
3
- from typing import Literal, Annotated, Optional
3
+ from typing import Literal, Annotated
4
4
  from pathlib import Path
5
5
  import typer
6
+ import machineconfig.scripts.python.helpers_devops.cli_config_dotfile as dotfile_module
7
+ import machineconfig.profile.create_links_export as create_links_export
6
8
 
7
9
 
8
-
9
- def private(method: Annotated[Literal["symlink", "copy"], typer.Option(..., "--method", "-m", help="Method to use for linking files")],
10
- on_conflict: Annotated[Literal["throwError", "overwriteSelfManaged", "backupSelfManaged", "overwriteDefaultPath", "backupDefaultPath"], typer.Option(..., "--on-conflict", "-o", help="Action to take on conflict")] = "throwError",
11
- which: Annotated[Optional[str], typer.Option(..., "--which", "-w", help="Specific items to process")] = None,
12
- interactive: Annotated[bool, typer.Option(..., "--interactive", "-ia", help="Run in interactive mode")] = False):
13
- """🔗 Manage private configuration files."""
14
- import machineconfig.profile.create_links_export as create_links_export
15
- create_links_export.main_private_from_parser(method=method, on_conflict=on_conflict, which=which, interactive=interactive)
16
-
17
- def public(method: Annotated[Literal["symlink", "copy"], typer.Option(..., "--method", "-m", help="Method to use for setting up the config file.")],
18
- on_conflict: Annotated[Literal["throwError", "overwriteDefaultPath", "backupDefaultPath"], typer.Option(..., "--on-conflict", "-o", help="Action to take on conflict")] = "throwError",
19
- which: Annotated[Optional[str], typer.Option(..., "--which", "-w", help="Specific items to process")] = None,
20
- interactive: Annotated[bool, typer.Option(..., "--interactive", "-ia", help="Run in interactive mode")] = False):
21
- """🔗 Manage public configuration files."""
22
- import machineconfig.profile.create_links_export as create_links_export
23
- create_links_export.main_public_from_parser(method=method, on_conflict=on_conflict, which=which, interactive=interactive)
24
-
25
- def dotfile(file: Annotated[str, typer.Argument(help="file/folder path.")],
26
- overwrite: Annotated[bool, typer.Option("--overwrite", "-o", help="Overwrite.")] = False,
27
- dest: Annotated[str, typer.Option("--dest", "-d", help="destination folder")] = "",
28
- ):
29
- """🔗 Manage dotfiles."""
30
- import machineconfig.scripts.python.helpers_devops.cli_config_dotfile as dotfile_module
31
- dotfile_module.main(file=file, overwrite=overwrite, dest=dest)
32
-
33
-
34
- def shell():
10
+ def configure_shell_profile(which: Annotated[Literal["default", "d", "nushell", "n"], typer.Option(..., "--which", "-w", help="Which shell profile to create/configure")]="default"):
35
11
  """🔗 Configure your shell profile."""
36
- from machineconfig.profile.create_shell_profile import create_default_shell_profile
37
- create_default_shell_profile()
38
-
12
+ from machineconfig.profile.create_shell_profile import create_default_shell_profile, create_nu_shell_profile
13
+ match which:
14
+ case "nushell" | "n":
15
+ create_nu_shell_profile()
16
+ return
17
+ case "default" | "d":
18
+ create_default_shell_profile()
19
+ return
20
+ typer.echo(f"[red]Error:[/] Unknown shell profile type: {which}")
39
21
 
40
- def path():
41
- """📚 NAVIGATE PATH variable with TUI"""
42
- from machineconfig.scripts.python import env_manager as navigator
43
- from pathlib import Path
44
- path = Path(navigator.__file__).resolve().parent.joinpath("path_manager_tui.py")
45
- from machineconfig.utils.code import run_shell_script, get_uv_command_executing_python_script
46
- uv_with = ["textual"]
47
- uv_project_dir = None
48
- if not Path.home().joinpath("code/machineconfig").exists():
49
- uv_with.append("machineconfig>=6.81")
50
- else:
51
- uv_project_dir = str(Path.home().joinpath("code/machineconfig"))
52
- run_shell_script(get_uv_command_executing_python_script(python_script=path.read_text(encoding="utf-8"), uv_with=uv_with, uv_project_dir=uv_project_dir)[0])
53
22
 
54
23
 
55
24
  def pwsh_theme():
@@ -59,6 +28,7 @@ def pwsh_theme():
59
28
  import subprocess
60
29
  subprocess.run(["pwsh", "-File", str(file)])
61
30
 
31
+
62
32
  def starship_theme():
63
33
  """🔗 Select starship prompt theme."""
64
34
  import subprocess
@@ -87,34 +57,49 @@ def starship_theme():
87
57
  except ValueError:
88
58
  typer.echo("❌ Please enter a valid number")
89
59
 
90
- def copy_assets(which: Annotated[Literal["scripts", "settings", "both"], typer.Argument(..., help="Which assets to copy")]):
60
+
61
+ def copy_assets(which: Annotated[Literal["scripts", "s", "settings", "t", "both", "b"], typer.Argument(..., help="Which assets to copy")]):
91
62
  """🔗 Copy asset files from library to machine."""
92
63
  import machineconfig.profile.create_helper as create_helper
93
64
  match which:
94
- case "both":
65
+ case "both" | "b":
66
+ create_helper.copy_assets_to_machine(which="scripts")
67
+ create_helper.copy_assets_to_machine(which="settings")
68
+ return
69
+ case "scripts" | "s":
95
70
  create_helper.copy_assets_to_machine(which="scripts")
71
+ return
72
+ case "settings" | "t":
96
73
  create_helper.copy_assets_to_machine(which="settings")
97
- case _:
98
- create_helper.copy_assets_to_machine(which=which)
74
+ return
75
+ typer.echo(f"[red]Error:[/] Unknown asset type: {which}")
76
+
77
+
78
+ def link_wsl_and_windows_home():
79
+ """🔗 Link WSL home and Windows home directories."""
80
+ import machineconfig.utils.ssh_utils.wsl as wsl_utils
81
+ wsl_utils.link_wsl_and_windows()
99
82
 
100
83
 
101
84
  def get_app():
102
85
  config_apps = typer.Typer(help="⚙️ [c] configuration subcommands", no_args_is_help=True, add_help_option=False, add_completion=False)
103
- config_apps.command("private", no_args_is_help=True, help="🔗 [v] Manage private configuration files.")(private)
104
- config_apps.command("v", no_args_is_help=True, hidden=True)(private)
105
- config_apps.command("public", no_args_is_help=True, help="🔗 [b] Manage public configuration files.")(public)
106
- config_apps.command("b", no_args_is_help=True, help="Manage public configuration files.", hidden=True)(public)
107
- config_apps.command("dotfile", no_args_is_help=True, help="🔗 [d] Manage dotfiles.")(dotfile)
108
- config_apps.command("d", no_args_is_help=True, hidden=True)(dotfile)
109
- config_apps.command("shell", no_args_is_help=False, help="🔗 [s] Configure your shell profile.")(shell)
110
- config_apps.command("s", no_args_is_help=False, help="Configure your shell profile.", hidden=True)(shell)
111
- config_apps.command("path", no_args_is_help=False, help="📚 [p] NAVIGATE PATH variable with TUI")(path)
112
- config_apps.command("p", no_args_is_help=False, help="NAVIGATE PATH variable with TUI", hidden=True)(path)
113
- config_apps.command("starship-theme", no_args_is_help=False, help="🔗 [t] Select starship prompt theme.")(starship_theme)
86
+ config_apps.command("private", no_args_is_help=True, help="🔗 [v] Manage private configuration files.")(create_links_export.main_private_from_parser)
87
+ config_apps.command("v", no_args_is_help=True, hidden=True)(create_links_export.main_private_from_parser)
88
+ config_apps.command("public", no_args_is_help=True, help="🔗 [b] Manage public configuration files.")(create_links_export.main_public_from_parser)
89
+ config_apps.command("b", no_args_is_help=True, help="Manage public configuration files.", hidden=True)(create_links_export.main_public_from_parser)
90
+ config_apps.command("dotfile", no_args_is_help=True, help="🔗 [d] Manage dotfiles.")(dotfile_module.main)
91
+ config_apps.command("d", no_args_is_help=True, hidden=True)(dotfile_module.main)
92
+ config_apps.command("shell", no_args_is_help=False, help="🔗 [s] Configure your shell profile.")(configure_shell_profile)
93
+ config_apps.command("s", no_args_is_help=False, help="Configure your shell profile.", hidden=True)(configure_shell_profile)
94
+ config_apps.command("starship-theme", no_args_is_help=False, help="🔗 [t] Select starship prompt theme.")(starship_theme)
114
95
  config_apps.command("t", no_args_is_help=False, help="Select starship prompt theme.", hidden=True)(starship_theme)
115
- config_apps.command("pwsh-theme", no_args_is_help=False, help="🔗 [T] Select powershell prompt theme.")(pwsh_theme)
96
+ config_apps.command("pwsh-theme", no_args_is_help=False, help="🔗 [T] Select powershell prompt theme.")(pwsh_theme)
116
97
  config_apps.command("T", no_args_is_help=False, help="Select powershell prompt theme.", hidden=True)(pwsh_theme)
117
98
 
118
- config_apps.command("copy-assets", no_args_is_help=True, help="🔗 [c] Copy asset files from library to machine.", hidden=False)(copy_assets)
99
+ config_apps.command("copy-assets", no_args_is_help=True, help="🔗 [c] Copy asset files from library to machine.", hidden=False)(copy_assets)
119
100
  config_apps.command("c", no_args_is_help=True, help="Copy asset files from library to machine.", hidden=True)(copy_assets)
101
+
102
+ config_apps.command("link-wsl-windows", no_args_is_help=False, help="🔗 [l] Link WSL home and Windows home directories.", hidden=False)(link_wsl_and_windows_home)
103
+ config_apps.command("l", no_args_is_help=False, help="Link WSL home and Windows home directories.", hidden=True)(link_wsl_and_windows_home)
104
+
120
105
  return config_apps
@@ -1,72 +1,84 @@
1
- """Like yadm and dotter."""
2
1
 
3
- from typing import Annotated
2
+ """Like yadm and dotter."""
4
3
 
4
+ from machineconfig.profile.create_links_export import ON_CONFLICT_LOOSE, ON_CONFLICT_MAPPER
5
+ from typing import Annotated, Literal
5
6
  import typer
6
7
 
7
8
 
9
+
8
10
  def main(
9
11
  file: Annotated[str, typer.Argument(help="file/folder path.")],
10
- overwrite: Annotated[bool, typer.Option("--overwrite", "-o", help="Overwrite.")] = False,
11
- dest: Annotated[str, typer.Option("--dest", "-d", help="destination folder")] = "",
12
- ) -> None:
13
-
12
+ method: Annotated[Literal["symlink", "s", "copy", "c"], typer.Option(..., "--method", "-m", help="Method to use for linking files")] = "copy",
13
+ on_conflict: Annotated[ON_CONFLICT_LOOSE, typer.Option(..., "--on-conflict", "-o", help="Action to take on conflict")] = "throw-error",
14
+ sensitivity: Annotated[Literal["private", "v", "public", "b"], typer.Option(..., "--sensitivity", "-s", help="Sensitivity of the config file.")] = "private",
15
+ destination: Annotated[str, typer.Option("--destination", "-d", help="destination folder (override the default, use at your own risk)")] = "",
16
+ shared: Annotated[bool, typer.Option("--shared", "-sh", help="Whether the config file is shared across destinations directory.")] = False,
17
+ ) -> None:
14
18
  from rich.console import Console
15
19
  from rich.panel import Panel
20
+ from machineconfig.utils.links import symlink_map, copy_map
21
+ from pathlib import Path
22
+ match sensitivity:
23
+ case "private" | "v":
24
+ backup_root = Path.home().joinpath("dotfiles/mapper")
25
+ case "public" | "b":
26
+ from machineconfig.utils.source_of_truth import CONFIG_ROOT
27
+ backup_root = Path(CONFIG_ROOT).joinpath("dotfiles/mapper")
16
28
 
17
- from machineconfig.utils.links import symlink_map
18
- from machineconfig.utils.path_extended import PathExtended
19
- from machineconfig.utils.source_of_truth import CONFIG_ROOT
20
29
  console = Console()
21
- orig_path = PathExtended(file).expanduser().absolute()
22
- if dest == "":
23
- if "Local" in str(orig_path):
24
- junction = orig_path.split(at="Local", sep=-1)[1]
25
- elif "Roaming" in str(orig_path):
26
- junction = orig_path.split(at="Roaming", sep=-1)[1]
27
- elif ".config" in str(orig_path):
28
- junction = orig_path.split(at=".config", sep=-1)[1]
30
+ orig_path = Path(file).expanduser().absolute()
31
+ if destination == "":
32
+ if shared:
33
+ new_path = backup_root.joinpath("shared").joinpath(orig_path.name)
34
+ new_path.parent.mkdir(parents=True, exist_ok=True)
29
35
  else:
30
- junction = orig_path.rel2home()
31
- new_path = PathExtended(CONFIG_ROOT).parent.parent.joinpath(junction)
36
+ new_path = backup_root.joinpath(orig_path.relative_to(Path.home()))
37
+ new_path.parent.mkdir(parents=True, exist_ok=True)
32
38
  else:
33
- dest_path = PathExtended(dest).expanduser().absolute()
34
- dest_path.mkdir(parents=True, exist_ok=True)
35
- new_path = dest_path.joinpath(orig_path.name)
36
-
37
- symlink_map(config_file_default_path=orig_path, self_managed_config_file_path=new_path, on_conflict="throwError")
38
-
39
- console.print(
40
- Panel(
41
- "\n".join(
42
- [
43
- " Symbolic link created successfully!",
44
- "🔄 Add the following snippet to mapper.toml to persist this mapping:",
45
- ]
46
- ),
47
- title="Symlink Created",
48
- border_style="green",
49
- padding=(1, 2),
50
- )
51
- )
52
-
53
- mapper_snippet = "\n".join(
54
- [
55
- f"[bold]📝 Edit configuration file:[/] [cyan]nano {PathExtended(CONFIG_ROOT)}/symlinks/mapper.toml[/cyan]",
56
- "",
57
- f"[{new_path.parent.name}]",
58
- f"{orig_path.name.split('.')[0]} = {{ this = '{orig_path.collapseuser().as_posix()}', to_this = '{new_path.collapseuser().as_posix()}' }}",
59
- ]
60
- )
39
+ if shared:
40
+ dest_path = Path(destination).expanduser().absolute()
41
+ dest_path.mkdir(parents=True, exist_ok=True)
42
+ new_path = dest_path.joinpath("shared").joinpath(orig_path.name)
43
+ new_path.parent.mkdir(parents=True, exist_ok=True)
44
+ else:
45
+ dest_path = Path(destination).expanduser().absolute()
46
+ dest_path.mkdir(parents=True, exist_ok=True)
47
+ new_path = dest_path.joinpath(orig_path.name)
48
+ match method:
49
+ case "copy" | "c":
50
+ try:
51
+ copy_map(config_file_default_path=orig_path, self_managed_config_file_path=new_path, on_conflict=ON_CONFLICT_MAPPER[on_conflict]) # type: ignore[arg-type]
52
+ except Exception as e:
53
+ typer.echo(f"[red]Error:[/] {e}")
54
+ typer.Exit(code=1)
55
+ return
56
+ case "symlink" | "s":
57
+ try:
58
+ symlink_map(config_file_default_path=orig_path, self_managed_config_file_path=new_path, on_conflict=ON_CONFLICT_MAPPER[on_conflict]) # type: ignore[arg-type]
59
+ except Exception as e:
60
+ typer.echo(f"[red]Error:[/] {e}")
61
+ typer.Exit(code=1)
62
+ case _:
63
+ raise ValueError(f"Unknown method: {method}")
64
+ console.print(Panel("\n".join(["✅ Symbolic link created successfully!", "🔄 Add the following snippet to mapper.toml to persist this mapping:",]), title="Symlink Created", border_style="green", padding=(1, 2),))
61
65
 
62
- console.print(
63
- Panel(
64
- mapper_snippet,
65
- title="Mapper Entry",
66
- border_style="cyan",
67
- padding=(1, 2),
68
- )
69
- )
66
+ # mapper_snippet = "\n".join(
67
+ # [
68
+ # f"[bold]📝 Edit configuration file:[/] [cyan]nano {Path(CONFIG_ROOT)}/symlinks/mapper.toml[/cyan]",
69
+ # "",
70
+ # f"[{new_path.parent.name}]",
71
+ # f"{orig_path.name.split('.')[0]} = {{ this = '{orig_path.as_posix()}', to_this = '{new_path.as_posix()}' }}",
72
+ # ]
73
+ # )
74
+ # console.print(
75
+ # Panel(
76
+ # mapper_snippet,
77
+ # title="Mapper Entry",
78
+ # border_style="cyan",
79
+ # padding=(1, 2),
80
+ # )
81
+ # )
70
82
 
71
83
 
72
84
  def arg_parser() -> None:
@@ -1,5 +1,6 @@
1
1
 
2
- import machineconfig.scripts.python.helpers_devops.cli_terminal as cli_terminal
2
+ import machineconfig.scripts.python.helpers_devops.cli_share_file
3
+ import machineconfig.scripts.python.helpers_devops.cli_share_terminal as cli_share_terminal
3
4
  import machineconfig.scripts.python.helpers_devops.cli_share_server as cli_share_server
4
5
  import typer
5
6
  from typing import Optional, Annotated
@@ -25,41 +26,169 @@ def add_ssh_key(path: Annotated[Optional[str], typer.Option(..., help="Path to t
25
26
  github: Annotated[Optional[str], typer.Option(..., "--github", "-g", help="Fetch public keys from a GitHub username")] = None
26
27
  ):
27
28
  """🔑 SSH add pub key to this machine so its accessible by owner of corresponding private key."""
28
- import machineconfig.scripts.python.nw.devops_add_ssh_key as helper
29
+ import machineconfig.scripts.python.helpers_network.devops_add_ssh_key as helper
29
30
  helper.main(pub_path=path, pub_choose=choose, pub_val=value, from_github=github)
30
31
  def add_ssh_identity():
31
32
  """🗝️ SSH add identity (private key) to this machine"""
32
- import machineconfig.scripts.python.nw.devops_add_identity as helper
33
+ import machineconfig.scripts.python.helpers_network.devops_add_identity as helper
33
34
  helper.main()
34
35
 
35
36
 
36
- def show_address():
37
- import socket
38
- s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
39
- s.connect(('8.8.8.8',80))
40
- local_ip_v4 = s.getsockname()[0]
41
- s.close()
42
- print(f"This computer is @ {local_ip_v4}")
37
+ def show_address() -> None:
38
+ """📌 Show this computer addresses on network"""
39
+ from machineconfig.utils.installer_utils.installer_cli import install_if_missing
40
+ import subprocess
41
+ install_if_missing("ipinfo")
42
+ result = subprocess.run(
43
+ ["ipinfo", "myip", "--json"],
44
+ check=True,
45
+ capture_output=True,
46
+ text=True,
47
+ encoding="utf-8",
48
+ )
49
+ import json
50
+ loaded_json = json.loads(result.stdout)
51
+ from rich import print_json
52
+ print_json(data=loaded_json)
53
+
54
+ import machineconfig.scripts.python.helpers_network.address as helper
55
+ from rich.table import Table
56
+ from rich.console import Console
57
+ res = helper.get_all_ipv4_addresses()
58
+ res.append( ("Public IP", loaded_json.get("ip", "N/A")))
59
+
60
+ # loc = loaded_json["loc"]
61
+ # cmd = f"""curl "https://maps.geoapify.com/v1/staticmap?style=osm-bright&width=600&height=300&center=lonlat:{loc}&zoom=6&marker=lonlat:{loc};color:%23ff0000;size:medium&apiKey=$GEOAPIFY_API_KEY" -o map.png && chafa map.png"""
62
+ # from machineconfig.utils.code import run_shell_script
63
+ # run_shell_script(script=cmd)
64
+
65
+ table = Table(title="Network Interfaces")
66
+ table.add_column("Interface", style="cyan")
67
+ table.add_column("IP Address", style="green")
68
+
69
+ for iface, ip in res:
70
+ table.add_row(iface, ip)
71
+
72
+ console = Console()
73
+ console.print(table)
74
+
75
+ res = helper.select_lan_ipv4(prefer_vpn=False)
76
+ if res is not None:
77
+ # ip, iface = res
78
+ # print(f"Selected IP: {ip} on interface: {iface}")
79
+ print(f"LAN IPv4: {res}")
80
+ else:
81
+ print("No network interfaces found.")
82
+
83
+
84
+
85
+ def bind_wsl_port(port: Annotated[int, typer.Option(..., "--port", "-p", help="Port number to bind")]):
86
+ code = f"""
87
+
88
+ $wsl_ip = (wsl.exe hostname -I).Trim().Split(' ')[0]
89
+ netsh interface portproxy add v4tov4 listenport={port} listenaddress=0.0.0.0 connectport={port} connectaddress=$wsl_ip
90
+
91
+ """
92
+ from machineconfig.utils.code import exit_then_run_shell_script
93
+ exit_then_run_shell_script(code)
43
94
 
44
95
 
45
96
  def debug_ssh():
46
97
  """🐛 SSH debug"""
47
98
  from platform import system
48
99
  if system() == "Linux" or system() == "Darwin":
49
- import machineconfig.scripts.python.nw.ssh_debug_linux as helper
100
+ import machineconfig.scripts.python.helpers_network.ssh_debug_linux as helper
50
101
  helper.ssh_debug_linux()
51
102
  elif system() == "Windows":
52
- import machineconfig.scripts.python.nw.ssh_debug_windows as helper
103
+ import machineconfig.scripts.python.helpers_network.ssh_debug_windows as helper
53
104
  helper.ssh_debug_windows()
54
105
  else:
55
106
  raise NotImplementedError(f"Platform {system()} is not supported.")
56
107
 
108
+ def wifi_select(
109
+ ssid: Annotated[str, typer.Option("-n", "--ssid", help="🔗 SSID of WiFi (from config)")] = "MyPhoneHotSpot",
110
+ manual: Annotated[bool, typer.Option("-m", "--manual", help="🔍 Manual network selection mode")] = False,
111
+ list_: Annotated[bool, typer.Option("-l", "--list", help="📡 List available networks only")] = False,
112
+ ) -> None:
113
+ """Main function with fallback network selection"""
114
+ from rich.panel import Panel
115
+ from rich.prompt import Confirm
116
+ from rich.console import Console
117
+ from machineconfig.scripts.python.helpers_network.wifi_conn import try_config_connection, manual_network_selection, display_available_networks
118
+ console = Console()
119
+ console.print(Panel("📶 Welcome to the WiFi Connector Tool", title="[bold blue]WiFi Connection[/bold blue]", border_style="blue"))
120
+
121
+ # If user just wants to list networks
122
+ if list_:
123
+ display_available_networks()
124
+ return
125
+
126
+ # If user wants manual mode, skip config and go straight to selection
127
+ if manual:
128
+ console.print("[blue]🔍 Manual network selection mode[/blue]")
129
+ if manual_network_selection():
130
+ console.print("[green]🎉 Successfully connected![/green]")
131
+ else:
132
+ console.print("[red]❌ Failed to connect[/red]")
133
+ return
134
+
135
+ # Try to connect using configuration first
136
+ console.print(f"[blue]🔍 Attempting to connect to configured network: {ssid}[/blue]")
137
+
138
+ if try_config_connection(ssid):
139
+ console.print("[green]🎉 Successfully connected using configuration![/green]")
140
+ return
141
+
142
+ # Configuration failed, offer fallback options
143
+ console.print("\n[yellow]⚠️ Configuration connection failed or not available[/yellow]")
144
+
145
+ if Confirm.ask("[blue]Would you like to manually select a network?[/blue]", default=True):
146
+ if manual_network_selection():
147
+ console.print("[green]🎉 Successfully connected![/green]")
148
+ else:
149
+ console.print("[red]❌ Failed to connect[/red]")
150
+ else:
151
+ console.print("[blue]👋 Goodbye![/blue]")
152
+
153
+
154
+
155
+ def reset_cloudflare_tunnel():
156
+ code = """
157
+ # cloudflared tunnel route dns glenn # creates CNAMES in Cloudflare dashboard
158
+ # sudo systemctl stop cloudflared
159
+ # test: cloudflared tunnel run glenn
160
+ home_dir=$HOME
161
+ cloudflared_path="$home_dir/.local/bin/cloudflared"
162
+ sudo $cloudflared_path service uninstall
163
+ sudo rm /etc/cloudflared/config.yml || true
164
+ sudo $cloudflared_path --config $home_dir/.cloudflared/config.yml service install
165
+ """
166
+ print(code)
167
+ def add_ip_exclusion_to_warp(ip: Annotated[str, typer.Option(..., "--ip", help="IP address to exclude from WARP")]):
168
+ code = f"""
169
+ sudo warp-cli tunnel ip add {ip}
170
+ sudo warp-cli disconnect
171
+ sudo warp-cli connect
172
+ """
173
+ print(code)
174
+
175
+
57
176
  def get_app():
58
177
  nw_apps = typer.Typer(help="🔐 [n] Network subcommands", no_args_is_help=True, add_help_option=False, add_completion=False)
59
- nw_apps.command(name="share-terminal", help="📡 [t] Share terminal via web browser")(cli_terminal.main)
60
- nw_apps.command(name="t", help="Share terminal via web browser", hidden=True)(cli_terminal.main)
61
- nw_apps.command(name="share-server", help="🌐 [s] Start local/global server to share files/folders via web browser", no_args_is_help=True)(cli_share_server.main)
62
- nw_apps.command(name="s", help="Start local/global server to share files/folders via web browser", hidden=True, no_args_is_help=True)(cli_share_server.main)
178
+ nw_apps.command(name="share-terminal", help="📡 [t] Share terminal via web browser")(cli_share_terminal.share_terminal)
179
+ nw_apps.command(name="t", help="Share terminal via web browser", hidden=True)(cli_share_terminal.share_terminal)
180
+
181
+ nw_apps.command(name="share-server", help="🌐 [s] Start local/global server to share files/folders via web browser", no_args_is_help=True)(cli_share_server.web_file_explorer)
182
+ nw_apps.command(name="s", help="Start local/global server to share files/folders via web browser", hidden=True, no_args_is_help=True)(cli_share_server.web_file_explorer)
183
+
184
+ # app = cli_share_server.get_share_file_app()
185
+ # nw_apps.add_typer(app, name="share-file", help="📁 [f] Share a file via relay server", no_args_is_help=True)
186
+ # nw_apps.add_typer(app, name="f", help="Share a file via relay server", hidden=True, no_args_is_help=True)
187
+ nw_apps.command(name="send", no_args_is_help=True, hidden=False, help="📁 [sx] send files from here.")(machineconfig.scripts.python.helpers_devops.cli_share_file.share_file_send)
188
+ nw_apps.command(name="sx", no_args_is_help=True, hidden=True, help="📁 [sx] send files from here.")(machineconfig.scripts.python.helpers_devops.cli_share_file.share_file_send)
189
+ nw_apps.command(name="receive", no_args_is_help=True, hidden=False, help="📁 [rx] receive files to here.")(machineconfig.scripts.python.helpers_devops.cli_share_file.share_file_receive)
190
+ nw_apps.command(name="rx", no_args_is_help=True, hidden=True, help="📁 [rx] receive files to here.")(machineconfig.scripts.python.helpers_devops.cli_share_file.share_file_receive)
191
+
63
192
  nw_apps.command(name="install-ssh-server", help="📡 [i] Install SSH server")(install_ssh_server)
64
193
  nw_apps.command(name="i", help="Install SSH server", hidden=True)(install_ssh_server)
65
194
  nw_apps.command(name="add-ssh-key", help="🔑 [k] Add SSH public key to this machine", no_args_is_help=True)(add_ssh_key)
@@ -70,4 +199,16 @@ def get_app():
70
199
  nw_apps.command(name="a", help="Show this computer addresses on network", hidden=True)(show_address)
71
200
  nw_apps.command(name="debug-ssh", help="🐛 [d] Debug SSH connection")(debug_ssh)
72
201
  nw_apps.command(name="d", help="Debug SSH connection", hidden=True)(debug_ssh)
202
+
203
+ nw_apps.command(name="wifi-select", no_args_is_help=True, help="📶 [w] WiFi connection utility.")(wifi_select)
204
+ nw_apps.command(name="w", no_args_is_help=True, hidden=True)(wifi_select)
205
+
206
+ nw_apps.command(name="bind-wsl-port", help="🔌 [b] Bind WSL port to Windows host", no_args_is_help=True)(bind_wsl_port)
207
+ nw_apps.command(name="b", help="Bind WSL port to Windows host", hidden=True, no_args_is_help=True)(bind_wsl_port)
208
+
209
+ nw_apps.command(name="reset-cloudflare-tunnel", help="☁️ [r] Reset Cloudflare tunnel service")(reset_cloudflare_tunnel)
210
+ nw_apps.command(name="r", help="Reset Cloudflare tunnel service", hidden=True)(reset_cloudflare_tunnel)
211
+ nw_apps.command(name="add-ip-exclusion-to-warp", help="🚫 [p] Add IP exclusion to WARP")(add_ip_exclusion_to_warp)
212
+ nw_apps.command(name="p", help="Add IP exclusion to WARP", hidden=True)(add_ip_exclusion_to_warp)
213
+
73
214
  return nw_apps
@@ -8,38 +8,38 @@ in the event that username@github.com is not mentioned in the remote url.
8
8
  from pathlib import Path
9
9
  from typing import Annotated, Optional
10
10
  import typer
11
- from machineconfig.scripts.python.helpers_repos.secure_repo import main as secure_repo_main
11
+ from machineconfig.scripts.python.helpers_repos.cloud_repo_sync import main as secure_repo_main
12
12
 
13
13
 
14
14
  DirectoryArgument = Annotated[Optional[str], typer.Argument(help="📁 Directory containing repo(s).")]
15
15
  RecursiveOption = Annotated[bool, typer.Option("--recursive", "-r", help="🔍 Recurse into nested repositories.")]
16
- NO_UVsyncOption = Annotated[bool, typer.Option("--no-uv-sync", "-ns", help="🚫 Disable automatic uv sync after pulls.")]
16
+ UVsyncOption = Annotated[bool, typer.Option("--uv-sync/--no-uv-sync", "-u/-ns", help="Automatic uv sync after pulls.")]
17
17
  CloudOption = Annotated[Optional[str], typer.Option("--cloud", "-c", help="☁️ Upload to or download from this cloud remote.")]
18
18
 
19
19
 
20
- def push(directory: DirectoryArgument = None, recursive: RecursiveOption = False, no_uv_sync: NO_UVsyncOption = False) -> None:
20
+ def push(directory: DirectoryArgument = None, recursive: RecursiveOption = False, auto_uv_sync: UVsyncOption = False) -> None:
21
21
  """🚀 Push changes across repositories."""
22
22
  from machineconfig.scripts.python.helpers_repos.entrypoint import git_operations
23
- git_operations(directory, pull=False, commit=False, push=True, recursive=recursive, auto_uv_sync=not no_uv_sync)
23
+ git_operations(directory, pull=False, commit=False, push=True, recursive=recursive, auto_uv_sync=auto_uv_sync)
24
24
 
25
25
 
26
- def pull(directory: DirectoryArgument = None, recursive: RecursiveOption = False, no_uv_sync: NO_UVsyncOption = False) -> None:
26
+ def pull(directory: DirectoryArgument = None, recursive: RecursiveOption = False, auto_uv_sync: UVsyncOption = False) -> None:
27
27
  """⬇️ Pull changes across repositories."""
28
28
  from machineconfig.scripts.python.helpers_repos.entrypoint import git_operations
29
29
 
30
- git_operations(directory, pull=True, commit=False, push=False, recursive=recursive, auto_uv_sync=not no_uv_sync)
30
+ git_operations(directory, pull=True, commit=False, push=False, recursive=recursive, auto_uv_sync=auto_uv_sync)
31
31
 
32
32
 
33
- def commit(directory: DirectoryArgument = None, recursive: RecursiveOption = False, no_uv_sync: NO_UVsyncOption = False) -> None:
33
+ def commit(directory: DirectoryArgument = None, recursive: RecursiveOption = False, auto_uv_sync: UVsyncOption = False) -> None:
34
34
  """💾 Commit changes across repositories."""
35
35
  from machineconfig.scripts.python.helpers_repos.entrypoint import git_operations
36
- git_operations(directory, pull=False, commit=True, push=False, recursive=recursive, auto_uv_sync=not no_uv_sync)
36
+ git_operations(directory, pull=False, commit=True, push=False, recursive=recursive, auto_uv_sync=auto_uv_sync)
37
37
 
38
38
 
39
- def sync(directory: DirectoryArgument = None, recursive: RecursiveOption = False, no_uv_sync: NO_UVsyncOption = False) -> None:
39
+ def sync(directory: DirectoryArgument = None, recursive: RecursiveOption = False, auto_uv_sync: UVsyncOption = False) -> None:
40
40
  """🔄 Pull, commit, and push changes across repositories."""
41
41
  from machineconfig.scripts.python.helpers_repos.entrypoint import git_operations
42
- git_operations(directory, pull=True, commit=True, push=True, recursive=recursive, auto_uv_sync=not no_uv_sync)
42
+ git_operations(directory, pull=True, commit=True, push=True, recursive=recursive, auto_uv_sync=auto_uv_sync)
43
43
 
44
44
 
45
45
  def capture(directory: DirectoryArgument = None, cloud: CloudOption = None) -> None:
@@ -71,15 +71,40 @@ def checkout_to_branch_command(directory: DirectoryArgument = None, cloud: Cloud
71
71
  clone_from_specs(directory, cloud, checkout_branch_flag=True, checkout_commit_flag=False)
72
72
 
73
73
 
74
- def analyze(directory: DirectoryArgument = None) -> None:
75
- """📊 Analyze repository development over time."""
76
- repo_path = directory if directory is not None else "."
77
- from machineconfig.scripts.python.helpers_repos.count_lines_frontend import analyze_repo_development
78
- analyze_repo_development(repo_path=repo_path)
74
+ def count_lines_in_repo(repo_path: Annotated[str, typer.Argument(..., help="Path to the git repository")]):
75
+ def func(repo_path: str):
76
+ from machineconfig.scripts.python.helpers_repos import repo_analyzer_1
77
+ repo_analyzer_1.count_historical_line_edits(repo_path=repo_path)
78
+ from machineconfig.utils.code import run_lambda_function
79
+ run_lambda_function(lambda: func(repo_path=repo_path), uv_project_dir=None, uv_with=["machineconfig>=7.98"])
79
80
 
80
81
 
81
- def viz(
82
- repo: Annotated[str, typer.Option(..., "--repo", "-r", help="Path to git repository to visualize")] = Path.cwd().__str__(),
82
+ def print_python_files_by_size(repo_path: Annotated[str, typer.Argument(..., help="Path to the git repository")]):
83
+ def func(repo_path: str):
84
+ from machineconfig.scripts.python.helpers_repos.repo_analyzer_2 import print_python_files_by_size_impl
85
+ print_python_files_by_size_impl(repo_path=repo_path)
86
+ from machineconfig.utils.code import run_lambda_function
87
+ run_lambda_function(lambda: func(repo_path=repo_path), uv_project_dir=None, uv_with=["machineconfig[plot]>=7.98"])
88
+
89
+
90
+ def analyze_repo_development(repo_path: Annotated[str, typer.Argument(..., help="Path to the git repository")]):
91
+ # from machineconfig.scripts.python.helpers_repos import count_lines
92
+ # from pathlib import Path
93
+
94
+ # count_lines_path = Path(count_lines.__file__)
95
+ # # --project $HOME/code/ machineconfig --group plot
96
+ # cmd = f"""uv run --python 3.14 --with "machineconfig[plot]>=7.98" {count_lines_path} analyze-over-time {repo_path}"""
97
+ # from machineconfig.utils.code import run_shell_script
98
+ # run_shell_script(cmd)
99
+ def func(repo_path: str):
100
+ from machineconfig.scripts.python.helpers_repos.repo_analyzer_2 import analyze_over_time
101
+ analyze_over_time(repo_path=repo_path)
102
+ from machineconfig.utils.code import run_lambda_function
103
+ run_lambda_function(lambda: func(repo_path=repo_path), uv_project_dir=None, uv_with=["machineconfig[plot]>=7.98"])
104
+
105
+
106
+ def gource_viz(
107
+ repo: Annotated[str, typer.Option(..., "--repo", "-r", help="Path to git repository to visualize")] = ".",
83
108
  output_file: Annotated[Optional[Path], typer.Option(..., "--output", "-o", help="Output video file (e.g., output.mp4). If specified, gource will render to video.")] = None,
84
109
  resolution: Annotated[str, typer.Option(..., "--resolution", "-res", help="Video resolution (e.g., 1920x1080, 1280x720)")] = "1920x1080",
85
110
  seconds_per_day: Annotated[float, typer.Option(..., "--seconds-per-day", "-spd", help="Speed of simulation (lower = faster)")] = 0.1,
@@ -160,22 +185,31 @@ def get_app():
160
185
  repos_apps.command(name="c", help="Commit changes across repositories", hidden=True)(commit)
161
186
  repos_apps.command(name="sync", help="🔄 [y] Pull, commit, and push changes across repositories")(sync)
162
187
  repos_apps.command(name="s", help="Pull, commit, and push changes across repositories", hidden=True)(sync)
163
- repos_apps.command(name="analyze", help="📊 [a] Analyze repository development over time")(analyze)
164
- repos_apps.command(name="a", help="Analyze repository development over time", hidden=True)(analyze)
188
+ repos_apps.command(name="analyze", help="📊 [a] Analyze repository development over time")(analyze_repo_development)
189
+ repos_apps.command(name="a", help="Analyze repository development over time", hidden=True)(analyze_repo_development)
165
190
  repos_apps.command(name="secure", help="🔐 [s] Securely sync git repository to/from cloud with encryption")(secure_repo_main)
166
191
  repos_apps.command(name="s", help="Securely sync git repository to/from cloud with encryption", hidden=True)(secure_repo_main)
167
- repos_apps.command(name="viz", help="🎬 [v] Visualize repository activity using Gource")(viz)
168
- repos_apps.command(name="v", help="Visualize repository activity using Gource", hidden=True)(viz)
192
+
193
+ repos_apps.command(name="viz", help="🎬 [v] Visualize repository activity using Gource")(gource_viz)
194
+ repos_apps.command(name="v", help="Visualize repository activity using Gource", hidden=True)(gource_viz)
195
+
196
+ repos_apps.command(name="count-lines", help="📄 [l] Count python lines of code in current repo + historical edits.")(count_lines_in_repo)
197
+ repos_apps.command(name="l", help="Count python lines of code in current repo + historical edits.", hidden=True)(count_lines_in_repo)
198
+
169
199
  repos_apps.command(name="cleanup", help="🧹 [n] Clean repository directories from cache files")(cleanup)
170
200
  repos_apps.command(name="n", help="Clean repository directories from cache files", hidden=True)(cleanup)
171
201
 
172
202
  mirror_app.command(name="capture", help="📝 [cap] Record repositories into a repos.json specification")(capture)
173
203
  mirror_app.command(name="cap", help="Record repositories into a repos.json specification", hidden=True)(capture)
204
+
174
205
  mirror_app.command(name="clone", help="📥 [clo] Clone repositories described by a repos.json specification")(clone)
175
206
  mirror_app.command(name="clo", help="Clone repositories described by a repos.json specification", hidden=True)(clone)
207
+
176
208
  mirror_app.command(name="checkout-to-commit", help="🔀 [ctc] Check out specific commits listed in the specification")(checkout_command)
177
209
  mirror_app.command(name="ctc", help="Check out specific commits listed in the specification", hidden=True)(checkout_command)
210
+
178
211
  mirror_app.command(name="checkout-to-branch", help="🔀 [ctb] Check out to the main branch defined in the specification")(checkout_to_branch_command)
179
212
  mirror_app.command(name="ctb", help="Check out to the main branch defined in the specification", hidden=True)(checkout_to_branch_command)
180
213
 
181
214
  return repos_apps
215
+