machineconfig 7.98__py3-none-any.whl → 8.51__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 (331) hide show
  1. machineconfig/cluster/remote/run_cluster.py +1 -1
  2. machineconfig/cluster/remote/run_remote.py +1 -1
  3. machineconfig/cluster/sessions_managers/utils/maker.py +10 -8
  4. machineconfig/cluster/sessions_managers/wt_local.py +1 -1
  5. machineconfig/cluster/sessions_managers/wt_local_manager.py +1 -1
  6. machineconfig/cluster/sessions_managers/zellij_local.py +1 -1
  7. machineconfig/cluster/sessions_managers/zellij_local_manager.py +1 -1
  8. machineconfig/jobs/installer/checks/check_installations.py +133 -0
  9. machineconfig/jobs/installer/checks/install_utils.py +132 -0
  10. machineconfig/jobs/installer/checks/report_utils.py +39 -0
  11. machineconfig/jobs/installer/checks/vt_utils.py +89 -0
  12. machineconfig/jobs/installer/installer_data.json +271 -152
  13. machineconfig/jobs/installer/linux_scripts/docker.sh +6 -9
  14. machineconfig/jobs/installer/package_groups.py +11 -9
  15. machineconfig/jobs/installer/{custom → python_scripts}/boxes.py +1 -2
  16. machineconfig/jobs/installer/{custom_dev → python_scripts}/brave.py +1 -1
  17. machineconfig/jobs/installer/{custom_dev → python_scripts}/code.py +10 -8
  18. machineconfig/jobs/installer/{custom → python_scripts}/hx.py +30 -13
  19. machineconfig/jobs/installer/{custom_dev → python_scripts}/nerdfont.py +1 -1
  20. machineconfig/jobs/installer/{custom_dev → python_scripts}/nerfont_windows_helper.py +6 -5
  21. machineconfig/jobs/installer/{custom_dev → python_scripts}/sysabc.py +26 -20
  22. machineconfig/jobs/installer/{custom_dev → python_scripts}/wezterm.py +1 -1
  23. machineconfig/jobs/installer/{custom → python_scripts}/yazi.py +39 -19
  24. machineconfig/jobs/scripts/powershell_scripts/cmatrix.ps1 +52 -0
  25. machineconfig/jobs/scripts/powershell_scripts/mount_ssh.ps1 +13 -0
  26. machineconfig/jobs/scripts/powershell_scripts/obs.ps1 +4 -0
  27. machineconfig/jobs/scripts_dynamic/a.py +428 -0
  28. machineconfig/logger.py +1 -1
  29. machineconfig/profile/create_helper.py +21 -10
  30. machineconfig/profile/create_links.py +77 -20
  31. machineconfig/profile/create_links_export.py +63 -58
  32. machineconfig/profile/create_shell_profile.py +14 -0
  33. machineconfig/profile/mapper_data.toml +45 -0
  34. machineconfig/profile/mapper_dotfiles.toml +249 -0
  35. machineconfig/scripts/python/agents.py +76 -171
  36. machineconfig/scripts/python/ai/initai.py +3 -1
  37. machineconfig/scripts/python/ai/scripts/__init__.py +1 -0
  38. machineconfig/scripts/python/ai/scripts/lint_and_type_check.ps1 +2 -0
  39. machineconfig/scripts/python/ai/scripts/lint_and_type_check.sh +8 -6
  40. machineconfig/scripts/python/ai/solutions/claude/claude.py +1 -1
  41. machineconfig/scripts/python/ai/solutions/cline/cline.py +1 -1
  42. machineconfig/scripts/python/ai/solutions/copilot/github_copilot.py +1 -1
  43. machineconfig/scripts/python/ai/solutions/copilot/instructions/python/dev.instructions.md +29 -0
  44. machineconfig/scripts/python/ai/solutions/crush/crush.py +1 -1
  45. machineconfig/scripts/python/ai/solutions/cursor/cursors.py +1 -1
  46. machineconfig/scripts/python/ai/solutions/gemini/gemini.py +1 -1
  47. machineconfig/scripts/python/ai/solutions/gemini/settings.json +3 -0
  48. machineconfig/scripts/python/ai/{solutions → utils}/generic.py +2 -15
  49. machineconfig/scripts/python/ai/utils/vscode_tasks.py +6 -3
  50. machineconfig/scripts/python/cloud.py +58 -11
  51. machineconfig/scripts/python/croshell.py +4 -155
  52. machineconfig/scripts/python/devops.py +57 -38
  53. machineconfig/scripts/python/devops_navigator.py +17 -3
  54. machineconfig/scripts/python/fire_jobs.py +10 -193
  55. machineconfig/scripts/python/ftpx.py +5 -224
  56. machineconfig/scripts/python/graph/cli_graph.json +8743 -0
  57. machineconfig/scripts/python/{env_manager → helper_env}/path_manager_tui.py +2 -2
  58. machineconfig/scripts/python/{env_manager → helpers/helper_env}/env_manager_tui.py +1 -1
  59. machineconfig/scripts/python/helpers/helper_env/path_manager_tui.py +228 -0
  60. machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/agentic_frameworks/fire_crush.py +1 -1
  61. machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/agentic_frameworks/fire_cursor_agents.py +1 -1
  62. machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/agentic_frameworks/fire_gemini.py +1 -1
  63. machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/agentic_frameworks/fire_qwen.py +1 -1
  64. machineconfig/scripts/python/helpers/helpers_agents/agents_impl.py +168 -0
  65. machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/fire_agents_help_launch.py +10 -7
  66. machineconfig/scripts/python/helpers/helpers_agents/privacy/configs/aichat/config.yaml +5 -0
  67. machineconfig/scripts/python/helpers/helpers_agents/privacy/configs/aider/.aider.conf.yml +2 -0
  68. machineconfig/scripts/python/helpers/helpers_agents/privacy/configs/copilot/config.yml +1 -0
  69. machineconfig/scripts/python/helpers/helpers_agents/privacy/configs/crush/crush.json +10 -0
  70. machineconfig/scripts/python/helpers/helpers_agents/privacy/configs/gemini/settings.json +12 -0
  71. machineconfig/scripts/python/helpers/helpers_agents/privacy/privacy.py +109 -0
  72. machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/templates/template.sh +3 -1
  73. machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/cloud_copy.py +6 -6
  74. machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/cloud_mount.py +10 -5
  75. machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/cloud_sync.py +4 -4
  76. machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/helpers2.py +1 -1
  77. machineconfig/scripts/python/helpers/helpers_croshell/croshell_impl.py +225 -0
  78. machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/scheduler.py +4 -4
  79. machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/start_slidev.py +7 -6
  80. machineconfig/scripts/python/helpers/helpers_devops/backup_config.py +149 -0
  81. machineconfig/scripts/python/helpers/helpers_devops/cli_backup_retrieve.py +262 -0
  82. machineconfig/scripts/python/helpers/helpers_devops/cli_config.py +98 -0
  83. machineconfig/scripts/python/helpers/helpers_devops/cli_config_dotfile.py +274 -0
  84. machineconfig/scripts/python/helpers/helpers_devops/cli_data.py +67 -0
  85. machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/cli_nw.py +69 -82
  86. machineconfig/scripts/python/helpers/helpers_devops/cli_repos.py +274 -0
  87. machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/cli_self.py +47 -22
  88. machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/cli_share_file.py +44 -30
  89. machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/cli_share_server.py +26 -43
  90. machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/cli_share_terminal.py +12 -6
  91. machineconfig/scripts/python/helpers/helpers_devops/cli_ssh.py +167 -0
  92. machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/devops_status.py +12 -6
  93. machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/devops_update_repos.py +1 -1
  94. machineconfig/scripts/python/{interactive.py → helpers/helpers_devops/interactive.py} +64 -50
  95. machineconfig/scripts/python/helpers/helpers_devops/run_script.py +197 -0
  96. machineconfig/scripts/python/helpers/helpers_devops/themes/choose_starship_theme.ps1 +41 -0
  97. machineconfig/scripts/python/helpers/helpers_devops/themes/choose_starship_theme.sh +48 -0
  98. machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/themes/choose_wezterm_theme.py +3 -3
  99. machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_fire_command}/file_wrangler.py +1 -0
  100. machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_fire_command}/fire_jobs_args_helper.py +1 -0
  101. machineconfig/scripts/python/helpers/helpers_fire_command/fire_jobs_impl.py +233 -0
  102. machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_fire_command}/fire_jobs_route_helper.py +3 -3
  103. machineconfig/scripts/python/helpers/helpers_msearch/msearch_impl.py +248 -0
  104. machineconfig/scripts/python/{helpers_msearch → helpers/helpers_msearch}/scripts_linux/fzfg +4 -3
  105. machineconfig/scripts/python/helpers/helpers_msearch/scripts_linux/search_with_context.sh +48 -0
  106. machineconfig/scripts/python/{helpers_msearch → helpers/helpers_msearch}/scripts_windows/fzfg.ps1 +1 -1
  107. machineconfig/scripts/python/helpers/helpers_navigator/__init__.py +20 -0
  108. machineconfig/scripts/python/helpers/helpers_navigator/cli_graph_loader.py +234 -0
  109. machineconfig/scripts/python/{helpers_navigator → helpers/helpers_navigator}/command_builder.py +61 -13
  110. machineconfig/scripts/python/helpers/helpers_navigator/command_detail.py +153 -0
  111. machineconfig/scripts/python/helpers/helpers_navigator/command_tree.py +45 -0
  112. machineconfig/scripts/python/{helpers_navigator → helpers/helpers_navigator}/data_models.py +18 -11
  113. machineconfig/scripts/python/{helpers_navigator → helpers/helpers_navigator}/main_app.py +5 -5
  114. machineconfig/scripts/python/{helpers_network → helpers/helpers_network}/address.py +52 -10
  115. machineconfig/scripts/python/helpers/helpers_network/address_switch.py +78 -0
  116. machineconfig/scripts/python/helpers/helpers_network/ftpx_impl.py +276 -0
  117. machineconfig/scripts/python/{helpers_network → helpers/helpers_network}/mount_ssh.py +2 -2
  118. machineconfig/scripts/python/helpers/helpers_network/ssh_add_identity.py +73 -0
  119. machineconfig/scripts/python/helpers/helpers_network/ssh_add_ssh_key.py +175 -0
  120. machineconfig/scripts/python/helpers/helpers_network/ssh_debug_linux.py +319 -0
  121. machineconfig/scripts/python/helpers/helpers_network/ssh_debug_windows.py +275 -0
  122. machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/action.py +3 -3
  123. machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/action_helper.py +3 -3
  124. machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/cloud_repo_sync.py +118 -34
  125. machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/grource.py +3 -2
  126. machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/record.py +33 -13
  127. machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/repo_analyzer_2.py +63 -19
  128. machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/update.py +0 -6
  129. machineconfig/scripts/python/helpers/helpers_search/script_help.py +81 -0
  130. machineconfig/scripts/python/helpers/helpers_sessions/__init__.py +0 -0
  131. machineconfig/scripts/python/helpers/helpers_sessions/sessions_impl.py +186 -0
  132. machineconfig/scripts/python/{helpers_sessions → helpers/helpers_sessions}/sessions_multiprocess.py +1 -2
  133. machineconfig/scripts/python/helpers/helpers_terminal/__init__.py +0 -0
  134. machineconfig/scripts/python/helpers/helpers_terminal/terminal_impl.py +96 -0
  135. machineconfig/scripts/python/{helpers_utils → helpers/helpers_utils}/download.py +1 -1
  136. machineconfig/scripts/python/{helpers_devops/cli_utils.py → helpers/helpers_utils/pdf.py} +2 -2
  137. machineconfig/scripts/python/{helpers_utils/path.py → helpers/helpers_utils/python.py} +65 -40
  138. machineconfig/scripts/python/helpers/helpers_utils/specs.py +246 -0
  139. machineconfig/scripts/python/mcfg_entry.py +133 -48
  140. machineconfig/scripts/python/msearch.py +16 -61
  141. machineconfig/scripts/python/sessions.py +68 -203
  142. machineconfig/scripts/python/terminal.py +27 -102
  143. machineconfig/scripts/python/utils.py +101 -22
  144. machineconfig/settings/atuin/config.toml +294 -0
  145. machineconfig/settings/atuin/themes/catppuccin-mocha-mauve.toml +12 -0
  146. machineconfig/settings/linters/.ruff.toml +2 -1
  147. machineconfig/settings/mprocs/windows/mprocs.yaml +2 -2
  148. machineconfig/settings/shells/bash/init.sh +6 -3
  149. machineconfig/settings/shells/nushell/config.nu +23 -1
  150. machineconfig/settings/shells/nushell/env.nu +22 -48
  151. machineconfig/settings/shells/nushell/init.nu +64 -240
  152. machineconfig/settings/shells/pwsh/init.ps1 +69 -1
  153. machineconfig/settings/shells/pwsh/search_pwsh_history.ps1 +99 -0
  154. machineconfig/settings/shells/wezterm/wezterm.lua +4 -1
  155. machineconfig/settings/shells/wt/settings.json +21 -21
  156. machineconfig/settings/shells/zsh/init.sh +25 -4
  157. machineconfig/settings/television/cable_unix/bash-history.toml +1 -1
  158. machineconfig/settings/television/cable_windows/pwsh-history.toml +1 -1
  159. machineconfig/settings/tv/config.toml +234 -0
  160. machineconfig/settings/tv/themes/catppuccin-mocha-sky.toml +22 -0
  161. machineconfig/settings/wsl/.wslconfig +5 -30
  162. machineconfig/settings/wt/__init__.py +0 -0
  163. machineconfig/settings/yazi/yazi_linux.toml +18 -8
  164. machineconfig/settings/zellij/layouts/st.kdl +40 -9
  165. machineconfig/settings/zellij/layouts/st2.kdl +1 -1
  166. machineconfig/setup_linux/__init__.py +0 -1
  167. machineconfig/setup_linux/apps_desktop.sh +8 -27
  168. machineconfig/setup_linux/web_shortcuts/interactive.sh +10 -10
  169. machineconfig/setup_linux/web_shortcuts/live_from_github.sh +3 -0
  170. machineconfig/setup_mac/__init__.py +0 -2
  171. machineconfig/setup_windows/__init__.py +2 -5
  172. machineconfig/setup_windows/web_shortcuts/interactive.ps1 +14 -13
  173. machineconfig/setup_windows/web_shortcuts/live_from_github.ps1 +4 -3
  174. machineconfig/setup_windows/web_shortcuts/quick_init.ps1 +3 -3
  175. machineconfig/type_hinting/sql/__init__.py +1 -0
  176. machineconfig/type_hinting/sql/base.py +216 -0
  177. machineconfig/type_hinting/sql/core_schema.py +64 -0
  178. machineconfig/type_hinting/sql/core_schema_typeddict.py +41 -0
  179. machineconfig/type_hinting/sql/typeddict_codegen.py +222 -0
  180. machineconfig/type_hinting/typedict/__init__.py +1 -0
  181. machineconfig/type_hinting/typedict/ast_utils.py +130 -0
  182. machineconfig/type_hinting/typedict/generator_helpers.py +319 -0
  183. machineconfig/type_hinting/typedict/generators.py +231 -0
  184. machineconfig/type_hinting/typedict/polars_schema.py +24 -0
  185. machineconfig/type_hinting/typedict/polars_schema_typeddict.py +63 -0
  186. machineconfig/utils/accessories.py +24 -0
  187. machineconfig/utils/code.py +78 -33
  188. machineconfig/utils/files/ascii_art.py +10 -14
  189. machineconfig/utils/files/headers.py +3 -5
  190. machineconfig/utils/files/read.py +8 -1
  191. machineconfig/utils/installer_utils/github_release_bulk.py +11 -91
  192. machineconfig/utils/installer_utils/github_release_scraper.py +99 -0
  193. machineconfig/utils/installer_utils/install_from_url.py +1 -1
  194. machineconfig/utils/installer_utils/installer_class.py +12 -4
  195. machineconfig/utils/installer_utils/installer_cli.py +1 -15
  196. machineconfig/utils/installer_utils/installer_helper.py +2 -2
  197. machineconfig/utils/installer_utils/installer_locator_utils.py +13 -13
  198. machineconfig/utils/installer_utils/installer_runner.py +4 -4
  199. machineconfig/utils/io.py +25 -8
  200. machineconfig/utils/meta.py +6 -4
  201. machineconfig/utils/options.py +49 -19
  202. machineconfig/utils/options_utils/__init__.py +0 -0
  203. machineconfig/utils/options_utils/options_tv_linux.py +211 -0
  204. machineconfig/utils/options_utils/options_tv_windows.py +88 -0
  205. machineconfig/utils/options_utils/tv_options.py +37 -0
  206. machineconfig/utils/path_extended.py +8 -7
  207. machineconfig/utils/scheduler.py +8 -2
  208. machineconfig/utils/schemas/fire_agents/fire_agents_input.py +1 -1
  209. machineconfig/utils/source_of_truth.py +6 -1
  210. machineconfig/utils/ssh.py +73 -23
  211. machineconfig/utils/ssh_utils/abc.py +1 -1
  212. machineconfig/utils/ssh_utils/copy_from_here.py +19 -14
  213. machineconfig/utils/ssh_utils/copy_to_here.py +2 -1
  214. machineconfig/utils/ssh_utils/utils.py +23 -7
  215. machineconfig/utils/ssh_utils/wsl.py +107 -170
  216. machineconfig/utils/ssh_utils/wsl_helper.py +217 -0
  217. machineconfig/utils/upgrade_packages.py +4 -8
  218. {machineconfig-7.98.dist-info → machineconfig-8.51.dist-info}/METADATA +30 -22
  219. machineconfig-8.51.dist-info/RECORD +543 -0
  220. machineconfig/jobs/installer/check_installations.py +0 -248
  221. machineconfig/profile/backup.toml +0 -49
  222. machineconfig/profile/mapper.toml +0 -263
  223. machineconfig/scripts/linux/other/switch_ip +0 -20
  224. machineconfig/scripts/python/helpers/run_py_script.py +0 -79
  225. machineconfig/scripts/python/helpers/tmp_py_scripts/a.py +0 -26
  226. machineconfig/scripts/python/helpers_devops/cli_config.py +0 -105
  227. machineconfig/scripts/python/helpers_devops/cli_config_dotfile.py +0 -89
  228. machineconfig/scripts/python/helpers_devops/cli_data.py +0 -25
  229. machineconfig/scripts/python/helpers_devops/cli_repos.py +0 -215
  230. machineconfig/scripts/python/helpers_devops/devops_backup_retrieve.py +0 -80
  231. machineconfig/scripts/python/helpers_devops/themes/choose_starship_theme.bash +0 -3
  232. machineconfig/scripts/python/helpers_navigator/__init__.py +0 -20
  233. machineconfig/scripts/python/helpers_navigator/command_detail.py +0 -44
  234. machineconfig/scripts/python/helpers_navigator/command_tree.py +0 -620
  235. machineconfig/scripts/python/helpers_network/devops_add_identity.py +0 -82
  236. machineconfig/scripts/python/helpers_network/devops_add_ssh_key.py +0 -153
  237. machineconfig/scripts/python/helpers_network/ssh_debug_linux.py +0 -391
  238. machineconfig/scripts/python/helpers_network/ssh_debug_windows.py +0 -338
  239. machineconfig/scripts/python/helpers_network/wsl_windows_transfer.py +0 -67
  240. machineconfig/scripts/python/helpers_repos/entrypoint.py +0 -77
  241. machineconfig/scripts/windows/mounts/mount_ssh.ps1 +0 -13
  242. machineconfig/setup_linux/others/mint_keyboard_shortcuts.sh +0 -30
  243. machineconfig/setup_linux/ssh/openssh_all.sh +0 -25
  244. machineconfig/setup_linux/ssh/openssh_wsl.sh +0 -38
  245. machineconfig/setup_mac/ssh/openssh_setup.sh +0 -114
  246. machineconfig/setup_windows/others/obs.ps1 +0 -4
  247. machineconfig/setup_windows/ssh/add-sshkey.ps1 +0 -29
  248. machineconfig/setup_windows/ssh/add_identity.ps1 +0 -11
  249. machineconfig/setup_windows/ssh/openssh-server.ps1 +0 -37
  250. machineconfig/setup_windows/ssh/openssh-server_add_key.ps1 +0 -7
  251. machineconfig/setup_windows/ssh/openssh-server_copy-ssh-id.ps1 +0 -14
  252. machineconfig/utils/options_tv.py +0 -119
  253. machineconfig/utils/tst.py +0 -20
  254. machineconfig-7.98.dist-info/RECORD +0 -504
  255. /machineconfig/jobs/installer/{custom_dev → checks}/__init__.py +0 -0
  256. /machineconfig/{scripts/python/helpers_agents → jobs/installer/python_scripts}/__init__.py +0 -0
  257. /machineconfig/jobs/installer/{custom_dev → python_scripts}/alacritty.py +0 -0
  258. /machineconfig/jobs/installer/{custom_dev → python_scripts}/bypass_paywall.py +0 -0
  259. /machineconfig/jobs/installer/{custom_dev → python_scripts}/cloudflare_warp_cli.py +0 -0
  260. /machineconfig/jobs/installer/{custom_dev → python_scripts}/cursor.py +0 -0
  261. /machineconfig/jobs/installer/{custom_dev → python_scripts}/dubdb_adbc.py +0 -0
  262. /machineconfig/jobs/installer/{custom_dev → python_scripts}/espanso.py +0 -0
  263. /machineconfig/jobs/installer/{custom → python_scripts}/gh.py +0 -0
  264. /machineconfig/jobs/installer/{custom_dev → python_scripts}/goes.py +0 -0
  265. /machineconfig/jobs/installer/{custom_dev → python_scripts}/lvim.py +0 -0
  266. /machineconfig/jobs/installer/{custom_dev → python_scripts}/redis.py +0 -0
  267. /machineconfig/jobs/installer/{custom_dev → python_scripts}/winget.py +0 -0
  268. /machineconfig/{setup_linux/others → jobs/scripts/bash_scripts}/android.sh +0 -0
  269. /machineconfig/jobs/{installer/linux_scripts → scripts/bash_scripts}/lid.sh +0 -0
  270. /machineconfig/{scripts/python/helpers_network → jobs/scripts/bash_scripts}/mount_drive +0 -0
  271. /machineconfig/{scripts/python/helpers_network → jobs/scripts/bash_scripts}/mount_nfs +0 -0
  272. /machineconfig/{scripts/python/helpers_network → jobs/scripts/bash_scripts}/mount_nw_drive +0 -0
  273. /machineconfig/{scripts/python/helpers_network → jobs/scripts/bash_scripts}/mount_smb +0 -0
  274. /machineconfig/{scripts/linux/other → jobs/scripts/bash_scripts}/share_cloud.sh +0 -0
  275. /machineconfig/{scripts/linux/other → jobs/scripts/bash_scripts}/share_nfs +0 -0
  276. /machineconfig/{scripts/linux/other → jobs/scripts/bash_scripts}/start_docker +0 -0
  277. /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/Restore-ThunderbirdProfile.ps1 +0 -0
  278. /machineconfig/{setup_windows/others → jobs/scripts/powershell_scripts}/docker.ps1 +0 -0
  279. /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/mount_nfs.ps1 +0 -0
  280. /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/mount_nw.ps1 +0 -0
  281. /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/mount_smb.ps1 +0 -0
  282. /machineconfig/{setup_windows/others → jobs/scripts/powershell_scripts}/power_options.ps1 +0 -0
  283. /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/share_cloud.cmd +0 -0
  284. /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/share_smb.ps1 +0 -0
  285. /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/unlock_bitlocker.ps1 +0 -0
  286. /machineconfig/scripts/python/ai/{solutions/_shared.py → utils/shared.py} +0 -0
  287. /machineconfig/scripts/python/{helpers_agents/agentic_frameworks → graph}/__init__.py +0 -0
  288. /machineconfig/scripts/python/{helpers_cloud → helpers}/__init__.py +0 -0
  289. /machineconfig/scripts/python/{env_manager → helpers/helper_env}/__init__.py +0 -0
  290. /machineconfig/scripts/python/{env_manager → helpers/helper_env}/path_manager_backend.py +0 -0
  291. /machineconfig/scripts/python/{helpers_croshell → helpers/helpers_agents}/__init__.py +0 -0
  292. /machineconfig/scripts/python/{helpers_devops → helpers/helpers_agents/agentic_frameworks}/__init__.py +0 -0
  293. /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/agentic_frameworks/fire_crush.json +0 -0
  294. /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/fire_agents_help_search.py +0 -0
  295. /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/fire_agents_helper_types.py +0 -0
  296. /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/fire_agents_load_balancer.py +0 -0
  297. /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/templates/prompt.txt +0 -0
  298. /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/templates/template.ps1 +0 -0
  299. /machineconfig/scripts/python/{helpers_devops/themes → helpers/helpers_cloud}/__init__.py +0 -0
  300. /machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/cloud_helpers.py +0 -0
  301. /machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/helpers5.py +0 -0
  302. /machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_croshell}/__init__.py +0 -0
  303. /machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/crosh.py +0 -0
  304. /machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/pomodoro.py +0 -0
  305. /machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/viewer.py +0 -0
  306. /machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/viewer_template.py +0 -0
  307. /machineconfig/scripts/python/{helpers_network → helpers/helpers_devops}/__init__.py +0 -0
  308. /machineconfig/scripts/python/{helpers_sessions → helpers/helpers_devops/themes}/__init__.py +0 -0
  309. /machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/themes/choose_pwsh_theme.ps1 +0 -0
  310. /machineconfig/{setup_windows/wt_and_pwsh → scripts/python/helpers/helpers_fire_command}/__init__.py +0 -0
  311. /machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_fire_command}/cloud_manager.py +0 -0
  312. /machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_fire_command}/f.py +0 -0
  313. /machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_fire_command}/fire_jobs_streamlit_helper.py +0 -0
  314. /machineconfig/scripts/python/{helpers_msearch → helpers/helpers_msearch}/__init__.py +0 -0
  315. /machineconfig/scripts/python/{helpers_navigator → helpers/helpers_navigator}/search_bar.py +0 -0
  316. /machineconfig/scripts/python/{helpers_devops/themes/choose_starship_theme.ps1 → helpers/helpers_network/__init__.py} +0 -0
  317. /machineconfig/scripts/python/{helpers_network → helpers/helpers_network}/mount_nfs.py +0 -0
  318. /machineconfig/scripts/python/{helpers_network → helpers/helpers_network}/mount_nw_drive.py +0 -0
  319. /machineconfig/scripts/python/{helpers_network → helpers/helpers_network}/onetimeshare.py +0 -0
  320. /machineconfig/scripts/python/{helpers_network → helpers/helpers_network}/wifi_conn.py +0 -0
  321. /machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/clone.py +0 -0
  322. /machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/repo_analyzer_1.py +0 -0
  323. /machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/sync.py +0 -0
  324. /machineconfig/scripts/python/helpers/{ast_search.py → helpers_search/ast_search.py} +0 -0
  325. /machineconfig/scripts/python/helpers/{qr_code.py → helpers_search/qr_code.py} +0 -0
  326. /machineconfig/scripts/python/helpers/{repo_rag.py → helpers_search/repo_rag.py} +0 -0
  327. /machineconfig/scripts/python/helpers/{symantic_search.py → helpers_search/symantic_search.py} +0 -0
  328. /machineconfig/{setup_windows/wt_and_pwsh → settings/wt}/set_wt_settings.py +0 -0
  329. {machineconfig-7.98.dist-info → machineconfig-8.51.dist-info}/WHEEL +0 -0
  330. {machineconfig-7.98.dist-info → machineconfig-8.51.dist-info}/entry_points.txt +0 -0
  331. {machineconfig-7.98.dist-info → machineconfig-8.51.dist-info}/top_level.txt +0 -0
@@ -1,9 +1,6 @@
1
1
  #!/usr/bin/env -S uv run --no-dev --project
2
2
 
3
- """
4
- croshell
5
-
6
- """
3
+ """croshell - Cross-shell command execution."""
7
4
 
8
5
  from typing import Annotated, Optional
9
6
  import typer
@@ -17,155 +14,12 @@ def croshell(
17
14
  jupyter: Annotated[bool, typer.Option("--jupyter", "-j", help="run in jupyter interactive console")] = False,
18
15
  vscode: Annotated[bool, typer.Option("--vscode", "-c", help="open the script in vscode")] = False,
19
16
  visidata: Annotated[bool, typer.Option("--visidata", "-v", help="open data file in visidata")] = False,
20
- # streamlit_viewer: Annotated[bool, typer.Option("--streamlit", "-s", help="view in streamlit app")] = False,
21
17
  python: Annotated[bool, typer.Option("--python", "-P", help="flag to use python over IPython.")] = False,
22
18
  profile: Annotated[Optional[str], typer.Option("--profile", "-r", help="ipython profile to use, defaults to default profile.")] = None,
23
-
24
19
  ) -> None:
25
- if uv_with is not None: user_uv_with_line = f"--with {uv_with} "
26
- else: user_uv_with_line = ""
27
-
28
- if project_path is not None:
29
- uv_project_line = f'--project {project_path}'
30
- uv_python_line = ""
31
- else:
32
- uv_project_line = ""
33
- uv_python_line = "--python 3.14"
34
-
35
- from machineconfig.scripts.python.helpers_croshell.crosh import get_read_python_file_pycode, get_read_data_pycode
36
- from machineconfig.utils.meta import lambda_to_python_script
37
- from pathlib import Path
38
- from machineconfig.utils.accessories import randstr
39
- from machineconfig.utils.ve import get_ve_path_and_ipython_profile
40
- import json
41
- from rich.console import Console
42
- from rich.panel import Panel
43
- console = Console()
44
-
45
-
46
- # ==================================================================================
47
- # flags processing
48
- interactivity = "-i"
49
- interpreter = "python" if python else "ipython"
50
- ipython_profile: Optional[str] = profile
51
- file_obj = Path.cwd() # initialization value, could be modified according to args.
52
- if path is not None:
53
- from machineconfig.utils.path_helper import get_choice_file
54
- choice_file = get_choice_file(path=path, suffixes={".*"})
55
- if project_path is None:
56
- ve_path, _ = get_ve_path_and_ipython_profile(choice_file)
57
- if ve_path is not None:
58
- ve_path_obj = Path(ve_path)
59
- uv_project_line = f'--project {ve_path_obj.parent}'
60
- uv_python_line = ""
61
- if choice_file.suffix == ".py":
62
- program = choice_file.read_text(encoding="utf-8")
63
- text = f"📄 Selected file: {choice_file.name}"
64
- console.print(Panel(text, title="[bold blue]Info[/bold blue]"))
65
- else:
66
- program = lambda_to_python_script(lambda: get_read_data_pycode(path=str(choice_file)),
67
- in_global=True, import_module=False)
68
- text = f"📄 Reading data from: {file_obj.name}"
69
- console.print(Panel(text, title="[bold blue]Info[/bold blue]"))
70
- else: # if nothing is specified, then run in interactive mode.
71
- program = ""
72
-
73
- if Path.home().joinpath("code/machineconfig").exists() and uv_project_line == "":
74
- uv_project_line = f'--project "{str(Path.home().joinpath("code/machineconfig"))}"'
75
-
76
- preprogram = """
77
- #%%
78
- """
79
- def preprogram_func():
80
- from machineconfig.utils.files.headers import print_header, print_logo
81
- print_header()
82
- print_logo("Machineconfig")
83
- from pathlib import Path
84
- from machineconfig.utils.path_extended import PathExtended
85
- _ = Path, PathExtended # avoid unused import warnings
86
- import inspect, textwrap
87
- from types import FunctionType
88
- def get_body_simple_function_no_args(f: FunctionType):
89
- return textwrap.dedent("\n".join(inspect.getsource(f).splitlines()[1:]))
90
- preprogram += get_body_simple_function_no_args(preprogram_func)
91
-
92
- from pathlib import Path
93
- pyfile = Path.home().joinpath(f"tmp_results/tmp_scripts/python/croshell/{randstr()}/script.py")
94
- pyfile.parent.mkdir(parents=True, exist_ok=True)
95
- title = "Reading Data"
96
- def_code = lambda_to_python_script(lambda: get_read_python_file_pycode(path=str(pyfile), title=title),
97
- in_global=False, import_module=False)
98
- # print(def_code)
99
- python_program = preprogram + "\n\n" + def_code + program
100
- pyfile.write_text(python_program, encoding="utf-8")
101
- # ve_root_from_file, ipython_profile = get_ve_path_and_ipython_profile(PathExtended(file))
102
- ipython_profile = ipython_profile if ipython_profile is not None else "default"
103
- # ve_activateion_line = get_ve_activate_line(ve_name=args.ve or ve_profile_suggested, a_path=str(PathExtended.cwd()))
104
-
105
- # prepare notebook target path (avoid relying on locals())
106
- nb_target = pyfile.with_suffix(".ipynb")
107
- if jupyter:
108
- try:
109
- nb_path = pyfile.with_suffix(".ipynb")
110
- nb_content = {
111
- "cells": [
112
- {
113
- "cell_type": "code",
114
- "metadata": {"language": "python"},
115
- "source": [python_program],
116
- "outputs": [],
117
- "execution_count": None,
118
- }
119
- ],
120
- "metadata": {},
121
- "nbformat": 4,
122
- "nbformat_minor": 5,
123
- }
124
- nb_path.write_text(json.dumps(nb_content), encoding="utf-8")
125
- nb_target = nb_path
126
- except Exception:
127
- # if writing fails, fall back to the default nb_target already set
128
- pass
129
- if visidata:
130
- if file_obj.suffix == ".json":
131
- fire_line = f"uv run {uv_python_line} {user_uv_with_line} {uv_project_line} --with visidata vd {str(file_obj)}"
132
- else:
133
- fire_line = f"uv run {uv_python_line} {user_uv_with_line} {uv_project_line} --with visidata,pyarrow vd {str(file_obj)}"
134
- elif marimo:
135
- if Path.home().joinpath("code/machineconfig").exists():
136
- requirements = f"""{user_uv_with_line} {uv_project_line} --with marimo """
137
- else: requirements = f"""{uv_python_line} {user_uv_with_line} {uv_project_line} --with "marimo,cowsay,machineconfig[plot]>=7.98" """
138
- fire_line = f"""
139
- cd {str(pyfile.parent)}
140
- uv run {uv_python_line} --with "marimo" marimo convert {pyfile.name} -o marimo_nb.py
141
- uv run {requirements} marimo edit --host 0.0.0.0 marimo_nb.py
142
- """
143
- elif jupyter:
144
- if Path.home().joinpath("code/machineconfig").exists():
145
- requirements = f"""{user_uv_with_line} {uv_project_line} --with jupyterlab """
146
- else: requirements = f"""{user_uv_with_line} {uv_project_line} --with "cowsay,machineconfig[plot]>=7.98" """
147
- fire_line = f"uv run {requirements} {uv_project_line} jupyter-lab {str(nb_target)}"
148
- elif vscode:
149
- user_uv_add = f"uv add {uv_with}" if uv_with is not None else ""
150
- fire_line = f"""
151
- cd {str(pyfile.parent)}
152
- uv init {uv_python_line}
153
- uv venv
154
- uv add "cowsay,machineconfig[plot]>=7.98"
155
- uv add {user_uv_add}
156
- # code serve-web
157
- code --new-window {str(pyfile)}
158
- """
159
- else:
160
- if interpreter == "ipython": profile = f" --profile {ipython_profile} --no-banner"
161
- else: profile = ""
162
- if Path.home().joinpath("code/machineconfig").exists():
163
- ve_line = f"""{user_uv_with_line} {uv_project_line} """
164
- else: ve_line = f"""{uv_python_line} {user_uv_with_line} {uv_project_line} --with "cowsay,machineconfig[plot]>=7.98" """
165
- fire_line = f"uv run {ve_line} {interpreter} {interactivity} {profile} {str(pyfile)}"
166
-
167
- from machineconfig.utils.code import exit_then_run_shell_script
168
- exit_then_run_shell_script(fire_line, strict=False)
20
+ """Cross-shell command execution."""
21
+ from machineconfig.scripts.python.helpers.helpers_croshell.croshell_impl import croshell as impl
22
+ impl(path=path, project_path=project_path, uv_with=uv_with, marimo=marimo, jupyter=jupyter, vscode=vscode, visidata=visidata, python=python, profile=profile)
169
23
 
170
24
 
171
25
  def main() -> None:
@@ -173,9 +27,4 @@ def main() -> None:
173
27
 
174
28
 
175
29
  if __name__ == "__main__":
176
- # def func(flag: Annotated[bool, typer.Option("--flag/-nf", help="dummy flag for debugging", flag_value=False, is_flag=True)]=True):
177
- # console.print(f"flag: {flag}")
178
- # app = typer.Typer()
179
- # app.command()(func)
180
- # app()
181
30
  main()
@@ -1,14 +1,8 @@
1
- """devops with emojis"""
1
+ """devops with emojis - lazy loading subcommands."""
2
2
 
3
3
  import typer
4
- from typing import Optional, Annotated
4
+ from typing import Optional, Annotated, Literal
5
5
 
6
- import machineconfig.scripts.python.helpers_devops.cli_repos as cli_repos
7
- import machineconfig.scripts.python.helpers_devops.cli_config as cli_config
8
- import machineconfig.scripts.python.helpers_devops.cli_self as cli_self
9
- import machineconfig.scripts.python.helpers_devops.cli_data as cli_data
10
- import machineconfig.scripts.python.helpers_devops.cli_nw as cli_network
11
- import machineconfig.scripts.python.helpers.run_py_script as run_py_script_module
12
6
 
13
7
  def install(which: Annotated[Optional[str], typer.Argument(..., help="Comma-separated list of program names to install, or group name if --group flag is set.")] = None,
14
8
  group: Annotated[bool, typer.Option(..., "--group", "-g", help="Treat 'which' as a group name. A group is bundle of apps.")] = False,
@@ -19,44 +13,69 @@ def install(which: Annotated[Optional[str], typer.Argument(..., help="Comma-sepa
19
13
  installer_entry_point.main_installer_cli(which=which, group=group, interactive=interactive)
20
14
 
21
15
 
16
+ def repos(ctx: typer.Context) -> None:
17
+ """📁 [r] Manage development repositories"""
18
+ import machineconfig.scripts.python.helpers.helpers_devops.cli_repos as cli_repos
19
+ cli_repos.get_app()(ctx.args, standalone_mode=False)
22
20
 
23
- # def get_app():
24
- # app = typer.Typer(add_completion=False, no_args_is_help=True)
25
- # app.command(name="scripts", help="define all scripts", no_args_is_help=False)(define_scripts)
26
- # return app
27
21
 
28
- # def main():
29
- # # return app
30
- # app = get_app()
31
- # app()
22
+ def config(ctx: typer.Context) -> None:
23
+ """⚙️ [c] Configuration management"""
24
+ import machineconfig.scripts.python.helpers.helpers_devops.cli_config as cli_config
25
+ cli_config.get_app()(ctx.args, standalone_mode=False)
32
26
 
33
- # define_app = get_define_app()
34
27
 
28
+ def data(ctx: typer.Context) -> None:
29
+ """💾 [d] Data management"""
30
+ import machineconfig.scripts.python.helpers.helpers_devops.cli_data as cli_data
31
+ cli_data.get_app()(ctx.args, standalone_mode=False)
35
32
 
36
- def get_app():
37
33
 
38
- cli_app = typer.Typer(help="🛠️ DevOps operations", no_args_is_help=True, add_help_option=False, add_completion=False)
39
- cli_app.command("install", no_args_is_help=True, help="🛠️ [i] Install essential packages")(install)
40
- cli_app.command("i", no_args_is_help=True, help="Install essential packages", hidden=True)(install)
34
+ def self_cmd(ctx: typer.Context) -> None:
35
+ """🔧 [s] Self management"""
36
+ import machineconfig.scripts.python.helpers.helpers_devops.cli_self as cli_self
37
+ cli_self.get_app()(ctx.args, standalone_mode=False)
41
38
 
42
- app_repos = cli_repos.get_app()
43
- cli_app.add_typer(app_repos, name="repos")
44
- cli_app.add_typer(app_repos, name="r", hidden=True)
45
- app_config = cli_config.get_app()
46
- cli_app.add_typer(app_config, name="config")
47
- cli_app.add_typer(app_config, name="c", hidden=True)
48
- app_data = cli_data.get_app()
49
- cli_app.add_typer(app_data, name="data")
50
- cli_app.add_typer(app_data, name="d", hidden=True)
51
- app_self = cli_self.get_app()
52
- cli_app.add_typer(app_self, name="self")
53
- cli_app.add_typer(app_self, name="s", hidden=True)
54
- app_nw = cli_network.get_app()
55
- cli_app.add_typer(app_nw, name="network")
56
- cli_app.add_typer(app_nw, name="n", hidden=True)
57
39
 
58
- cli_app.command("python", no_args_is_help=True, help="🐍 [p] python scripts or command/file in the machineconfig environment", context_settings={"show_help_on_error": True})(run_py_script_module.run_py_script)
59
- cli_app.command("p", no_args_is_help=True, help="RUN python scripts or command/file in the machineconfig environment", hidden=True)(run_py_script_module.run_py_script)
40
+ def network(ctx: typer.Context) -> None:
41
+ """🌐 [n] Network management"""
42
+ import machineconfig.scripts.python.helpers.helpers_devops.cli_nw as cli_network
43
+ cli_network.get_app()(ctx.args, standalone_mode=False)
44
+
45
+
46
+ def execute(
47
+ ctx: typer.Context,
48
+ name: Annotated[str, typer.Argument(help="Name of script to run, e.g., 'a' for a.py, or command to execute")] = "",
49
+ where: Annotated[Literal["all", "a", "private", "p", "public", "b", "library", "l", "dynamic", "d", "custom", "c"], typer.Option("--where", "-w", help="Where to look for the script")] = "all",
50
+ interactive: Annotated[bool, typer.Option(..., "--interactive", "-i", help="Interactive selection of scripts to run")] = False,
51
+ command: Annotated[Optional[bool], typer.Option(..., "--command", "-c", help="Run as command")] = False,
52
+ list_scripts: Annotated[bool, typer.Option(..., "--list", "-l", help="List available scripts in all locations")] = False,
53
+ ) -> None:
54
+ """🚀 Execute python/shell scripts from pre-defined directories or as command."""
55
+ import machineconfig.scripts.python.helpers.helpers_devops.run_script as run_py_script_module
56
+ run_py_script_module.run_py_script(ctx=ctx, name=name, where=where, interactive=interactive, command=command, list_scripts=list_scripts)
57
+
58
+
59
+ def get_app() -> typer.Typer:
60
+ cli_app = typer.Typer(help="🛠️ DevOps operations", no_args_is_help=True, add_help_option=True, add_completion=False)
61
+ ctx_settings: dict[str, object] = {"allow_extra_args": True, "allow_interspersed_args": True, "ignore_unknown_options": True, "help_option_names": []}
62
+
63
+ cli_app.command("install", no_args_is_help=True, help=install.__doc__, short_help="🛠️ [i] Install essential packages")(install)
64
+ cli_app.command("i", no_args_is_help=True, help=install.__doc__, hidden=True)(install)
65
+
66
+ cli_app.command("repos", help="📁 [r] Manage development repositories", context_settings=ctx_settings)(repos)
67
+ cli_app.command("r", hidden=True, context_settings=ctx_settings)(repos)
68
+ cli_app.command("config", help="🔩 [c] Configuration management", context_settings=ctx_settings)(config)
69
+ cli_app.command("c", hidden=True, context_settings=ctx_settings)(config)
70
+ cli_app.command("data", help="💾 [d] Data management", context_settings=ctx_settings)(data)
71
+ cli_app.command("d", hidden=True, context_settings=ctx_settings)(data)
72
+ cli_app.command("self", help="🔧 [s] Self management", context_settings=ctx_settings)(self_cmd)
73
+ cli_app.command("s", hidden=True, context_settings=ctx_settings)(self_cmd)
74
+ cli_app.command("network", help="🌐 [n] Network management", context_settings=ctx_settings)(network)
75
+ cli_app.command("n", hidden=True, context_settings=ctx_settings)(network)
76
+
77
+ cli_app.command("execute", no_args_is_help=True, short_help="🚀 [e] Execute python/shell scripts from pre-defined directories or as command")(execute)
78
+ cli_app.command("e", no_args_is_help=True, hidden=True)(execute)
60
79
 
61
80
  return cli_app
62
81
 
@@ -1,6 +1,20 @@
1
- from machineconfig.scripts.python.helpers_navigator import CommandNavigatorApp
1
+ #!/usr/bin/env -S uv run --script
2
+ # /// script
3
+ # requires-python = ">=3.13"
4
+ # dependencies = [
5
+ # "machineconfig>=8.51",
6
+ # "textual",
7
+ # ]
8
+ # ///
9
+
10
+ """Textual TUI for navigating `machineconfig` command structure."""
11
+
12
+
13
+ def main() -> None:
14
+ from machineconfig.scripts.python.helpers.helpers_navigator.main_app import CommandNavigatorApp
15
+
16
+ CommandNavigatorApp().run()
2
17
 
3
18
 
4
19
  if __name__ == "__main__":
5
- app = CommandNavigatorApp()
6
- app.run()
20
+ main()
@@ -1,187 +1,9 @@
1
- """
2
- fire
3
-
4
- # https://github.com/pallets/click combine with fire. Consider
5
- # https://github.com/ceccopierangiolieugenio/pyTermTk for choose_from_options build TUI
6
- # https://github.com/chriskiehl/Gooey build commandline interface
7
-
8
- """
1
+ """fire - Fire and manage jobs."""
9
2
 
10
3
  from typing import Optional, Annotated
11
4
  import typer
12
5
 
13
6
 
14
- def route(args: "FireJobArgs", fire_args: str = "") -> None:
15
- from pathlib import Path
16
- from machineconfig.utils.path_helper import get_choice_file
17
- from machineconfig.utils.accessories import get_repo_root, randstr
18
- choice_file = get_choice_file(args.path, suffixes=None)
19
- repo_root = get_repo_root(choice_file)
20
- print(f"💾 Selected file: {choice_file}.\nRepo root: {repo_root}")
21
- if args.marimo:
22
- print(f"🧽 Preparing to launch Marimo notebook for `{choice_file}`...")
23
- tmp_dir = Path.home().joinpath(f"tmp_results/tmp_scripts/marimo/{choice_file.stem}_{randstr()}")
24
- tmp_dir.mkdir(parents=True, exist_ok=True)
25
- script = f"""
26
- cd {tmp_dir}
27
- uv run --python 3.14 --with marimo marimo convert {choice_file} -o marimo_nb.py
28
- uv run --project {repo_root} --with marimo marimo edit --host 0.0.0.0 marimo_nb.py
29
- """
30
- from machineconfig.utils.code import exit_then_run_shell_script
31
- print(f"🚀 Launching Marimo notebook for `{choice_file}`...")
32
- exit_then_run_shell_script(script)
33
- return
34
-
35
- # ========================= preparing kwargs_dict
36
- if choice_file.suffix == ".py":
37
- from machineconfig.scripts.python.helpers_fire_command.fire_jobs_args_helper import extract_kwargs
38
- kwargs_dict = extract_kwargs(args) # This now returns empty dict, but kept for compatibility
39
- else:
40
- kwargs_dict = {}
41
-
42
- # ========================= choosing function to run
43
- choice_function: Optional[str] = None # Initialize to avoid unbound variable
44
- if args.choose_function:
45
- from machineconfig.scripts.python.helpers_fire_command.fire_jobs_route_helper import choose_function_or_lines
46
-
47
- choice_function, choice_file, kwargs_dict = choose_function_or_lines(choice_file, kwargs_dict)
48
- else:
49
- choice_function = args.function
50
-
51
- if choice_file.suffix == ".py":
52
- with_project = f"--project {repo_root} " if repo_root is not None else ""
53
- if args.streamlit:
54
- from machineconfig.scripts.python.helpers_fire_command.fire_jobs_route_helper import get_command_streamlit
55
- exe = get_command_streamlit(choice_file=choice_file, environment=args.environment, repo_root=repo_root)
56
- exe = f"uv run {with_project} {exe} "
57
- elif args.jupyter:
58
- exe = f"uv run {with_project} jupyter-lab"
59
- else:
60
- if args.interactive:
61
- from machineconfig.utils.ve import get_ve_path_and_ipython_profile
62
- _ve_root_from_file, ipy_profile = get_ve_path_and_ipython_profile(init_path=choice_file)
63
- if ipy_profile is None:
64
- ipy_profile = "default"
65
- exe = f"uv run {with_project} ipython -i --no-banner --profile {ipy_profile} "
66
- else:
67
- exe = f"uv run {with_project} python "
68
- elif choice_file.suffix == ".ps1" or choice_file.suffix == ".sh":
69
- exe = "."
70
- elif choice_file.suffix == "":
71
- exe = ""
72
- else:
73
- raise NotImplementedError(f"File type {choice_file.suffix} not supported, in the sense that I don't know how to fire it.")
74
-
75
- if args.module or (args.debug and args.choose_function):
76
- # because debugging tools do not support choosing functions and don't interplay with fire module. So the only way to have debugging and choose function options is to import the file as a module into a new script and run the function of interest there and debug the new script.
77
- assert choice_file.suffix == ".py", f"File must be a python file to be imported as a module. Got {choice_file}"
78
- from machineconfig.scripts.python.helpers_fire_command.file_wrangler import get_import_module_code, wrap_import_in_try_except
79
- from machineconfig.utils.meta import lambda_to_python_script
80
- from machineconfig.utils.code import print_code
81
-
82
- import_code = get_import_module_code(str(choice_file))
83
- import_code_robust = lambda_to_python_script(
84
- lambda: wrap_import_in_try_except(
85
- import_line=import_code, pyfile=str(choice_file), repo_root=str(repo_root) if repo_root is not None else None
86
- ),
87
- in_global=True,
88
- import_module=False,
89
- )
90
- # print(f"🧩 Preparing import code for module import:\n{import_code}")
91
- code_printing = lambda_to_python_script(
92
- lambda: print_code(code=import_code_robust, lexer="python", desc="import as module code"),
93
- in_global=True, import_module=False
94
- )
95
- print(f"🧩 Preparing import code for module import:\n{import_code}")
96
- if choice_function is not None:
97
- calling = f"""res = {choice_function}({("**" + str(kwargs_dict)) if kwargs_dict else ""})"""
98
- else:
99
- calling = """# No function selected to call. You can add your code here."""
100
- choice_file = Path.home().joinpath(f"tmp_results/tmp_scripts/python/{Path(choice_file).parent.name}_{Path(choice_file).stem}_{randstr()}.py")
101
- choice_file.parent.mkdir(parents=True, exist_ok=True)
102
- choice_file.write_text(import_code_robust + "\n" + code_printing + "\n" + calling, encoding="utf-8")
103
-
104
- # ========================= determining basic command structure: putting together exe & choice_file & choice_function & pdb
105
- if args.debug:
106
- import platform
107
- if platform.system() == "Windows":
108
- command = f"{exe} -m ipdb {choice_file} " # pudb is not available on windows machines, use poor man's debugger instead.
109
- elif platform.system() in ["Linux", "Darwin"]:
110
- command = f"{exe} -m pudb {choice_file} " # TODO: functions not supported yet in debug mode.
111
- else:
112
- raise NotImplementedError(f"Platform {platform.system()} not supported.")
113
- elif args.module:
114
- # both selected function and kwargs are mentioned in the made up script, therefore no need for fire module.
115
- command = f"{exe} {choice_file} "
116
- elif choice_function is not None and choice_file.suffix == ".py":
117
- command = f"{exe} -m fire {choice_file} {choice_function} {fire_args}"
118
- elif args.streamlit:
119
- # for .streamlit config to work, it needs to be in the current directory.
120
- if args.holdDirectory:
121
- command = f"{exe} {choice_file}"
122
- else:
123
- command = f"cd {choice_file.parent}\n{exe} {choice_file.name}\ncd {Path.cwd()}"
124
- elif args.cmd:
125
- command = rf""" cd /d {choice_file.parent} & {exe} {choice_file.name} """
126
- else:
127
- if choice_file.suffix == "":
128
- command = f"{exe} {choice_file} {fire_args}"
129
- else:
130
- command = f"{exe} {choice_file} "
131
-
132
- if not args.cmd:
133
- pass
134
- else:
135
- new_line = "\n"
136
- command = rf"""start cmd -Argument "/k {command.replace(new_line, " & ")} " """ # this works from powershell
137
- if args.submit_to_cloud:
138
- command = f"""uv run python -m machineconfig.cluster.templates.cli_click --file {choice_file} """
139
- if choice_function is not None:
140
- command += f"--function {choice_function} "
141
-
142
- if args.optimized:
143
- command = command.replace("python ", "python -OO ")
144
-
145
- from rich.panel import Panel
146
- from rich.console import Console
147
- from rich.syntax import Syntax
148
-
149
- console = Console()
150
- if args.zellij_tab is not None:
151
- comman_path__ = Path.home().joinpath(f"tmp_results/tmp_scripts/zellij_commands/{choice_file.stem}_{randstr()}.sh")
152
- comman_path__.parent.mkdir(parents=True, exist_ok=True)
153
- comman_path__.write_text(command, encoding="utf-8")
154
- console.print(Panel(Syntax(command, lexer="shell"), title=f"🔥 fire command @ {comman_path__}: "), style="bold red")
155
- import subprocess
156
-
157
- existing_tab_names = subprocess.run(["zellij", "action", "query-tab-names"], capture_output=True, text=True, check=True).stdout.splitlines()
158
- if args.zellij_tab in existing_tab_names:
159
- print(f"⚠️ Tab name `{args.zellij_tab}` already exists. Please choose a different name.")
160
- args.zellij_tab += f"_{randstr(3)}"
161
- from machineconfig.cluster.sessions_managers.zellij_local import run_command_in_zellij_tab
162
-
163
- command = run_command_in_zellij_tab(command=str(comman_path__), tab_name=args.zellij_tab, cwd=None)
164
- if args.watch:
165
- command = "watchexec --restart --exts py,sh,ps1 " + command
166
- if args.git_pull:
167
- command = f"\ngit -C {choice_file.parent} pull\n" + command
168
- if args.PathExport:
169
- from machineconfig.scripts.python.helpers_fire_command.file_wrangler import add_to_path
170
-
171
- export_line = add_to_path(path_variable="PYTHONPATH", directory=str(repo_root))
172
- command = export_line + "\n" + command
173
- if args.loop:
174
- import platform
175
- if platform.system() in ["Linux", "Darwin"]:
176
- command = command + "\nsleep 0.5"
177
- elif platform.system() == "Windows":
178
- command = "$ErrorActionPreference = 'SilentlyContinue';\n" + command + "\nStart-Sleep -Seconds 0.5"
179
- else:
180
- raise NotImplementedError(f"Platform {platform.system()} not supported.")
181
- from machineconfig.utils.code import exit_then_run_shell_script
182
- exit_then_run_shell_script(script=command, strict=False)
183
-
184
-
185
7
  def fire(
186
8
  ctx: typer.Context,
187
9
  path: Annotated[str, typer.Argument(help="Path to the Python file to run")] = ".",
@@ -195,23 +17,22 @@ def fire(
195
17
  jupyter: Annotated[bool, typer.Option("--jupyter", "-j", help="Open in a jupyter notebook")] = False,
196
18
  marimo: Annotated[bool, typer.Option("--marimo", "-M", help="Open in a marimo notebook")] = False,
197
19
  module: Annotated[bool, typer.Option("--module", "-m", help="Launch the main file")] = False,
20
+ script: Annotated[bool, typer.Option("--script", "-s", help="Launch as a script without fire")] = False,
198
21
  optimized: Annotated[bool, typer.Option("--optimized", "-O", help="Run the optimized version of the function")] = False,
199
22
  zellij_tab: Annotated[Optional[str], typer.Option("--zellij-tab", "-z", help="Open in a new zellij tab")] = None,
200
23
  submit_to_cloud: Annotated[bool, typer.Option("--submit-to-cloud", "-C", help="Submit to cloud compute")] = False,
201
24
  remote: Annotated[bool, typer.Option("--remote", "-r", help="Launch on a remote machine")] = False,
202
25
  streamlit: Annotated[bool, typer.Option("--streamlit", "-S", help="Run as streamlit app")] = False,
203
26
  environment: Annotated[str, typer.Option("--environment", "-E", help="Choose ip, localhost, hostname or arbitrary url")] = "",
204
- holdDirectory: Annotated[
205
- bool, typer.Option("--holdDirectory", "-D", help="Hold current directory and avoid cd'ing to the script directory")
206
- ] = False,
27
+ holdDirectory: Annotated[bool, typer.Option("--holdDirectory", "-D", help="Hold current directory and avoid cd'ing to the script directory")] = False,
207
28
  PathExport: Annotated[bool, typer.Option("--PathExport", "-P", help="Augment the PYTHONPATH with repo root")] = False,
208
29
  git_pull: Annotated[bool, typer.Option("--git-pull", "-g", help="Start by pulling the git repo")] = False,
209
30
  watch: Annotated[bool, typer.Option("--watch", "-w", help="Watch the file for changes")] = False,
210
31
  ) -> None:
211
32
  """Main function to process fire jobs arguments."""
33
+ from machineconfig.scripts.python.helpers.helpers_fire_command.fire_jobs_args_helper import FireJobArgs, parse_fire_args_from_context
34
+ from machineconfig.scripts.python.helpers.helpers_fire_command.fire_jobs_impl import route
212
35
 
213
- # Get Fire arguments from context
214
- from machineconfig.scripts.python.helpers_fire_command.fire_jobs_args_helper import FireJobArgs, parse_fire_args_from_context
215
36
  fire_args = parse_fire_args_from_context(ctx)
216
37
 
217
38
  args = FireJobArgs(
@@ -228,6 +49,7 @@ def fire(
228
49
  submit_to_cloud=submit_to_cloud,
229
50
  remote=remote,
230
51
  module=module,
52
+ script=script,
231
53
  streamlit=streamlit,
232
54
  environment=environment,
233
55
  holdDirectory=holdDirectory,
@@ -240,28 +62,23 @@ def fire(
240
62
  try:
241
63
  route(args, fire_args)
242
64
  except SystemExit:
243
- # Re-raise SystemExit to preserve exit codes and allow clean exits
244
65
  raise
245
66
  except Exception as e:
246
- # For other exceptions, print clean error message and exit
247
67
  import sys
248
-
249
68
  print(f"❌ Error: {e}", file=sys.stderr)
250
69
  sys.exit(1)
251
70
 
252
71
 
253
- def get_app():
254
- from typer import Typer
255
-
256
- app = Typer(add_completion=False)
72
+ def get_app() -> typer.Typer:
73
+ app = typer.Typer(add_completion=False)
257
74
  app.command(context_settings={"allow_extra_args": True, "allow_interspersed_args": False})(fire)
258
75
  return app
259
76
 
260
77
 
261
- def main():
78
+ def main() -> None:
262
79
  app = get_app()
263
80
  app()
264
81
 
265
82
 
266
83
  if __name__ == "__main__":
267
- from machineconfig.scripts.python.helpers_fire_command.fire_jobs_args_helper import FireJobArgs
84
+ pass