machineconfig 7.50__py3-none-any.whl → 8.12__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 (298) hide show
  1. machineconfig/cluster/remote/cloud_manager.py +1 -1
  2. machineconfig/cluster/sessions_managers/utils/maker.py +23 -11
  3. machineconfig/cluster/sessions_managers/wt_local_manager.py +22 -19
  4. machineconfig/cluster/sessions_managers/wt_remote_manager.py +3 -1
  5. machineconfig/cluster/sessions_managers/zellij_local_manager.py +3 -1
  6. machineconfig/cluster/sessions_managers/zellij_remote_manager.py +3 -2
  7. machineconfig/cluster/sessions_managers/zellij_utils/process_monitor.py +2 -2
  8. machineconfig/jobs/installer/installer_data.json +1185 -165
  9. machineconfig/jobs/installer/linux_scripts/q.sh +10 -7
  10. machineconfig/jobs/installer/linux_scripts/redis.sh +1 -0
  11. machineconfig/jobs/installer/package_groups.py +52 -84
  12. machineconfig/jobs/installer/powershell_scripts/install_fonts.ps1 +129 -34
  13. machineconfig/jobs/installer/{custom → python_scripts}/boxes.py +2 -2
  14. machineconfig/jobs/installer/{custom_dev → python_scripts}/brave.py +5 -3
  15. machineconfig/jobs/installer/python_scripts/cloudflare_warp_cli.py +23 -0
  16. machineconfig/jobs/installer/{custom_dev → python_scripts}/code.py +4 -1
  17. machineconfig/jobs/installer/{custom_dev → python_scripts}/dubdb_adbc.py +1 -1
  18. machineconfig/jobs/installer/{custom → python_scripts}/hx.py +16 -12
  19. machineconfig/jobs/installer/{custom_dev → python_scripts}/nerdfont.py +2 -2
  20. machineconfig/jobs/installer/{custom_dev → python_scripts}/nerfont_windows_helper.py +27 -22
  21. machineconfig/jobs/installer/python_scripts/sysabc.py +139 -0
  22. machineconfig/jobs/installer/{custom_dev → python_scripts}/wezterm.py +2 -19
  23. machineconfig/jobs/installer/{custom_dev → python_scripts}/winget.py +10 -14
  24. machineconfig/jobs/installer/python_scripts/yazi.py +121 -0
  25. machineconfig/{scripts/python/nw → jobs/scripts/bash_scripts}/mount_nfs +0 -1
  26. machineconfig/jobs/scripts/powershell_scripts/mount_ssh.ps1 +13 -0
  27. machineconfig/jobs/scripts/powershell_scripts/obs.ps1 +4 -0
  28. machineconfig/jobs/scripts_dynamic/a.py +25 -0
  29. machineconfig/logger.py +0 -1
  30. machineconfig/profile/create_helper.py +21 -22
  31. machineconfig/profile/create_links_export.py +25 -11
  32. machineconfig/profile/create_shell_profile.py +14 -3
  33. machineconfig/profile/mapper.toml +8 -6
  34. machineconfig/scripts/__init__.py +0 -4
  35. machineconfig/scripts/linux/wrap_mcfg +20 -21
  36. machineconfig/scripts/python/agents.py +74 -50
  37. machineconfig/scripts/python/ai/initai.py +1 -1
  38. machineconfig/scripts/python/ai/scripts/command_runner.ps1 +33 -0
  39. machineconfig/scripts/python/ai/{command_runner → scripts}/command_runner.sh +1 -1
  40. machineconfig/scripts/python/ai/scripts/lint_and_type_check.sh +1 -1
  41. machineconfig/scripts/python/ai/solutions/copilot/{chatmodes/Thinking-Beast-Mode.chatmode.md → agents/Thinking-Beast-Mode.agent.md} +0 -1
  42. machineconfig/scripts/python/ai/solutions/copilot/{chatmodes/Ultimate-Transparent-Thinking-Beast-Mode.chatmode.md → agents/Ultimate-Transparent-Thinking-Beast-Mode.agent.md} +0 -1
  43. machineconfig/scripts/python/ai/solutions/copilot/{chatmodes/deepResearch.chatmode.md → agents/deepResearch.agent.md} +2 -2
  44. machineconfig/scripts/python/ai/solutions/copilot/github_copilot.py +5 -5
  45. machineconfig/scripts/python/ai/solutions/copilot/instructions/python/dev.instructions.md +4 -0
  46. machineconfig/scripts/python/ai/solutions/copilot/instructions/python/watch_exec.prompt.md +20 -0
  47. machineconfig/scripts/python/ai/solutions/generic.py +1 -1
  48. machineconfig/scripts/python/ai/{generate_files.py → utils/generate_files.py} +2 -2
  49. machineconfig/scripts/python/cloud.py +6 -6
  50. machineconfig/scripts/python/croshell.py +67 -60
  51. machineconfig/scripts/python/devops.py +41 -21
  52. machineconfig/scripts/python/devops_navigator.py +0 -4
  53. machineconfig/scripts/python/env_manager/env_manager_tui.py +204 -0
  54. machineconfig/scripts/python/env_manager/path_manager_tui.py +1 -1
  55. machineconfig/scripts/python/fire_jobs.py +95 -67
  56. machineconfig/scripts/python/ftpx.py +44 -17
  57. machineconfig/scripts/python/helpers/ast_search.py +74 -0
  58. machineconfig/scripts/python/helpers/qr_code.py +166 -0
  59. machineconfig/scripts/python/helpers/repo_rag.py +325 -0
  60. machineconfig/scripts/python/helpers/symantic_search.py +25 -0
  61. machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_crush.json +1 -1
  62. machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_crush.py +9 -7
  63. machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_gemini.py +21 -8
  64. machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_qwen.py +0 -12
  65. machineconfig/scripts/python/helpers_agents/fire_agents_help_launch.py +30 -11
  66. machineconfig/scripts/python/helpers_agents/fire_agents_helper_types.py +9 -2
  67. machineconfig/scripts/python/helpers_agents/privacy/configs/aichat/config.yaml +5 -0
  68. machineconfig/scripts/python/helpers_agents/privacy/configs/aider/.aider.conf.yml +2 -0
  69. machineconfig/scripts/python/helpers_agents/privacy/configs/copilot/config.yml +1 -0
  70. machineconfig/scripts/python/helpers_agents/privacy/configs/crush/crush.json +10 -0
  71. machineconfig/scripts/python/helpers_agents/privacy/configs/gemini/settings.json +12 -0
  72. machineconfig/scripts/python/helpers_agents/privacy/privacy.py +109 -0
  73. machineconfig/scripts/python/helpers_agents/templates/prompt.txt +8 -4
  74. machineconfig/scripts/python/helpers_agents/templates/template.sh +18 -8
  75. machineconfig/scripts/python/helpers_cloud/cloud_copy.py +28 -21
  76. machineconfig/scripts/python/helpers_cloud/cloud_helpers.py +1 -1
  77. machineconfig/scripts/python/helpers_cloud/cloud_mount.py +19 -17
  78. machineconfig/scripts/python/helpers_cloud/cloud_sync.py +8 -7
  79. machineconfig/scripts/python/helpers_croshell/crosh.py +3 -3
  80. machineconfig/scripts/python/helpers_croshell/start_slidev.py +6 -7
  81. machineconfig/scripts/python/helpers_devops/cli_config.py +19 -25
  82. machineconfig/scripts/python/helpers_devops/cli_config_dotfile.py +22 -13
  83. machineconfig/scripts/python/helpers_devops/cli_nw.py +113 -26
  84. machineconfig/scripts/python/helpers_devops/cli_repos.py +37 -11
  85. machineconfig/scripts/python/helpers_devops/cli_self.py +84 -39
  86. machineconfig/scripts/python/helpers_devops/cli_share_file.py +9 -9
  87. machineconfig/scripts/python/helpers_devops/cli_share_server.py +13 -12
  88. machineconfig/scripts/python/helpers_devops/{cli_terminal.py → cli_share_terminal.py} +15 -17
  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/run_script.py +168 -0
  92. machineconfig/scripts/python/helpers_devops/themes/choose_wezterm_theme.py +1 -1
  93. machineconfig/scripts/python/helpers_fire_command/file_wrangler.py +2 -19
  94. machineconfig/scripts/python/helpers_fire_command/fire_jobs_args_helper.py +1 -0
  95. machineconfig/scripts/python/helpers_fire_command/fire_jobs_route_helper.py +25 -15
  96. machineconfig/scripts/python/helpers_msearch/scripts_linux/fzfg +3 -3
  97. machineconfig/scripts/python/helpers_msearch/scripts_windows/fzfg.ps1 +58 -1
  98. machineconfig/scripts/python/helpers_navigator/command_tree.py +50 -18
  99. machineconfig/scripts/python/helpers_network/address.py +176 -0
  100. machineconfig/scripts/python/helpers_network/address_switch.py +78 -0
  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/devops_add_identity.py → helpers_network/ssh_add_identity.py} +35 -1
  104. machineconfig/scripts/python/{nw/devops_add_ssh_key.py → helpers_network/ssh_add_ssh_key.py} +26 -7
  105. machineconfig/scripts/python/{nw → helpers_network}/ssh_debug_linux.py +7 -7
  106. machineconfig/scripts/python/{nw → helpers_network}/ssh_debug_windows.py +4 -4
  107. machineconfig/scripts/python/helpers_repos/clone.py +0 -1
  108. machineconfig/scripts/python/helpers_repos/cloud_repo_sync.py +13 -5
  109. machineconfig/scripts/python/helpers_repos/entrypoint.py +2 -1
  110. machineconfig/scripts/python/helpers_repos/record.py +2 -1
  111. machineconfig/scripts/python/helpers_repos/repo_analyzer_1.py +160 -0
  112. machineconfig/scripts/python/helpers_repos/{count_lines.py → repo_analyzer_2.py} +113 -192
  113. machineconfig/scripts/python/helpers_sessions/sessions_multiprocess.py +19 -13
  114. machineconfig/scripts/python/helpers_utils/download.py +150 -0
  115. machineconfig/scripts/python/helpers_utils/pdf.py +96 -0
  116. machineconfig/scripts/python/helpers_utils/python.py +187 -0
  117. machineconfig/scripts/python/interactive.py +17 -26
  118. machineconfig/scripts/python/{machineconfig.py → mcfg_entry.py} +4 -5
  119. machineconfig/scripts/python/msearch.py +57 -6
  120. machineconfig/scripts/python/sessions.py +100 -31
  121. machineconfig/scripts/python/terminal.py +26 -17
  122. machineconfig/scripts/python/utils.py +17 -15
  123. machineconfig/scripts/windows/wrap_mcfg.ps1 +6 -3
  124. machineconfig/settings/lf/windows/lfcd.ps1 +1 -1
  125. machineconfig/settings/linters/.ruff.toml +1 -1
  126. machineconfig/settings/shells/bash/init.sh +29 -2
  127. machineconfig/settings/shells/ipy/profiles/default/startup/playext.py +1 -1
  128. machineconfig/settings/shells/nushell/config.nu +2 -2
  129. machineconfig/settings/shells/nushell/env.nu +45 -6
  130. machineconfig/settings/shells/nushell/init.nu +282 -95
  131. machineconfig/settings/shells/pwsh/init.ps1 +1 -0
  132. machineconfig/settings/shells/wezterm/wezterm.lua +2 -0
  133. machineconfig/settings/shells/zsh/init.sh +1 -8
  134. machineconfig/settings/television/cable_unix/alias.toml +8 -0
  135. machineconfig/settings/television/cable_unix/aws-buckets.toml +14 -0
  136. machineconfig/settings/television/cable_unix/aws-instances.toml +13 -0
  137. machineconfig/settings/television/cable_unix/bash-history.toml +8 -0
  138. machineconfig/settings/television/cable_unix/channels.toml +19 -0
  139. machineconfig/settings/television/cable_unix/dirs.toml +13 -0
  140. machineconfig/settings/television/cable_unix/distrobox-list.toml +42 -0
  141. machineconfig/settings/television/cable_unix/docker-images.toml +13 -0
  142. machineconfig/settings/television/cable_unix/dotfiles.toml +11 -0
  143. machineconfig/settings/television/cable_unix/env.toml +17 -0
  144. machineconfig/settings/television/cable_unix/files.toml +11 -0
  145. machineconfig/settings/television/cable_unix/fish-history.toml +8 -0
  146. machineconfig/settings/television/cable_unix/git-branch.toml +11 -0
  147. machineconfig/settings/television/cable_unix/git-diff.toml +10 -0
  148. machineconfig/settings/television/cable_unix/git-log.toml +12 -0
  149. machineconfig/settings/television/cable_unix/git-reflog.toml +12 -0
  150. machineconfig/settings/television/cable_unix/git-repos.toml +16 -0
  151. machineconfig/settings/television/cable_unix/guix.toml +20 -0
  152. machineconfig/settings/television/cable_unix/just-recipes.toml +18 -0
  153. machineconfig/settings/television/cable_unix/k8s-deployments.toml +36 -0
  154. machineconfig/settings/television/cable_unix/k8s-pods.toml +50 -0
  155. machineconfig/settings/television/cable_unix/k8s-services.toml +36 -0
  156. machineconfig/settings/television/cable_unix/man-pages.toml +24 -0
  157. machineconfig/settings/television/cable_unix/nu-history.toml +7 -0
  158. machineconfig/settings/television/cable_unix/procs.toml +20 -0
  159. machineconfig/settings/television/cable_unix/text.toml +17 -0
  160. machineconfig/settings/television/cable_unix/tldr.toml +18 -0
  161. machineconfig/settings/television/cable_unix/zsh-history.toml +9 -0
  162. machineconfig/settings/television/cable_windows/alias.toml +7 -0
  163. machineconfig/settings/television/cable_windows/dirs.toml +13 -0
  164. machineconfig/settings/television/cable_windows/docker-images.toml +13 -0
  165. machineconfig/settings/television/cable_windows/dotfiles.toml +11 -0
  166. machineconfig/settings/television/cable_windows/env.toml +17 -0
  167. machineconfig/settings/television/cable_windows/files.toml +14 -0
  168. machineconfig/settings/television/cable_windows/git-branch.toml +11 -0
  169. machineconfig/settings/television/cable_windows/git-diff.toml +10 -0
  170. machineconfig/settings/television/cable_windows/git-log.toml +11 -0
  171. machineconfig/settings/television/cable_windows/git-reflog.toml +11 -0
  172. machineconfig/settings/television/cable_windows/git-repos.toml +15 -0
  173. machineconfig/settings/television/cable_windows/nu-history.toml +7 -0
  174. machineconfig/settings/television/cable_windows/pwsh-history.toml +6 -0
  175. machineconfig/settings/television/cable_windows/text.toml +17 -0
  176. machineconfig/settings/wt/__init__.py +0 -0
  177. machineconfig/settings/yazi/init.lua +49 -24
  178. machineconfig/settings/yazi/keymap_linux.toml +19 -4
  179. machineconfig/settings/yazi/keymap_windows.toml +0 -1
  180. machineconfig/settings/yazi/shell/yazi_cd.ps1 +29 -5
  181. machineconfig/settings/yazi/theme.toml +4 -0
  182. machineconfig/settings/yazi/yazi_linux.toml +84 -0
  183. machineconfig/settings/yazi/yazi_windows.toml +58 -0
  184. machineconfig/settings/zellij/layouts/st.kdl +39 -8
  185. machineconfig/setup_linux/__init__.py +1 -2
  186. machineconfig/setup_linux/apps_desktop.sh +8 -27
  187. machineconfig/setup_linux/web_shortcuts/interactive.sh +12 -10
  188. machineconfig/setup_linux/web_shortcuts/live_from_github.sh +31 -0
  189. machineconfig/setup_mac/__init__.py +2 -3
  190. machineconfig/setup_windows/__init__.py +3 -5
  191. machineconfig/setup_windows/ssh/openssh-server.ps1 +1 -1
  192. machineconfig/setup_windows/uv.ps1 +8 -1
  193. machineconfig/setup_windows/web_shortcuts/interactive.ps1 +12 -10
  194. machineconfig/setup_windows/web_shortcuts/live_from_github.ps1 +30 -0
  195. machineconfig/setup_windows/web_shortcuts/quick_init.ps1 +17 -0
  196. machineconfig/utils/accessories.py +7 -4
  197. machineconfig/utils/code.py +39 -11
  198. machineconfig/utils/files/headers.py +2 -2
  199. machineconfig/utils/installer_utils/github_release_bulk.py +156 -119
  200. machineconfig/utils/installer_utils/install_from_url.py +183 -0
  201. machineconfig/utils/installer_utils/installer_class.py +43 -100
  202. machineconfig/utils/installer_utils/installer_cli.py +175 -0
  203. machineconfig/utils/installer_utils/installer_helper.py +129 -0
  204. machineconfig/utils/installer_utils/{installer_abc.py → installer_locator_utils.py} +36 -85
  205. machineconfig/utils/{installer.py → installer_utils/installer_runner.py} +16 -59
  206. machineconfig/utils/io.py +0 -1
  207. machineconfig/utils/links.py +2 -2
  208. machineconfig/utils/meta.py +30 -16
  209. machineconfig/utils/options.py +42 -24
  210. machineconfig/utils/options_tv.py +119 -0
  211. machineconfig/utils/path_extended.py +42 -20
  212. machineconfig/utils/path_helper.py +75 -22
  213. machineconfig/utils/procs.py +1 -1
  214. machineconfig/utils/scheduler.py +20 -53
  215. machineconfig/utils/schemas/layouts/layout_types.py +1 -1
  216. machineconfig/utils/ssh.py +159 -418
  217. machineconfig/utils/ssh_utils/abc.py +5 -0
  218. machineconfig/utils/ssh_utils/copy_from_here.py +111 -0
  219. machineconfig/utils/ssh_utils/copy_to_here.py +303 -0
  220. machineconfig/utils/ssh_utils/utils.py +142 -0
  221. machineconfig/utils/ssh_utils/wsl.py +210 -0
  222. machineconfig/utils/terminal.py +1 -0
  223. machineconfig/utils/upgrade_packages.py +6 -1
  224. machineconfig/utils/ve.py +12 -4
  225. machineconfig-8.12.dist-info/METADATA +132 -0
  226. {machineconfig-7.50.dist-info → machineconfig-8.12.dist-info}/RECORD +265 -215
  227. {machineconfig-7.50.dist-info → machineconfig-8.12.dist-info}/entry_points.txt +2 -4
  228. machineconfig/jobs/installer/linux_scripts/pgsql.sh +0 -41
  229. machineconfig/jobs/installer/linux_scripts/timescaledb.sh +0 -71
  230. machineconfig/jobs/installer/powershell_scripts/archive_pygraphviz.ps1 +0 -12
  231. machineconfig/jobs/installer/powershell_scripts/openssh-server_add_key.ps1 +0 -7
  232. machineconfig/jobs/installer/powershell_scripts/openssh-server_copy-ssh-id.ps1 +0 -14
  233. machineconfig/scripts/linux/other/switch_ip +0 -20
  234. machineconfig/scripts/python/ai/command_runner/prompt.txt +0 -9
  235. machineconfig/scripts/python/define.py +0 -31
  236. machineconfig/scripts/python/explore.py +0 -49
  237. machineconfig/scripts/python/helpers_devops/cli_utils.py +0 -246
  238. machineconfig/scripts/python/helpers_msearch/scripts_linux/fzfag +0 -17
  239. machineconfig/scripts/python/helpers_msearch/scripts_linux/fzfrga +0 -21
  240. machineconfig/scripts/python/helpers_msearch/scripts_linux/skrg +0 -4
  241. machineconfig/scripts/python/helpers_msearch/scripts_windows/fzfb.ps1 +0 -3
  242. machineconfig/scripts/python/helpers_msearch/scripts_windows/fzfrga.bat +0 -20
  243. machineconfig/scripts/python/helpers_repos/count_lines_frontend.py +0 -17
  244. machineconfig/scripts/python/nw/add_ssh_key.py +0 -148
  245. machineconfig/scripts/python/nw/wsl_windows_transfer.py +0 -66
  246. machineconfig/scripts/windows/mounts/mount_ssh.ps1 +0 -13
  247. machineconfig/settings/lf/linux/exe/fzf_nano.sh +0 -16
  248. machineconfig/settings/lf/windows/fzf_edit.ps1 +0 -6
  249. machineconfig/settings/lf/windows/tst.ps1 +0 -1
  250. machineconfig/settings/yazi/yazi.toml +0 -17
  251. machineconfig/setup_linux/apps.sh +0 -66
  252. machineconfig/setup_linux/others/cli_installation.sh +0 -137
  253. machineconfig/setup_linux/ssh/openssh_all.sh +0 -25
  254. machineconfig/setup_linux/ssh/openssh_wsl.sh +0 -38
  255. machineconfig/setup_mac/apps.sh +0 -73
  256. machineconfig/setup_windows/apps.ps1 +0 -62
  257. machineconfig/setup_windows/others/obs.ps1 +0 -4
  258. machineconfig/setup_windows/ssh/add_identity.ps1 +0 -11
  259. machineconfig/utils/installer_utils/installer.py +0 -221
  260. machineconfig-7.50.dist-info/METADATA +0 -92
  261. /machineconfig/jobs/installer/linux_scripts/{warp-cli.sh → cloudflare_warp_cli.sh} +0 -0
  262. /machineconfig/jobs/installer/{custom_dev → python_scripts}/__init__.py +0 -0
  263. /machineconfig/jobs/installer/{custom_dev → python_scripts}/alacritty.py +0 -0
  264. /machineconfig/jobs/installer/{custom_dev → python_scripts}/bypass_paywall.py +0 -0
  265. /machineconfig/jobs/installer/{custom_dev → python_scripts}/cursor.py +0 -0
  266. /machineconfig/jobs/installer/{custom_dev → python_scripts}/espanso.py +0 -0
  267. /machineconfig/jobs/installer/{custom → python_scripts}/gh.py +0 -0
  268. /machineconfig/jobs/installer/{custom_dev → python_scripts}/goes.py +0 -0
  269. /machineconfig/jobs/installer/{custom_dev → python_scripts}/lvim.py +0 -0
  270. /machineconfig/jobs/installer/{custom_dev → python_scripts}/redis.py +0 -0
  271. /machineconfig/{setup_linux/others → jobs/scripts/bash_scripts}/android.sh +0 -0
  272. /machineconfig/jobs/{installer/linux_scripts → scripts/bash_scripts}/lid.sh +0 -0
  273. /machineconfig/{setup_linux/others → jobs/scripts/bash_scripts}/mint_keyboard_shortcuts.sh +0 -0
  274. /machineconfig/{scripts/python/nw → jobs/scripts/bash_scripts}/mount_drive +0 -0
  275. /machineconfig/{scripts/python/nw → jobs/scripts/bash_scripts}/mount_nw_drive +0 -0
  276. /machineconfig/{scripts/python/nw → jobs/scripts/bash_scripts}/mount_smb +0 -0
  277. /machineconfig/{scripts/linux/other → jobs/scripts/bash_scripts}/share_cloud.sh +0 -0
  278. /machineconfig/{scripts/linux/other → jobs/scripts/bash_scripts}/share_nfs +0 -0
  279. /machineconfig/{scripts/linux/other → jobs/scripts/bash_scripts}/start_docker +0 -0
  280. /machineconfig/{scripts → jobs/scripts/powershell_scripts}/Restore-ThunderbirdProfile.ps1 +0 -0
  281. /machineconfig/{setup_windows/others → jobs/scripts/powershell_scripts}/docker.ps1 +0 -0
  282. /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/mount_nfs.ps1 +0 -0
  283. /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/mount_nw.ps1 +0 -0
  284. /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/mount_smb.ps1 +0 -0
  285. /machineconfig/{setup_windows/others → jobs/scripts/powershell_scripts}/power_options.ps1 +0 -0
  286. /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/share_cloud.cmd +0 -0
  287. /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/share_smb.ps1 +0 -0
  288. /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/unlock_bitlocker.ps1 +0 -0
  289. /machineconfig/scripts/python/{nw → ai/utils}/__init__.py +0 -0
  290. /machineconfig/scripts/python/ai/{vscode_tasks.py → utils/vscode_tasks.py} +0 -0
  291. /machineconfig/{settings/shells/pwsh/profile.ps1 → scripts/python/helpers_fire_command/f.py} +0 -0
  292. /machineconfig/{setup_windows/wt_and_pwsh → scripts/python/helpers_network}/__init__.py +0 -0
  293. /machineconfig/scripts/python/{nw → helpers_network}/mount_nw_drive.py +0 -0
  294. /machineconfig/scripts/python/{nw → helpers_network}/onetimeshare.py +0 -0
  295. /machineconfig/scripts/python/{nw → helpers_network}/wifi_conn.py +0 -0
  296. /machineconfig/{setup_windows/wt_and_pwsh → settings/wt}/set_wt_settings.py +0 -0
  297. {machineconfig-7.50.dist-info → machineconfig-8.12.dist-info}/WHEEL +0 -0
  298. {machineconfig-7.50.dist-info → machineconfig-8.12.dist-info}/top_level.txt +0 -0
@@ -1,23 +1,36 @@
1
1
 
2
2
  import machineconfig.scripts.python.helpers_devops.cli_share_file
3
- import machineconfig.scripts.python.helpers_devops.cli_terminal as cli_terminal
3
+ import machineconfig.scripts.python.helpers_devops.cli_share_terminal as cli_share_terminal
4
4
  import machineconfig.scripts.python.helpers_devops.cli_share_server as cli_share_server
5
5
  import typer
6
6
  from typing import Optional, Annotated
7
7
 
8
8
 
9
+ def switch_public_ip_address(
10
+ wait_seconds: Annotated[float, typer.Option(..., "--wait", "-w", help="Seconds to wait between steps")] = 2.0,
11
+ max_trials: Annotated[int, typer.Option(..., "--max-trials", "-m", help="Max number of switch attempts")] = 10,
12
+ ) -> None:
13
+ """🔁 Switch public IP address (Cloudflare WARP)"""
14
+ import machineconfig.scripts.python.helpers_network.address_switch as helper
15
+ helper.switch_public_ip_address(max_trials=max_trials, wait_seconds=wait_seconds)
16
+
9
17
 
10
18
  def install_ssh_server():
11
- """📡 SSH install server"""
19
+ """📡 SSH install server""" # VRPR66JD$X3FQ3
12
20
  import platform
13
21
  if platform.system() == "Windows":
14
22
  from machineconfig.setup_windows import SSH_SERVER
23
+ script = SSH_SERVER.read_text(encoding="utf-8")
15
24
  elif platform.system() == "Linux" or platform.system() == "Darwin":
16
- from machineconfig.setup_linux import SSH_SERVER
25
+ script = """
26
+ sudo nala install openssh-server -y || true # try to install first
27
+ # sudo nala purge openssh-server -y
28
+ # sudo nala install openssh-server -y
29
+ echo "✅ FINISHED installing openssh-server."""
17
30
  else:
18
31
  raise NotImplementedError(f"Platform {platform.system()} is not supported.")
19
32
  from machineconfig.utils.code import run_shell_script
20
- run_shell_script(script=SSH_SERVER.read_text(encoding="utf-8"))
33
+ run_shell_script(script=script)
21
34
 
22
35
 
23
36
  def add_ssh_key(path: Annotated[Optional[str], typer.Option(..., help="Path to the public key file")] = None,
@@ -26,31 +39,70 @@ def add_ssh_key(path: Annotated[Optional[str], typer.Option(..., help="Path to t
26
39
  github: Annotated[Optional[str], typer.Option(..., "--github", "-g", help="Fetch public keys from a GitHub username")] = None
27
40
  ):
28
41
  """🔑 SSH add pub key to this machine so its accessible by owner of corresponding private key."""
29
- import machineconfig.scripts.python.nw.devops_add_ssh_key as helper
42
+ import machineconfig.scripts.python.helpers_network.ssh_add_ssh_key as helper
30
43
  helper.main(pub_path=path, pub_choose=choose, pub_val=value, from_github=github)
31
44
  def add_ssh_identity():
32
45
  """🗝️ SSH add identity (private key) to this machine"""
33
- import machineconfig.scripts.python.nw.devops_add_identity as helper
46
+ import machineconfig.scripts.python.helpers_network.ssh_add_identity as helper
34
47
  helper.main()
35
48
 
36
49
 
37
- def show_address():
38
- import socket
39
- s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
40
- s.connect(('8.8.8.8',80))
41
- local_ip_v4 = s.getsockname()[0]
42
- s.close()
43
- print(f"This computer is @ {local_ip_v4}")
50
+ def show_address() -> None:
51
+ """📌 Show this computer addresses on network"""
52
+ import machineconfig.scripts.python.helpers_network.address as helper
53
+ loaded_json = helper.get_public_ip_address()
54
+ from rich import print_json
55
+ print_json(data=loaded_json)
56
+
57
+ from rich.table import Table
58
+ from rich.console import Console
59
+ res = helper.get_all_ipv4_addresses()
60
+ res.append( ("Public IP", loaded_json.get("ip", "N/A")))
61
+
62
+ # loc = loaded_json["loc"]
63
+ # 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"""
64
+ # from machineconfig.utils.code import run_shell_script
65
+ # run_shell_script(script=cmd)
66
+
67
+ table = Table(title="Network Interfaces")
68
+ table.add_column("Interface", style="cyan")
69
+ table.add_column("IP Address", style="green")
70
+
71
+ for iface, ip in res:
72
+ table.add_row(iface, ip)
73
+
74
+ console = Console()
75
+ console.print(table)
76
+
77
+ res = helper.select_lan_ipv4(prefer_vpn=False)
78
+ if res is not None:
79
+ # ip, iface = res
80
+ # print(f"Selected IP: {ip} on interface: {iface}")
81
+ print(f"LAN IPv4: {res}")
82
+ else:
83
+ print("No network interfaces found.")
84
+
85
+
86
+
87
+ def bind_wsl_port(port: Annotated[int, typer.Option(..., "--port", "-p", help="Port number to bind")]):
88
+ code = f"""
89
+
90
+ $wsl_ip = (wsl.exe hostname -I).Trim().Split(' ')[0]
91
+ netsh interface portproxy add v4tov4 listenport={port} listenaddress=0.0.0.0 connectport={port} connectaddress=$wsl_ip
92
+
93
+ """
94
+ from machineconfig.utils.code import exit_then_run_shell_script
95
+ exit_then_run_shell_script(code)
44
96
 
45
97
 
46
98
  def debug_ssh():
47
99
  """🐛 SSH debug"""
48
100
  from platform import system
49
101
  if system() == "Linux" or system() == "Darwin":
50
- import machineconfig.scripts.python.nw.ssh_debug_linux as helper
102
+ import machineconfig.scripts.python.helpers_network.ssh_debug_linux as helper
51
103
  helper.ssh_debug_linux()
52
104
  elif system() == "Windows":
53
- import machineconfig.scripts.python.nw.ssh_debug_windows as helper
105
+ import machineconfig.scripts.python.helpers_network.ssh_debug_windows as helper
54
106
  helper.ssh_debug_windows()
55
107
  else:
56
108
  raise NotImplementedError(f"Platform {system()} is not supported.")
@@ -64,7 +116,7 @@ def wifi_select(
64
116
  from rich.panel import Panel
65
117
  from rich.prompt import Confirm
66
118
  from rich.console import Console
67
- from machineconfig.scripts.python.nw.wifi_conn import try_config_connection, manual_network_selection, display_available_networks
119
+ from machineconfig.scripts.python.helpers_network.wifi_conn import try_config_connection, manual_network_selection, display_available_networks
68
120
  console = Console()
69
121
  console.print(Panel("📶 Welcome to the WiFi Connector Tool", title="[bold blue]WiFi Connection[/bold blue]", border_style="blue"))
70
122
 
@@ -101,34 +153,69 @@ def wifi_select(
101
153
  console.print("[blue]👋 Goodbye![/blue]")
102
154
 
103
155
 
156
+
157
+ def reset_cloudflare_tunnel():
158
+ code = """
159
+ # cloudflared tunnel route dns glenn # creates CNAMES in Cloudflare dashboard
160
+ # sudo systemctl stop cloudflared
161
+ # test: cloudflared tunnel run glenn
162
+ home_dir=$HOME
163
+ cloudflared_path="$home_dir/.local/bin/cloudflared"
164
+ sudo $cloudflared_path service uninstall
165
+ sudo rm /etc/cloudflared/config.yml || true
166
+ sudo $cloudflared_path --config $home_dir/.cloudflared/config.yml service install
167
+ """
168
+ print(code)
169
+ def add_ip_exclusion_to_warp(ip: Annotated[str, typer.Option(..., "--ip", help="IP address to exclude from WARP")]):
170
+ code = f"""
171
+ sudo warp-cli tunnel ip add {ip}
172
+ sudo warp-cli disconnect
173
+ sudo warp-cli connect
174
+ """
175
+ print(code)
176
+
177
+
104
178
  def get_app():
105
179
  nw_apps = typer.Typer(help="🔐 [n] Network subcommands", no_args_is_help=True, add_help_option=False, add_completion=False)
106
- nw_apps.command(name="share-terminal", help="📡 [t] Share terminal via web browser")(cli_terminal.main)
107
- nw_apps.command(name="t", help="Share terminal via web browser", hidden=True)(cli_terminal.main)
180
+ nw_apps.command(name="share-terminal", help="📡 [t] Share terminal via web browser")(cli_share_terminal.share_terminal)
181
+ nw_apps.command(name="t", help="Share terminal via web browser", hidden=True)(cli_share_terminal.share_terminal)
108
182
 
109
- 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)
183
+ 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)
110
184
  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)
111
185
 
112
186
  # app = cli_share_server.get_share_file_app()
113
- # nw_apps.add_typer(app, name="share-file", help="📁 [f] Share a file via relay server", no_args_is_help=True)
187
+ # nw_apps.add_typer(app, name="share-file", help="📁 [f] Share a file via relay server", no_args_is_help=True)
114
188
  # nw_apps.add_typer(app, name="f", help="Share a file via relay server", hidden=True, no_args_is_help=True)
115
189
  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)
116
190
  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)
117
191
  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)
118
192
  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)
119
193
 
120
- nw_apps.command(name="install-ssh-server", help="📡 [i] Install SSH server")(install_ssh_server)
194
+ nw_apps.command(name="install-ssh-server", help="📡 [i] Install SSH server")(install_ssh_server)
121
195
  nw_apps.command(name="i", help="Install SSH server", hidden=True)(install_ssh_server)
122
- nw_apps.command(name="add-ssh-key", help="🔑 [k] Add SSH public key to this machine", no_args_is_help=True)(add_ssh_key)
196
+ nw_apps.command(name="add-ssh-key", help="🔑 [k] Add SSH public key to this machine", no_args_is_help=True)(add_ssh_key)
123
197
  nw_apps.command(name="k", help="Add SSH public key to this machine", hidden=True, no_args_is_help=True)(add_ssh_key)
124
- nw_apps.command(name="add-ssh-identity", help="🗝️ [A] Add SSH identity (private key) to this machine")(add_ssh_identity)
198
+ nw_apps.command(name="add-ssh-identity", help="🗝️ [A] Add SSH identity (private key) to this machine")(add_ssh_identity)
125
199
  nw_apps.command(name="A", help="Add SSH identity (private key) to this machine", hidden=True)(add_ssh_identity)
126
- nw_apps.command(name="show-address", help="📌 [a] Show this computer addresses on network")(show_address)
200
+
201
+ nw_apps.command(name="show-address", help="📌 [a] Show this computer addresses on network")(show_address)
127
202
  nw_apps.command(name="a", help="Show this computer addresses on network", hidden=True)(show_address)
128
- nw_apps.command(name="debug-ssh", help="🐛 [d] Debug SSH connection")(debug_ssh)
203
+
204
+ nw_apps.command(name="switch-public-ip", help="🔁 [c] Switch public IP address (Cloudflare WARP)")(switch_public_ip_address)
205
+ nw_apps.command(name="c", help="Switch public IP address (Cloudflare WARP)", hidden=True)(switch_public_ip_address)
206
+
207
+ nw_apps.command(name="debug-ssh", help="🐛 [d] Debug SSH connection")(debug_ssh)
129
208
  nw_apps.command(name="d", help="Debug SSH connection", hidden=True)(debug_ssh)
130
209
 
131
- nw_apps.command(name="wifi-select", no_args_is_help=True, help="📶 WiFi connection utility.")(wifi_select)
210
+ nw_apps.command(name="wifi-select", no_args_is_help=True, help="📶 [w] WiFi connection utility.")(wifi_select)
132
211
  nw_apps.command(name="w", no_args_is_help=True, hidden=True)(wifi_select)
133
212
 
213
+ nw_apps.command(name="bind-wsl-port", help="🔌 [b] Bind WSL port to Windows host", no_args_is_help=True)(bind_wsl_port)
214
+ nw_apps.command(name="b", help="Bind WSL port to Windows host", hidden=True, no_args_is_help=True)(bind_wsl_port)
215
+
216
+ nw_apps.command(name="reset-cloudflare-tunnel", help="☁️ [r] Reset Cloudflare tunnel service")(reset_cloudflare_tunnel)
217
+ nw_apps.command(name="r", help="Reset Cloudflare tunnel service", hidden=True)(reset_cloudflare_tunnel)
218
+ nw_apps.command(name="add-ip-exclusion-to-warp", help="🚫 [p] Add IP exclusion to WARP")(add_ip_exclusion_to_warp)
219
+ nw_apps.command(name="p", help="Add IP exclusion to WARP", hidden=True)(add_ip_exclusion_to_warp)
220
+
134
221
  return nw_apps
@@ -71,14 +71,31 @@ 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>=8.12"])
79
80
 
80
81
 
81
- def viz(
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]>=8.12"])
88
+
89
+
90
+ def analyze_repo_development(repo_path: Annotated[str, typer.Argument(..., help="Path to the git repository")]):
91
+ def func(repo_path: str):
92
+ from machineconfig.scripts.python.helpers_repos.repo_analyzer_2 import analyze_over_time
93
+ analyze_over_time(repo_path=repo_path)
94
+ from machineconfig.utils.code import run_lambda_function
95
+ run_lambda_function(lambda: func(repo_path=repo_path), uv_project_dir=None, uv_with=["machineconfig[plot]>=8.12"])
96
+
97
+
98
+ def gource_viz(
82
99
  repo: Annotated[str, typer.Option(..., "--repo", "-r", help="Path to git repository to visualize")] = ".",
83
100
  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
101
  resolution: Annotated[str, typer.Option(..., "--resolution", "-res", help="Video resolution (e.g., 1920x1080, 1280x720)")] = "1920x1080",
@@ -159,22 +176,31 @@ def get_app():
159
176
  repos_apps.command(name="commit", help="💾 [c] Commit changes across repositories")(commit)
160
177
  repos_apps.command(name="c", help="Commit changes across repositories", hidden=True)(commit)
161
178
  repos_apps.command(name="sync", help="🔄 [y] Pull, commit, and push changes across repositories")(sync)
162
- 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)
179
+ repos_apps.command(name="y", help="Pull, commit, and push changes across repositories", hidden=True)(sync)
180
+ repos_apps.command(name="analyze", help="📊 [a] Analyze repository development over time")(analyze_repo_development)
181
+ repos_apps.command(name="a", help="Analyze repository development over time", hidden=True)(analyze_repo_development)
182
+
165
183
  repos_apps.command(name="secure", help="🔐 [s] Securely sync git repository to/from cloud with encryption")(secure_repo_main)
166
184
  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)
185
+
186
+ repos_apps.command(name="viz", help="🎬 [v] Visualize repository activity using Gource")(gource_viz)
187
+ repos_apps.command(name="v", help="Visualize repository activity using Gource", hidden=True)(gource_viz)
188
+
189
+ repos_apps.command(name="count-lines", help="📄 [l] Count python lines of code in current repo + historical edits.")(count_lines_in_repo)
190
+ repos_apps.command(name="l", help="Count python lines of code in current repo + historical edits.", hidden=True)(count_lines_in_repo)
191
+
169
192
  repos_apps.command(name="cleanup", help="🧹 [n] Clean repository directories from cache files")(cleanup)
170
193
  repos_apps.command(name="n", help="Clean repository directories from cache files", hidden=True)(cleanup)
171
194
 
172
195
  mirror_app.command(name="capture", help="📝 [cap] Record repositories into a repos.json specification")(capture)
173
196
  mirror_app.command(name="cap", help="Record repositories into a repos.json specification", hidden=True)(capture)
197
+
174
198
  mirror_app.command(name="clone", help="📥 [clo] Clone repositories described by a repos.json specification")(clone)
175
199
  mirror_app.command(name="clo", help="Clone repositories described by a repos.json specification", hidden=True)(clone)
200
+
176
201
  mirror_app.command(name="checkout-to-commit", help="🔀 [ctc] Check out specific commits listed in the specification")(checkout_command)
177
202
  mirror_app.command(name="ctc", help="Check out specific commits listed in the specification", hidden=True)(checkout_command)
203
+
178
204
  mirror_app.command(name="checkout-to-branch", help="🔀 [ctb] Check out to the main branch defined in the specification")(checkout_to_branch_command)
179
205
  mirror_app.command(name="ctb", help="Check out to the main branch defined in the specification", hidden=True)(checkout_to_branch_command)
180
206
 
@@ -1,6 +1,6 @@
1
1
 
2
2
  import typer
3
- from typing import Optional, Annotated
3
+ from typing import Annotated, Literal
4
4
 
5
5
 
6
6
  def copy_both_assets():
@@ -9,7 +9,59 @@ def copy_both_assets():
9
9
  create_helper.copy_assets_to_machine(which="settings")
10
10
 
11
11
 
12
- def update(copy_assets: Annotated[bool, typer.Option("--assets-copy/--no-assets-copy", "-a/-na", help="Copy (overwrite) assets to the machine after the update")] = True):
12
+ def init(which: Annotated[Literal["init", "ia", "live", "wrap"], typer.Argument(..., help="Comma-separated list of script names to run all initialization scripts.")] = "init",
13
+ run: Annotated[bool, typer.Option("--run/--no-run", "-r/-nr", help="Run the script after displaying it.")] = False,
14
+ ) -> None:
15
+ import platform
16
+ if platform.system() == "Linux" or platform.system() == "Darwin":
17
+ match which:
18
+ case "init":
19
+ import machineconfig.settings as module
20
+ from pathlib import Path
21
+ if platform.system() == "Darwin":
22
+ init_path = Path(module.__file__).parent.joinpath("shells", "zsh", "init.sh")
23
+ else: init_path = Path(module.__file__).parent.joinpath("shells", "bash", "init.sh")
24
+ script = init_path.read_text(encoding="utf-8")
25
+ case "ia":
26
+ from machineconfig.setup_linux import INTERACTIVE as script_path
27
+ script = script_path.read_text(encoding="utf-8")
28
+ case "live":
29
+ from machineconfig.setup_linux import LIVE as script_path
30
+ script = script_path.read_text(encoding="utf-8")
31
+ case _:
32
+ typer.echo("Unsupported shell script for Linux.")
33
+ raise typer.Exit(code=1)
34
+
35
+ elif platform.system() == "Windows":
36
+ match which:
37
+ case "init":
38
+ import machineconfig.settings as module
39
+ from pathlib import Path
40
+ init_path = Path(module.__file__).parent.joinpath("shells", "powershell", "init.ps1")
41
+ script = init_path.read_text(encoding="utf-8")
42
+ case "ia":
43
+ from machineconfig.setup_windows import INTERACTIVE as script_path
44
+ script = script_path.read_text(encoding="utf-8")
45
+ case "live":
46
+ from machineconfig.setup_windows import LIVE as script_path
47
+ script = script_path.read_text(encoding="utf-8")
48
+ case _:
49
+ typer.echo("Unsupported shell script for Windows.")
50
+ raise typer.Exit(code=1)
51
+ else:
52
+ # raise NotImplementedError("Unsupported platform")
53
+ typer.echo("Unsupported platform for init scripts.")
54
+ raise typer.Exit(code=1)
55
+ if run:
56
+ from machineconfig.utils.code import exit_then_run_shell_script
57
+ exit_then_run_shell_script(script, strict=True)
58
+ else:
59
+ print(script)
60
+
61
+
62
+ def update(copy_assets: Annotated[bool, typer.Option("--assets-copy/--no-assets-copy", "-a/-na", help="Copy (overwrite) assets to the machine after the update")] = True,
63
+ link_public_configs: Annotated[bool, typer.Option("--link-public-configs/--no-link-public-configs", "-b/-nb", help="Link public configs after update (overwrites your configs!)")] = False,
64
+ ):
13
65
  """🔄 UPDATE uv and machineconfig"""
14
66
  from pathlib import Path
15
67
  if Path.home().joinpath("code", "machineconfig").exists():
@@ -28,27 +80,30 @@ uv tool install --upgrade machineconfig
28
80
  if platform.system() == "Windows":
29
81
  from machineconfig.utils.code import exit_then_run_shell_script, get_uv_command_executing_python_script
30
82
  from machineconfig.utils.meta import lambda_to_python_script
31
- python_script = lambda_to_python_script(lambda: copy_both_assets(), in_global=True, import_module=False)
83
+ python_script = lambda_to_python_script(lambda: copy_both_assets(),
84
+ in_global=True, import_module=False)
32
85
  uv_command, _py_file = get_uv_command_executing_python_script(python_script=python_script, uv_with=["machineconfig"], uv_project_dir=None)
33
86
  exit_then_run_shell_script(shell_script + "\n" + uv_command, strict=True)
34
87
  else:
35
88
  from machineconfig.utils.code import run_shell_script
36
89
  run_shell_script(shell_script)
37
- if copy_assets:
38
- copy_both_assets()
90
+ if copy_assets:
91
+ copy_both_assets()
92
+ if link_public_configs:
93
+ import machineconfig.profile.create_links_export as create_links_export
94
+ create_links_export.main_public_from_parser(method="copy", on_conflict="overwrite-default-path", which="all", interactive=False)
95
+
39
96
 
40
97
  def install(no_copy_assets: Annotated[bool, typer.Option("--no-assets-copy", "-na", help="Copy (overwrite) assets to the machine after the update")] = False):
41
98
  """📋 CLONE machienconfig locally and incorporate to shell profile for faster execution and nightly updates."""
42
- from machineconfig.utils.code import run_shell_script
99
+ from machineconfig.utils.code import run_shell_script, get_uv_run_command
43
100
  from pathlib import Path
101
+ import platform
102
+ uv_run_command = get_uv_run_command(platform=platform.system()) # type: ignore
44
103
  if Path.home().joinpath("code/machineconfig").exists():
45
- run_shell_script(f"""$HOME/.local/bin/uv tool install --upgrade --editable "{str(Path.home().joinpath("code/machineconfig"))}" """)
104
+ run_shell_script(f""" {uv_run_command} tool install --upgrade --editable "{str(Path.home().joinpath("code/machineconfig"))}" """)
46
105
  else:
47
- import platform
48
- if platform.system() == "Windows":
49
- run_shell_script(r"""& "$HOME\.local\bin\uv.exe" tool install --upgrade "machineconfig>=7.50" """)
50
- else:
51
- run_shell_script("""$HOME/.local/bin/uv tool install --upgrade "machineconfig>=7.50" """)
106
+ run_shell_script(rf""" {uv_run_command} tool install --upgrade "machineconfig>=8.12" """)
52
107
  from machineconfig.profile.create_shell_profile import create_default_shell_profile
53
108
  if not no_copy_assets:
54
109
  create_default_shell_profile() # involves copying assets too
@@ -71,22 +126,11 @@ def navigate():
71
126
  import machineconfig.scripts.python as navigator
72
127
  from pathlib import Path
73
128
  path = Path(navigator.__file__).resolve().parent.joinpath("devops_navigator.py")
74
- from machineconfig.utils.code import run_shell_script
129
+ from machineconfig.utils.code import exit_then_run_shell_script
75
130
  if Path.home().joinpath("code/machineconfig").exists(): executable = f"""--project "{str(Path.home().joinpath("code/machineconfig"))}" --with textual"""
76
- else: executable = """--with "machineconfig>=7.50,textual" """
77
- run_shell_script(f"""uv run {executable} {path}""")
78
-
79
-
80
- def run_python(ip: Annotated[str, typer.Argument(..., help="Python command to run in the machineconfig environment")],
81
- command: Annotated[Optional[bool], typer.Option(..., "--command", "-c", help="Run as command")] = False):
82
- """🐍 RUN python command/file in the machineconfig environment"""
83
- if command:
84
- exec(ip)
85
- return
86
- import machineconfig
87
- import subprocess
88
- import sys
89
- subprocess.run([sys.executable, ip], cwd=machineconfig.__path__[0])
131
+ else: executable = """--with "machineconfig>=8.12,textual" """
132
+ exit_then_run_shell_script(f"""uv run {executable} {path}""")
133
+
90
134
  def readme():
91
135
  from rich.console import Console
92
136
  from rich.markdown import Markdown
@@ -109,19 +153,20 @@ def readme():
109
153
 
110
154
  def get_app():
111
155
  cli_app = typer.Typer(help="🔄 [s] self operations subcommands", no_args_is_help=True, add_help_option=False, add_completion=False)
112
- cli_app.command("update", no_args_is_help=False, help="🔄 [u] UPDATE machineconfig")(update)
113
- cli_app.command("u", no_args_is_help=False, hidden=True)(update)
114
- cli_app.command("interactive", no_args_is_help=False, help="🤖 [i] INTERACTIVE configuration of machine.")(interactive)
115
- cli_app.command("i", no_args_is_help=False, help="INTERACTIVE configuration of machine.", hidden=True)(interactive)
116
- cli_app.command("status", no_args_is_help=False, help="📊 [s] STATUS of machine, shell profile, apps, symlinks, dotfiles, etc.")(status)
117
- cli_app.command("s", no_args_is_help=False, help="STATUS of machine, shell profile, apps, symlinks, dotfiles, etc.", hidden=True)(status)
118
- cli_app.command("install", no_args_is_help=False, help="📋 [I] CLONE machienconfig locally and incorporate to shell profile for faster execution and nightly updates.")(install)
119
- cli_app.command("I", no_args_is_help=False, help="CLONE machienconfig locally and incorporate to shell profile for faster execution and nightly updates.", hidden=True)(install)
120
- cli_app.command("navigate", no_args_is_help=False, help="📚 [n] NAVIGATE command structure with TUI")(navigate)
156
+ cli_app.command("update", no_args_is_help=False, help="🔄 [u] UPDATE machineconfig")(update)
157
+ cli_app.command("u", no_args_is_help=False, hidden=True)(update)
158
+ cli_app.command("interactive", no_args_is_help=False, help="🤖 [i] INTERACTIVE configuration of machine.")(interactive)
159
+ cli_app.command("i", no_args_is_help=False, help="INTERACTIVE configuration of machine.", hidden=True)(interactive)
160
+ cli_app.command(name="init", no_args_is_help=False, help="🦐 [t] Define and manage configurations")(init)
161
+ cli_app.command(name="t", no_args_is_help=False, hidden=True)(init)
162
+ cli_app.command("status", no_args_is_help=False, help="📊 [s] STATUS of machine, shell profile, apps, symlinks, dotfiles, etc.")(status)
163
+ cli_app.command("s", no_args_is_help=False, help="STATUS of machine, shell profile, apps, symlinks, dotfiles, etc.", hidden=True)(status)
164
+ cli_app.command("install", no_args_is_help=False, help="📋 [I] CLONE machienconfig locally and incorporate to shell profile for faster execution and nightly updates.")(install)
165
+ cli_app.command("I", no_args_is_help=False, help="CLONE machienconfig locally and incorporate to shell profile for faster execution and nightly updates.", hidden=True)(install)
166
+ cli_app.command("navigate", no_args_is_help=False, help="📚 [n] NAVIGATE command structure with TUI")(navigate)
121
167
  cli_app.command("n", no_args_is_help=False, help="NAVIGATE command structure with TUI", hidden=True)(navigate)
122
- cli_app.command("python", no_args_is_help=False, help="🐍 [c] python command/file in the machineconfig environment", context_settings={"show_help_on_error": True})(run_python)
123
- cli_app.command("c", no_args_is_help=False, help="RUN python command/file in the machineconfig environment", hidden=True)(run_python)
124
- cli_app.command("readme", no_args_is_help=False, help="📚 [r] render readme markdown in terminal.")(readme)
168
+
169
+ cli_app.command("readme", no_args_is_help=False, help="📚 [r] render readme markdown in terminal.")(readme)
125
170
  cli_app.command("r", no_args_is_help=False, hidden=True)(readme)
126
171
  return cli_app
127
172
 
@@ -1,6 +1,5 @@
1
+
1
2
  import typer
2
- # import platform
3
- # import sys
4
3
  from typing import Annotated
5
4
 
6
5
 
@@ -12,7 +11,7 @@ Usage examples:
12
11
  devops network receive -- --relay 10.17.62.206:443 7121-donor-olympic-bicycle
13
12
  devops network receive -- croc --relay 10.17.62.206:443 7121-donor-olympic-bicycle
14
13
  """
15
- from machineconfig.utils.installer_utils.installer import install_if_missing
14
+ from machineconfig.utils.installer_utils.installer_cli import install_if_missing
16
15
  install_if_missing(which="croc")
17
16
  import platform
18
17
  import sys
@@ -100,15 +99,16 @@ def share_file_send(path: Annotated[str, typer.Argument(help="Path to the file o
100
99
  qrcode: Annotated[bool, typer.Option("--qrcode", "--qr", help="Show receive code as a qrcode")] = False,
101
100
  ) -> None:
102
101
  """Send a file using croc with relay server."""
103
- from machineconfig.utils.installer_utils.installer import install_if_missing
102
+ from machineconfig.utils.installer_utils.installer_cli import install_if_missing
104
103
  install_if_missing(which="croc")
105
104
  # Get relay server IP from environment or use default
106
- import socket
105
+ import machineconfig.scripts.python.helpers_network.address as helper
106
+ res = helper.select_lan_ipv4(prefer_vpn=False)
107
+ if res is None:
108
+ typer.echo("❌ Error: Could not determine local LAN IPv4 address for relay.", err=True)
109
+ raise typer.Exit(code=1)
110
+ local_ip_v4 = res
107
111
  import platform
108
- s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
109
- s.connect(('8.8.8.8',80))
110
- local_ip_v4 = s.getsockname()[0]
111
- s.close()
112
112
  relay_port = "443"
113
113
  is_windows = platform.system() == "Windows"
114
114
 
@@ -38,18 +38,16 @@ def web_file_explorer(
38
38
  username: Annotated[Optional[str], typer.Option("--username", "-u", help="Username for share access (default: current user)")] = None,
39
39
  password: Annotated[Optional[str], typer.Option("--password", "-w", help="Password for share access (default: from ~/dotfiles/creds/passwords/quick_password)")] = None,
40
40
  over_internet: Annotated[bool, typer.Option("--over-internet", "-i", help="Expose the share server over the internet using ngrok")] = False,
41
- backend: Annotated[str, typer.Option("--backend", "-b", help="Backend to use: filebrowser (default), miniserve, or easy-sharing")] = "filebrowser"
41
+ backend: Annotated[str, typer.Option("--backend", "-b", help="Backend to use: filebrowser (default), miniserve, qrcp, or easy-sharing")] = "miniserve",
42
42
  ) -> None:
43
- from machineconfig.utils.installer_utils.installer import install_if_missing
44
-
45
- if backend not in ["filebrowser", "miniserve", "easy-sharing"]:
46
- typer.echo(f"❌ ERROR: Invalid backend '{backend}'. Must be one of: filebrowser, miniserve, easy-sharing", err=True)
43
+ from machineconfig.utils.installer_utils.installer_cli import install_if_missing
44
+
45
+ if backend not in ["filebrowser", "miniserve", "qrcp", "easy-sharing"]:
46
+ typer.echo(f"❌ ERROR: Invalid backend '{backend}'. Must be one of: filebrowser, miniserve, qrcp, easy-sharing", err=True)
47
47
  raise typer.Exit(code=1)
48
-
49
48
  install_if_missing(which=backend)
50
49
  if over_internet:
51
50
  install_if_missing(which="ngrok")
52
-
53
51
  if username is None:
54
52
  import getpass
55
53
  username = getpass.getuser()
@@ -65,11 +63,12 @@ def web_file_explorer(
65
63
  if port is None:
66
64
  port = 8080
67
65
 
68
- import socket
69
- s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
70
- s.connect(('8.8.8.8', 80))
71
- local_ip_v4 = s.getsockname()[0]
72
- s.close()
66
+ import machineconfig.scripts.python.helpers_network.address as helper
67
+ res = helper.select_lan_ipv4(prefer_vpn=False)
68
+ if res is None:
69
+ typer.echo("❌ ERROR: Could not determine local LAN IPv4 address for share server.", err=True)
70
+ raise typer.Exit(code=1)
71
+ local_ip_v4 = res
73
72
 
74
73
  protocol = "http"
75
74
  display_share_url(local_ip_v4, port, protocol)
@@ -90,6 +89,8 @@ filebrowser --address 0.0.0.0 --port {port} --root "{path_obj}" --database {db_p
90
89
  command = f"""miniserve --port {port} --interfaces 0.0.0.0 --auth {username}:{password} --upload-files --mkdir --enable-tar --enable-tar-gz --enable-zip --qrcode "{path_obj}" """
91
90
  elif backend == "easy-sharing":
92
91
  command = f"""easy-sharing --port {port} --username {username} --password "{password}" "{path_obj}" """
92
+ elif backend == "qrcp":
93
+ command = f"""qrcp "{path_obj}" """
93
94
  else:
94
95
  typer.echo(f"❌ ERROR: Unknown backend '{backend}'", err=True)
95
96
  raise typer.Exit(code=1)