machineconfig 7.98__py3-none-any.whl → 8.61__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.
- machineconfig/cluster/remote/run_cluster.py +1 -1
- machineconfig/cluster/remote/run_remote.py +1 -1
- machineconfig/cluster/sessions_managers/utils/maker.py +10 -8
- machineconfig/cluster/sessions_managers/wt_local.py +1 -1
- machineconfig/cluster/sessions_managers/wt_local_manager.py +1 -1
- machineconfig/cluster/sessions_managers/zellij_local.py +1 -1
- machineconfig/cluster/sessions_managers/zellij_local_manager.py +1 -1
- machineconfig/jobs/installer/checks/check_installations.py +133 -0
- machineconfig/jobs/installer/checks/install_utils.py +132 -0
- machineconfig/jobs/installer/checks/report_utils.py +39 -0
- machineconfig/jobs/installer/checks/vt_utils.py +89 -0
- machineconfig/jobs/installer/installer_data.json +271 -152
- machineconfig/jobs/installer/linux_scripts/docker.sh +6 -9
- machineconfig/jobs/installer/package_groups.py +11 -9
- machineconfig/jobs/installer/{custom → python_scripts}/boxes.py +1 -2
- machineconfig/jobs/installer/{custom_dev → python_scripts}/brave.py +1 -1
- machineconfig/jobs/installer/{custom_dev → python_scripts}/code.py +10 -8
- machineconfig/jobs/installer/{custom → python_scripts}/hx.py +30 -13
- machineconfig/jobs/installer/{custom_dev → python_scripts}/nerdfont.py +1 -1
- machineconfig/jobs/installer/{custom_dev → python_scripts}/nerfont_windows_helper.py +6 -5
- machineconfig/jobs/installer/{custom_dev → python_scripts}/sysabc.py +28 -43
- machineconfig/jobs/installer/{custom_dev → python_scripts}/wezterm.py +1 -1
- machineconfig/jobs/installer/{custom → python_scripts}/yazi.py +39 -19
- machineconfig/jobs/scripts/powershell_scripts/cmatrix.ps1 +52 -0
- machineconfig/jobs/scripts_dynamic/a.py +428 -0
- machineconfig/logger.py +1 -1
- machineconfig/profile/create_helper.py +21 -10
- machineconfig/profile/create_links.py +77 -20
- machineconfig/profile/create_links_export.py +63 -58
- machineconfig/profile/create_shell_profile.py +14 -0
- machineconfig/profile/mapper_data.toml +45 -0
- machineconfig/profile/mapper_dotfiles.toml +249 -0
- machineconfig/scripts/python/agents.py +76 -171
- machineconfig/scripts/python/ai/initai.py +3 -1
- machineconfig/scripts/python/ai/scripts/__init__.py +1 -0
- machineconfig/scripts/python/ai/scripts/lint_and_type_check.ps1 +2 -0
- machineconfig/scripts/python/ai/scripts/lint_and_type_check.sh +8 -6
- machineconfig/scripts/python/ai/solutions/claude/claude.py +1 -1
- machineconfig/scripts/python/ai/solutions/cline/cline.py +1 -1
- machineconfig/scripts/python/ai/solutions/copilot/github_copilot.py +1 -1
- machineconfig/scripts/python/ai/solutions/copilot/instructions/python/dev.instructions.md +29 -0
- machineconfig/scripts/python/ai/solutions/crush/crush.py +1 -1
- machineconfig/scripts/python/ai/solutions/cursor/cursors.py +1 -1
- machineconfig/scripts/python/ai/solutions/gemini/gemini.py +1 -1
- machineconfig/scripts/python/ai/solutions/gemini/settings.json +3 -0
- machineconfig/scripts/python/ai/{solutions → utils}/generic.py +2 -15
- machineconfig/scripts/python/ai/utils/vscode_tasks.py +6 -3
- machineconfig/scripts/python/cloud.py +58 -11
- machineconfig/scripts/python/croshell.py +4 -155
- machineconfig/scripts/python/devops.py +57 -38
- machineconfig/scripts/python/devops_navigator.py +17 -3
- machineconfig/scripts/python/fire_jobs.py +10 -193
- machineconfig/scripts/python/ftpx.py +5 -224
- machineconfig/scripts/python/graph/cli_graph.json +8743 -0
- machineconfig/scripts/python/{env_manager → helper_env}/path_manager_tui.py +2 -2
- machineconfig/scripts/python/{env_manager → helpers/helper_env}/env_manager_tui.py +1 -1
- machineconfig/scripts/python/helpers/helper_env/path_manager_tui.py +228 -0
- machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/agentic_frameworks/fire_crush.py +1 -1
- machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/agentic_frameworks/fire_cursor_agents.py +1 -1
- machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/agentic_frameworks/fire_gemini.py +1 -1
- machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/agentic_frameworks/fire_qwen.py +1 -1
- machineconfig/scripts/python/helpers/helpers_agents/agents_impl.py +168 -0
- machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/fire_agents_help_launch.py +10 -7
- machineconfig/scripts/python/helpers/helpers_agents/privacy/configs/aichat/config.yaml +5 -0
- machineconfig/scripts/python/helpers/helpers_agents/privacy/configs/aider/.aider.conf.yml +2 -0
- machineconfig/scripts/python/helpers/helpers_agents/privacy/configs/copilot/config.yml +1 -0
- machineconfig/scripts/python/helpers/helpers_agents/privacy/configs/crush/crush.json +10 -0
- machineconfig/scripts/python/helpers/helpers_agents/privacy/configs/gemini/settings.json +12 -0
- machineconfig/scripts/python/helpers/helpers_agents/privacy/privacy.py +109 -0
- machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/templates/template.sh +3 -1
- machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/cloud_copy.py +6 -6
- machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/cloud_mount.py +10 -5
- machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/cloud_sync.py +4 -4
- machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/helpers2.py +1 -1
- machineconfig/scripts/python/helpers/helpers_croshell/croshell_impl.py +229 -0
- machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/scheduler.py +4 -4
- machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/start_slidev.py +7 -6
- machineconfig/scripts/python/helpers/helpers_devops/backup_config.py +149 -0
- machineconfig/scripts/python/helpers/helpers_devops/cli_backup_retrieve.py +262 -0
- machineconfig/scripts/python/helpers/helpers_devops/cli_config.py +130 -0
- machineconfig/scripts/python/helpers/helpers_devops/cli_config_dotfile.py +274 -0
- machineconfig/scripts/python/helpers/helpers_devops/cli_config_mount.py +77 -0
- machineconfig/scripts/python/helpers/helpers_devops/cli_data.py +71 -0
- machineconfig/scripts/python/helpers/helpers_devops/cli_nw.py +285 -0
- machineconfig/scripts/python/helpers/helpers_devops/cli_repos.py +274 -0
- machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/cli_self.py +84 -33
- machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/cli_share_file.py +44 -30
- machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/cli_share_server.py +26 -43
- machineconfig/scripts/python/helpers/helpers_devops/cli_share_temp.py +69 -0
- machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/cli_share_terminal.py +12 -6
- machineconfig/scripts/python/helpers/helpers_devops/cli_ssh.py +167 -0
- machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/devops_status.py +12 -6
- machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/devops_update_repos.py +1 -1
- machineconfig/scripts/python/{interactive.py → helpers/helpers_devops/interactive.py} +64 -50
- machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/commands.py +25 -0
- machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/device_entry.py +17 -0
- machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/devices.py +17 -0
- machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/linux.py +103 -0
- machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/macos.py +100 -0
- machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/selection.py +47 -0
- machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/utils.py +28 -0
- machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/windows.py +91 -0
- machineconfig/scripts/python/helpers/helpers_devops/run_script.py +197 -0
- machineconfig/scripts/python/helpers/helpers_devops/themes/choose_starship_theme.ps1 +41 -0
- machineconfig/scripts/python/helpers/helpers_devops/themes/choose_starship_theme.sh +48 -0
- machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/themes/choose_wezterm_theme.py +3 -3
- machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_fire_command}/file_wrangler.py +1 -0
- machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_fire_command}/fire_jobs_args_helper.py +1 -0
- machineconfig/scripts/python/helpers/helpers_fire_command/fire_jobs_impl.py +233 -0
- machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_fire_command}/fire_jobs_route_helper.py +3 -3
- machineconfig/scripts/python/helpers/helpers_fire_command/fire_jobs_streamlit_helper.py +0 -0
- machineconfig/scripts/python/helpers/helpers_msearch/msearch_impl.py +248 -0
- machineconfig/scripts/python/{helpers_msearch → helpers/helpers_msearch}/scripts_linux/fzfg +4 -3
- machineconfig/scripts/python/helpers/helpers_msearch/scripts_linux/search_with_context.sh +48 -0
- machineconfig/scripts/python/{helpers_msearch → helpers/helpers_msearch}/scripts_windows/fzfg.ps1 +2 -7
- machineconfig/scripts/python/helpers/helpers_navigator/__init__.py +20 -0
- machineconfig/scripts/python/helpers/helpers_navigator/cli_graph_loader.py +234 -0
- machineconfig/scripts/python/{helpers_navigator → helpers/helpers_navigator}/command_builder.py +61 -13
- machineconfig/scripts/python/helpers/helpers_navigator/command_detail.py +153 -0
- machineconfig/scripts/python/helpers/helpers_navigator/command_tree.py +45 -0
- machineconfig/scripts/python/{helpers_navigator → helpers/helpers_navigator}/data_models.py +18 -11
- machineconfig/scripts/python/{helpers_navigator → helpers/helpers_navigator}/main_app.py +5 -5
- machineconfig/scripts/python/helpers/helpers_network/__init__.py +0 -0
- machineconfig/scripts/python/{helpers_network → helpers/helpers_network}/address.py +52 -10
- machineconfig/scripts/python/helpers/helpers_network/address_switch.py +78 -0
- machineconfig/scripts/python/helpers/helpers_network/ftpx_impl.py +276 -0
- machineconfig/scripts/python/helpers/helpers_network/ssh/__init__.py +0 -0
- machineconfig/scripts/python/helpers/helpers_network/ssh/ssh_add_identity.py +73 -0
- machineconfig/scripts/python/helpers/helpers_network/ssh/ssh_add_key_windows.py +23 -0
- machineconfig/scripts/python/helpers/helpers_network/ssh/ssh_add_ssh_key.py +169 -0
- machineconfig/scripts/python/helpers/helpers_network/ssh/ssh_cloud_init.py +33 -0
- machineconfig/scripts/python/helpers/helpers_network/ssh/ssh_debug_linux.py +338 -0
- machineconfig/scripts/python/helpers/helpers_network/ssh/ssh_debug_linux_utils.py +35 -0
- machineconfig/scripts/python/helpers/helpers_network/ssh/ssh_debug_windows.py +245 -0
- machineconfig/scripts/python/helpers/helpers_network/ssh/ssh_debug_windows_utils.py +34 -0
- machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/action.py +3 -3
- machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/action_helper.py +3 -3
- machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/cloud_repo_sync.py +120 -37
- machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/grource.py +3 -2
- machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/record.py +33 -13
- machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/repo_analyzer_2.py +63 -19
- machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/update.py +0 -6
- machineconfig/scripts/python/helpers/helpers_search/script_help.py +81 -0
- machineconfig/scripts/python/helpers/helpers_sessions/__init__.py +0 -0
- machineconfig/scripts/python/helpers/helpers_sessions/attach_impl.py +87 -0
- machineconfig/scripts/python/helpers/helpers_sessions/sessions_impl.py +114 -0
- machineconfig/scripts/python/{helpers_sessions → helpers/helpers_sessions}/sessions_multiprocess.py +1 -2
- machineconfig/scripts/python/helpers/helpers_sessions/utils.py +69 -0
- machineconfig/scripts/python/{helpers_utils → helpers/helpers_utils}/download.py +1 -1
- machineconfig/scripts/python/{helpers_devops/cli_utils.py → helpers/helpers_utils/pdf.py} +2 -2
- machineconfig/scripts/python/{helpers_utils/path.py → helpers/helpers_utils/python.py} +65 -40
- machineconfig/scripts/python/helpers/helpers_utils/specs.py +246 -0
- machineconfig/scripts/python/mcfg_entry.py +126 -48
- machineconfig/scripts/python/msearch.py +16 -61
- machineconfig/scripts/python/sessions.py +137 -191
- machineconfig/scripts/python/utils.py +104 -24
- machineconfig/settings/atuin/config.toml +294 -0
- machineconfig/settings/atuin/themes/catppuccin-mocha-mauve.toml +12 -0
- machineconfig/settings/linters/.ruff.toml +2 -1
- machineconfig/settings/mprocs/windows/mprocs.yaml +2 -2
- machineconfig/settings/shells/bash/init.sh +6 -10
- machineconfig/settings/shells/nushell/config.nu +23 -1
- machineconfig/settings/shells/nushell/env.nu +22 -48
- machineconfig/settings/shells/nushell/init.nu +64 -240
- machineconfig/settings/shells/pwsh/init.ps1 +71 -5
- machineconfig/settings/shells/pwsh/search_pwsh_history.ps1 +99 -0
- machineconfig/settings/shells/wezterm/wezterm.lua +4 -0
- machineconfig/settings/shells/wt/settings.json +31 -37
- machineconfig/settings/shells/zsh/init.sh +25 -5
- machineconfig/settings/television/cable_unix/bash-history.toml +1 -1
- machineconfig/settings/television/cable_windows/pwsh-history.toml +1 -1
- machineconfig/settings/tv/config.toml +234 -0
- machineconfig/settings/tv/themes/catppuccin-mocha-sky.toml +22 -0
- machineconfig/settings/wsl/.wslconfig +5 -30
- machineconfig/settings/wt/__init__.py +0 -0
- machineconfig/settings/yazi/yazi_linux.toml +18 -8
- machineconfig/settings/zellij/__init__.py +0 -0
- machineconfig/settings/zellij/config.kdl +0 -295
- machineconfig/settings/zellij/layouts/__init__.py +0 -0
- machineconfig/settings/zellij/layouts/st.kdl +39 -9
- machineconfig/settings/zellij/layouts/st2.kdl +6 -2
- machineconfig/setup_linux/__init__.py +0 -1
- machineconfig/setup_linux/apps_desktop.sh +8 -27
- machineconfig/setup_linux/web_shortcuts/interactive.sh +10 -10
- machineconfig/setup_linux/web_shortcuts/live_from_github.sh +3 -0
- machineconfig/setup_mac/__init__.py +0 -2
- machineconfig/setup_windows/__init__.py +2 -5
- machineconfig/setup_windows/web_shortcuts/interactive.ps1 +14 -13
- machineconfig/setup_windows/web_shortcuts/live_from_github.ps1 +4 -3
- machineconfig/setup_windows/web_shortcuts/quick_init.ps1 +3 -3
- machineconfig/type_hinting/sql/__init__.py +1 -0
- machineconfig/type_hinting/sql/base.py +216 -0
- machineconfig/type_hinting/sql/core_schema.py +64 -0
- machineconfig/type_hinting/sql/core_schema_typeddict.py +41 -0
- machineconfig/type_hinting/sql/typeddict_codegen.py +222 -0
- machineconfig/type_hinting/typedict/__init__.py +1 -0
- machineconfig/type_hinting/typedict/ast_utils.py +130 -0
- machineconfig/type_hinting/typedict/generator_helpers.py +319 -0
- machineconfig/type_hinting/typedict/generators.py +231 -0
- machineconfig/type_hinting/typedict/polars_schema.py +24 -0
- machineconfig/type_hinting/typedict/polars_schema_typeddict.py +63 -0
- machineconfig/utils/accessories.py +24 -0
- machineconfig/utils/code.py +78 -33
- machineconfig/utils/files/ascii_art.py +10 -14
- machineconfig/utils/files/headers.py +3 -5
- machineconfig/utils/files/read.py +8 -1
- machineconfig/utils/installer_utils/github_release_bulk.py +11 -91
- machineconfig/utils/installer_utils/github_release_scraper.py +99 -0
- machineconfig/utils/installer_utils/install_from_url.py +1 -1
- machineconfig/utils/installer_utils/installer_class.py +12 -4
- machineconfig/utils/installer_utils/installer_cli.py +7 -17
- machineconfig/utils/installer_utils/installer_helper.py +52 -36
- machineconfig/utils/installer_utils/installer_locator_utils.py +15 -25
- machineconfig/utils/installer_utils/installer_runner.py +4 -4
- machineconfig/utils/io.py +25 -8
- machineconfig/utils/meta.py +6 -4
- machineconfig/utils/options.py +49 -19
- machineconfig/utils/options_utils/__init__.py +0 -0
- machineconfig/utils/options_utils/options_tv_linux.py +211 -0
- machineconfig/utils/options_utils/options_tv_windows.py +88 -0
- machineconfig/utils/options_utils/tv_options.py +37 -0
- machineconfig/utils/path_extended.py +8 -7
- machineconfig/utils/procs.py +35 -27
- machineconfig/utils/scheduler.py +8 -2
- machineconfig/utils/schemas/fire_agents/fire_agents_input.py +1 -1
- machineconfig/utils/schemas/layouts/layout_types.py +10 -0
- machineconfig/utils/source_of_truth.py +7 -1
- machineconfig/utils/ssh.py +73 -23
- machineconfig/utils/ssh_utils/abc.py +1 -1
- machineconfig/utils/ssh_utils/copy_from_here.py +19 -14
- machineconfig/utils/ssh_utils/copy_to_here.py +2 -1
- machineconfig/utils/ssh_utils/utils.py +23 -7
- machineconfig/utils/ssh_utils/wsl.py +107 -170
- machineconfig/utils/ssh_utils/wsl_helper.py +217 -0
- machineconfig/utils/upgrade_packages.py +4 -8
- {machineconfig-7.98.dist-info → machineconfig-8.61.dist-info}/METADATA +30 -23
- machineconfig-8.61.dist-info/RECORD +539 -0
- {machineconfig-7.98.dist-info → machineconfig-8.61.dist-info}/entry_points.txt +0 -1
- machineconfig/jobs/installer/check_installations.py +0 -248
- machineconfig/profile/backup.toml +0 -49
- machineconfig/profile/mapper.toml +0 -263
- machineconfig/scripts/linux/other/share_cloud.sh +0 -64
- machineconfig/scripts/linux/other/share_nfs +0 -49
- machineconfig/scripts/linux/other/start_docker +0 -23
- machineconfig/scripts/linux/other/switch_ip +0 -20
- machineconfig/scripts/python/helpers/run_py_script.py +0 -79
- machineconfig/scripts/python/helpers/tmp_py_scripts/a.py +0 -26
- machineconfig/scripts/python/helpers_devops/cli_config.py +0 -105
- machineconfig/scripts/python/helpers_devops/cli_config_dotfile.py +0 -89
- machineconfig/scripts/python/helpers_devops/cli_data.py +0 -25
- machineconfig/scripts/python/helpers_devops/cli_nw.py +0 -214
- machineconfig/scripts/python/helpers_devops/cli_repos.py +0 -215
- machineconfig/scripts/python/helpers_devops/devops_backup_retrieve.py +0 -80
- machineconfig/scripts/python/helpers_devops/themes/choose_starship_theme.bash +0 -3
- machineconfig/scripts/python/helpers_navigator/__init__.py +0 -20
- machineconfig/scripts/python/helpers_navigator/command_detail.py +0 -44
- machineconfig/scripts/python/helpers_navigator/command_tree.py +0 -620
- machineconfig/scripts/python/helpers_network/devops_add_identity.py +0 -82
- machineconfig/scripts/python/helpers_network/devops_add_ssh_key.py +0 -153
- machineconfig/scripts/python/helpers_network/mount_drive +0 -128
- machineconfig/scripts/python/helpers_network/mount_nfs +0 -49
- machineconfig/scripts/python/helpers_network/mount_nfs.py +0 -85
- machineconfig/scripts/python/helpers_network/mount_nw_drive +0 -61
- machineconfig/scripts/python/helpers_network/mount_nw_drive.py +0 -48
- machineconfig/scripts/python/helpers_network/mount_smb +0 -3
- machineconfig/scripts/python/helpers_network/mount_ssh.py +0 -64
- machineconfig/scripts/python/helpers_network/ssh_debug_linux.py +0 -391
- machineconfig/scripts/python/helpers_network/ssh_debug_windows.py +0 -338
- machineconfig/scripts/python/helpers_network/wsl_windows_transfer.py +0 -67
- machineconfig/scripts/python/helpers_repos/entrypoint.py +0 -77
- machineconfig/scripts/python/terminal.py +0 -133
- machineconfig/scripts/windows/mounts/Restore-ThunderbirdProfile.ps1 +0 -92
- machineconfig/scripts/windows/mounts/mount_nfs.ps1 +0 -42
- machineconfig/scripts/windows/mounts/mount_nw.ps1 +0 -9
- machineconfig/scripts/windows/mounts/mount_smb.ps1 +0 -2
- machineconfig/scripts/windows/mounts/mount_ssh.ps1 +0 -13
- machineconfig/scripts/windows/mounts/share_cloud.cmd +0 -34
- machineconfig/scripts/windows/mounts/share_smb.ps1 +0 -16
- machineconfig/settings/zellij/config.orig.kdl +0 -295
- machineconfig/setup_linux/others/android.sh +0 -2
- machineconfig/setup_linux/others/mint_keyboard_shortcuts.sh +0 -30
- machineconfig/setup_linux/ssh/openssh_all.sh +0 -25
- machineconfig/setup_linux/ssh/openssh_wsl.sh +0 -38
- machineconfig/setup_mac/ssh/openssh_setup.sh +0 -114
- machineconfig/setup_windows/others/docker.ps1 +0 -7
- machineconfig/setup_windows/others/obs.ps1 +0 -4
- machineconfig/setup_windows/others/power_options.ps1 +0 -7
- machineconfig/setup_windows/ssh/add-sshkey.ps1 +0 -29
- machineconfig/setup_windows/ssh/add_identity.ps1 +0 -11
- machineconfig/setup_windows/ssh/openssh-server.ps1 +0 -37
- machineconfig/setup_windows/ssh/openssh-server_add_key.ps1 +0 -7
- machineconfig/setup_windows/ssh/openssh-server_copy-ssh-id.ps1 +0 -14
- machineconfig/utils/options_tv.py +0 -119
- machineconfig/utils/tst.py +0 -20
- machineconfig-7.98.dist-info/RECORD +0 -504
- /machineconfig/{jobs/installer/custom_dev → cluster/sessions_managers/wt_utils/examples}/__init__.py +0 -0
- /machineconfig/{scripts/python/helpers_agents → jobs/installer/checks}/__init__.py +0 -0
- /machineconfig/{scripts/python/helpers_agents/agentic_frameworks → jobs/installer/python_scripts}/__init__.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/alacritty.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/bypass_paywall.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/cloudflare_warp_cli.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/cursor.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/dubdb_adbc.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/espanso.py +0 -0
- /machineconfig/jobs/installer/{custom → python_scripts}/gh.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/goes.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/lvim.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/redis.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/winget.py +0 -0
- /machineconfig/jobs/{installer/linux_scripts → scripts/bash_scripts}/lid.sh +0 -0
- /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/unlock_bitlocker.ps1 +0 -0
- /machineconfig/scripts/python/ai/{solutions/_shared.py → utils/shared.py} +0 -0
- /machineconfig/scripts/python/{helpers_cloud → graph}/__init__.py +0 -0
- /machineconfig/scripts/python/{helpers_croshell → helpers}/__init__.py +0 -0
- /machineconfig/scripts/python/{env_manager → helpers/helper_env}/__init__.py +0 -0
- /machineconfig/scripts/python/{env_manager → helpers/helper_env}/path_manager_backend.py +0 -0
- /machineconfig/scripts/python/{helpers_devops → helpers/helpers_agents}/__init__.py +0 -0
- /machineconfig/scripts/python/{helpers_devops/themes → helpers/helpers_agents/agentic_frameworks}/__init__.py +0 -0
- /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/agentic_frameworks/fire_crush.json +0 -0
- /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/fire_agents_help_search.py +0 -0
- /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/fire_agents_helper_types.py +0 -0
- /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/fire_agents_load_balancer.py +0 -0
- /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/templates/prompt.txt +0 -0
- /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/templates/template.ps1 +0 -0
- /machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_cloud}/__init__.py +0 -0
- /machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/cloud_helpers.py +0 -0
- /machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/helpers5.py +0 -0
- /machineconfig/scripts/python/{helpers_network → helpers/helpers_croshell}/__init__.py +0 -0
- /machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/crosh.py +0 -0
- /machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/pomodoro.py +0 -0
- /machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/viewer.py +0 -0
- /machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/viewer_template.py +0 -0
- /machineconfig/scripts/python/{helpers_sessions → helpers/helpers_devops}/__init__.py +0 -0
- /machineconfig/{setup_windows/wt_and_pwsh → scripts/python/helpers/helpers_devops/mount_helpers}/__init__.py +0 -0
- /machineconfig/scripts/python/{helpers_devops/themes/choose_starship_theme.ps1 → helpers/helpers_devops/themes/__init__.py} +0 -0
- /machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/themes/choose_pwsh_theme.ps1 +0 -0
- /machineconfig/scripts/python/{helpers_fire_command/f.py → helpers/helpers_fire_command/__init__.py} +0 -0
- /machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_fire_command}/cloud_manager.py +0 -0
- /machineconfig/scripts/python/{helpers_fire_command/fire_jobs_streamlit_helper.py → helpers/helpers_fire_command/f.py} +0 -0
- /machineconfig/scripts/python/{helpers_msearch → helpers/helpers_msearch}/__init__.py +0 -0
- /machineconfig/scripts/python/{helpers_navigator → helpers/helpers_navigator}/search_bar.py +0 -0
- /machineconfig/scripts/python/{helpers_network → helpers/helpers_network}/onetimeshare.py +0 -0
- /machineconfig/scripts/python/{helpers_network → helpers/helpers_network}/wifi_conn.py +0 -0
- /machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/clone.py +0 -0
- /machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/repo_analyzer_1.py +0 -0
- /machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/sync.py +0 -0
- /machineconfig/scripts/python/helpers/{ast_search.py → helpers_search/ast_search.py} +0 -0
- /machineconfig/scripts/python/helpers/{qr_code.py → helpers_search/qr_code.py} +0 -0
- /machineconfig/scripts/python/helpers/{repo_rag.py → helpers_search/repo_rag.py} +0 -0
- /machineconfig/scripts/python/helpers/{symantic_search.py → helpers_search/symantic_search.py} +0 -0
- /machineconfig/{setup_windows/wt_and_pwsh → settings/wt}/set_wt_settings.py +0 -0
- {machineconfig-7.98.dist-info → machineconfig-8.61.dist-info}/WHEEL +0 -0
- {machineconfig-7.98.dist-info → machineconfig-8.61.dist-info}/top_level.txt +0 -0
|
@@ -1,71 +1,26 @@
|
|
|
1
|
+
"""msearch - Machineconfig search helper."""
|
|
1
2
|
|
|
2
3
|
import typer
|
|
3
4
|
from typing import Annotated
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
def machineconfig_search(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
install_if_missing("bat")
|
|
21
|
-
install_if_missing("fd")
|
|
22
|
-
install_if_missing("rg") # ripgrep
|
|
23
|
-
install_if_missing("rga") # ripgrep-all
|
|
24
|
-
# install_if_missing("tree-sitter-cli")
|
|
25
|
-
return
|
|
26
|
-
if symantic:
|
|
27
|
-
script = ""
|
|
28
|
-
for an_ex in extension.split(","):
|
|
29
|
-
script = script + f"""\nparse *.{an_ex} """
|
|
30
|
-
from machineconfig.utils.code import run_shell_script
|
|
31
|
-
run_shell_script(script=script)
|
|
32
|
-
return
|
|
33
|
-
if ast:
|
|
34
|
-
from machineconfig.scripts.python.helpers.ast_search import get_repo_symbols
|
|
35
|
-
symbols = get_repo_symbols(directory)
|
|
36
|
-
from machineconfig.utils.options import choose_from_options
|
|
37
|
-
try:
|
|
38
|
-
res = choose_from_options(options=symbols, msg="Select a symbol to search for:", tv=True, multi=False)
|
|
39
|
-
from rich import print_json
|
|
40
|
-
import json
|
|
41
|
-
res_json = json.dumps(res, indent=4)
|
|
42
|
-
print_json(res_json)
|
|
43
|
-
return None
|
|
44
|
-
except Exception as e:
|
|
45
|
-
print(f"❌ Error during selection: {e}")
|
|
46
|
-
return None
|
|
47
|
-
if file:
|
|
48
|
-
script = """fzf --ansi --preview-window 'right:60%' --preview 'bat --color=always --style=numbers,grid,header --line-range :300 {}' """
|
|
49
|
-
if no_dotfiles:
|
|
50
|
-
script = "fd | " + script
|
|
51
|
-
from machineconfig.utils.code import run_shell_script
|
|
52
|
-
run_shell_script(script=script)
|
|
53
|
-
return
|
|
54
|
-
from machineconfig.scripts.python.helpers_msearch import FZFG_LINUX_PATH, FZFG_WINDOWS_PATH
|
|
55
|
-
import platform
|
|
56
|
-
if platform.system() == "Linux" or platform.system() == "Darwin":
|
|
57
|
-
script = FZFG_LINUX_PATH.read_text(encoding="utf-8")
|
|
58
|
-
elif platform.system() == "Windows":
|
|
59
|
-
script = FZFG_WINDOWS_PATH.read_text(encoding="utf-8")
|
|
60
|
-
else:
|
|
61
|
-
raise RuntimeError("Unsupported platform")
|
|
62
|
-
if rga:
|
|
63
|
-
script = script.replace("rg ", "rga ").replace("ripgrep", "ripgrep-all")
|
|
64
|
-
from machineconfig.utils.code import exit_then_run_shell_script
|
|
65
|
-
exit_then_run_shell_script(script=script, strict=False)
|
|
8
|
+
path: Annotated[str, typer.Argument(help="The directory/file to search")] = ".",
|
|
9
|
+
ast: Annotated[bool, typer.Option(..., "--ast", "-a", help="The abstract syntax tree search/ tree sitter search of symbols")] = False,
|
|
10
|
+
symantic: Annotated[bool, typer.Option(..., "--symantic", "-s", help="The symantic search of symbols")] = False,
|
|
11
|
+
extension: Annotated[str, typer.Option(..., "--extension", "-E", help="File extension to filter by (e.g., .py, .js)")] = "",
|
|
12
|
+
file: Annotated[bool, typer.Option(..., "--file", "-f", help="File search using fzf")] = False,
|
|
13
|
+
no_dotfiles: Annotated[bool, typer.Option(..., "--no-dotfiles", "-D", help="Exclude dotfiles from search")] = False,
|
|
14
|
+
rga: Annotated[bool, typer.Option(..., "--rga", "-A", help="Use ripgrep-all for searching all (non text files) instead of ripgrep")] = False,
|
|
15
|
+
edit: Annotated[bool, typer.Option(..., "--edit", "-e", help="Open selection in editor (helix)")] = False,
|
|
16
|
+
install_dependencies: Annotated[bool, typer.Option(..., "--install-req", "-i", help="Install required dependencies if missing")] = False,
|
|
17
|
+
) -> None:
|
|
18
|
+
"""Machineconfig search helper."""
|
|
19
|
+
from machineconfig.scripts.python.helpers.helpers_msearch.msearch_impl import machineconfig_search as impl
|
|
20
|
+
impl(path=path, ast=ast, symantic=symantic, extension=extension, file=file, no_dotfiles=no_dotfiles, rga=rga, edit=edit, install_dependencies=install_dependencies)
|
|
66
21
|
|
|
67
22
|
|
|
68
|
-
def main():
|
|
23
|
+
def main() -> None:
|
|
69
24
|
app = typer.Typer(add_completion=False, no_args_is_help=True)
|
|
70
|
-
app.command(name="msearch", help="machineconfig search helper", no_args_is_help=False)(machineconfig_search)
|
|
25
|
+
app.command(name="msearch", help=machineconfig_search.__doc__, short_help="machineconfig search helper", no_args_is_help=False)(machineconfig_search)
|
|
71
26
|
app()
|
|
@@ -1,221 +1,167 @@
|
|
|
1
|
+
"""Sessions management commands - lazy loading subcommands."""
|
|
1
2
|
|
|
2
3
|
from typing import Optional, Literal, Annotated
|
|
3
4
|
import typer
|
|
4
5
|
|
|
5
6
|
|
|
6
|
-
def balance_load(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
def balance_load(
|
|
8
|
+
layout_path: Annotated[str, typer.Argument(..., help="Path to the layout.json file")],
|
|
9
|
+
max_thresh: Annotated[int, typer.Option(..., "--max-threshold", "-m", help="Maximum tabs per layout")],
|
|
10
|
+
thresh_type: Annotated[Literal["number", "n", "weight", "w"], typer.Option(..., "--threshold-type", "-t", help="Threshold type")],
|
|
11
|
+
breaking_method: Annotated[Literal["moreLayouts", "ml", "combineTabs", "ct"], typer.Option(..., "--breaking-method", "-b", help="Breaking method")],
|
|
12
|
+
output_path: Annotated[Optional[str], typer.Option(..., "--output-path", "-o", help="Path to write the adjusted layout.json file")] = None,
|
|
13
|
+
) -> None:
|
|
11
14
|
"""Adjust layout file to limit max tabs per layout, etc."""
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
target_file = Path(output_path) if output_path is not None else layout_path_obj.parent / f'{layout_path_obj.stem}_adjusted_{max_thresh}_{thresh_type}_{breaking_method}.json'
|
|
35
|
-
target_file.parent.mkdir(parents=True, exist_ok=True)
|
|
36
|
-
target_file.write_text(data=json.dumps(layoutfile, indent=4), encoding="utf-8")
|
|
37
|
-
typer.echo(f"Adjusted layout saved to {target_file}")
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def select_layout(layouts_json_file: str, selected_layouts_names: Optional[list[str]], select_interactively: bool,
|
|
41
|
-
subsitute_home: bool
|
|
42
|
-
) -> list["LayoutConfig"]:
|
|
43
|
-
import json
|
|
44
|
-
from machineconfig.utils.options import choose_from_options
|
|
45
|
-
from machineconfig.utils.schemas.layouts.layout_types import LayoutsFile
|
|
46
|
-
from pathlib import Path
|
|
47
|
-
json_str = Path(layouts_json_file).read_text(encoding="utf-8")
|
|
48
|
-
if subsitute_home:
|
|
49
|
-
json_str = json_str.replace("~", str(Path.home())).replace("$HOME", str(Path.home()))
|
|
50
|
-
json_str = json_str.replace("""Command": "f """, """Command": "~/.config/machineconfig/scripts/wrap_mcfg fire """)
|
|
51
|
-
json_str = json_str.replace("""Command": "s """, """Command": "~/.config/machineconfig/scripts/wrap_mcfg sessions """)
|
|
52
|
-
|
|
53
|
-
layout_file: LayoutsFile = json.loads(json_str)
|
|
54
|
-
if len(layout_file["layouts"]) == 0:
|
|
55
|
-
raise ValueError(f"No layouts found in {layouts_json_file}")
|
|
56
|
-
if selected_layouts_names is None: # choose all, or interactively
|
|
57
|
-
if not select_interactively:
|
|
58
|
-
return layout_file["layouts"]
|
|
59
|
-
options = [layout["layoutName"] for layout in layout_file["layouts"]]
|
|
60
|
-
from machineconfig.utils.options import choose_from_options
|
|
61
|
-
selected_layouts_names = choose_from_options(multi=True, options=options, prompt="Choose a layout configuration:", tv=True, msg="Choose one option")
|
|
62
|
-
print(f"Selected layout(s): {selected_layouts_names}")
|
|
63
|
-
# Extract the configs from the names:
|
|
64
|
-
layouts_chosen: list[LayoutConfig] = []
|
|
65
|
-
for name in selected_layouts_names:
|
|
66
|
-
layout_chosen = next((layout for layout in layout_file["layouts"] if layout["layoutName"] == name), None)
|
|
67
|
-
if layout_chosen is None:
|
|
68
|
-
layout_chosen = next((layout for layout in layout_file["layouts"] if layout["layoutName"].lower() == name.lower()), None)
|
|
69
|
-
if layout_chosen is None:
|
|
70
|
-
available_layouts = [layout["layoutName"] for layout in layout_file["layouts"]]
|
|
71
|
-
raise ValueError(f"Layout '{name}' not found. Available layouts: {available_layouts}")
|
|
72
|
-
layouts_chosen.append(layout_chosen)
|
|
73
|
-
return layouts_chosen
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
def find_layout_file(layout_path: str, ) -> str:
|
|
77
|
-
from machineconfig.utils.path_helper import search_for_files_of_interest
|
|
78
|
-
from machineconfig.utils.options import choose_from_options
|
|
79
|
-
from machineconfig.utils.path_helper import match_file_name, sanitize_path
|
|
15
|
+
from machineconfig.scripts.python.helpers.helpers_sessions.utils import balance_load as impl
|
|
16
|
+
impl(layout_path=layout_path, max_thresh=max_thresh, thresh_type=thresh_type, breaking_method=breaking_method, output_path=output_path)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def run(
|
|
20
|
+
ctx: typer.Context,
|
|
21
|
+
layouts_file: Annotated[Optional[str], typer.Option(..., "--layouts-file", "-f", help="Path to the layout.json file")] = None,
|
|
22
|
+
choose: Annotated[Optional[str], typer.Option(..., "--choose", "-c", help="Comma separated names of layouts to be selected from the layout file passed")] = None,
|
|
23
|
+
choose_interactively: Annotated[bool, typer.Option(..., "--choose-interactively", "-i", help="Select layouts interactively")] = False,
|
|
24
|
+
|
|
25
|
+
sleep_inbetween: Annotated[float, typer.Option(..., "--sleep-inbetween", "-si", help="Sleep time in seconds between launching layouts")] = 1.0,
|
|
26
|
+
monitor: Annotated[bool, typer.Option(..., "--monitor", "-m", help="Monitor the layout sessions for completion")] = False,
|
|
27
|
+
sequential: Annotated[bool, typer.Option(..., "--sequential", "-s", help="Launch layouts sequentially")] = False,
|
|
28
|
+
kill_upon_completion: Annotated[bool, typer.Option(..., "--kill-upon-completion", "-k", help="Kill session(s) upon completion (only relevant if monitor flag is set)")] = False,
|
|
29
|
+
subsitute_home: Annotated[bool, typer.Option(..., "--substitute-home", "-sh", help="Substitute ~ and $HOME in layout file with actual home directory path")] = False,
|
|
30
|
+
max_tabs: Annotated[int, typer.Option(..., "--max-tabs", "-mt", help="A Sanity checker that throws an error if any layout exceeds the maximum number of tabs to launch.")] = 25,
|
|
31
|
+
max_layouts: Annotated[int, typer.Option(..., "--max-layouts", "-ml", help="A Sanity checker that throws an error if the total number of *parallel layouts exceeds this number.")] = 25,
|
|
32
|
+
backend: Annotated[Literal["zellij", "z", "windows-terminal", "wt", "auto", "a"], typer.Option(..., "--backend", "-b", help="Backend terminal multiplexer or emulator to use")] = "auto",
|
|
33
|
+
) -> None:
|
|
34
|
+
"""Launch terminal sessions based on a layout configuration file."""
|
|
35
|
+
from machineconfig.scripts.python.helpers.helpers_sessions.sessions_impl import run_layouts, find_layout_file, select_layout
|
|
36
|
+
|
|
80
37
|
from pathlib import Path
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
choice_file = match_file_name(sub_string=layout_path, search_root=Path.cwd(), suffixes={".json"})
|
|
84
|
-
elif path_obj.is_dir():
|
|
85
|
-
print(f"🔍 Searching recursively for Python, PowerShell and Shell scripts in directory `{path_obj}`")
|
|
86
|
-
files = search_for_files_of_interest(path_obj, suffixes={".py", ".sh", ".ps1"})
|
|
87
|
-
print(f"🔍 Got #{len(files)} results.")
|
|
88
|
-
choice_file = choose_from_options(multi=False, options=files, tv=True, msg="Choose one option")
|
|
89
|
-
choice_file = Path(choice_file).expanduser().absolute()
|
|
38
|
+
if layouts_file is not None:
|
|
39
|
+
layouts_file_resolved = Path(find_layout_file(layout_path=layouts_file))
|
|
90
40
|
else:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
def run(ctx: typer.Context,
|
|
96
|
-
layout_path: Annotated[Optional[str], typer.Argument(..., help="Path to the layout.json file")] = None,
|
|
97
|
-
max_tabs: Annotated[int, typer.Option(..., "--max-tabs", "-mt", help="A Sanity checker that throws an error if any layout exceeds the maximum number of tabs to launch.")] = 10,
|
|
98
|
-
max_layouts: Annotated[int, typer.Option(..., "--max-layouts", "-ml", help="A Sanity checker that throws an error if the total number of *parallel layouts exceeds this number.")] = 10,
|
|
99
|
-
sleep_inbetween: Annotated[float, typer.Option(..., "--sleep-inbetween", "-si", help="Sleep time in seconds between launching layouts")] = 1.0,
|
|
100
|
-
monitor: Annotated[bool, typer.Option(..., "--monitor", "-m", help="Monitor the layout sessions for completion")] = False,
|
|
101
|
-
parallel: Annotated[bool, typer.Option(..., "--parallel", "-p", help="Launch multiple layouts in parallel")] = False,
|
|
102
|
-
kill_upon_completion: Annotated[bool, typer.Option(..., "--kill-upon-completion", "-k", help="Kill session(s) upon completion (only relevant if monitor flag is set)")] = False,
|
|
103
|
-
choose: Annotated[Optional[str], typer.Option(..., "--choose", "-c", help="Comma separated names of layouts to be selected from the layout file passed")] = None,
|
|
104
|
-
choose_interactively: Annotated[bool, typer.Option(..., "--choose-interactively", "-i", help="Select layouts interactively")] = False,
|
|
105
|
-
subsitute_home: Annotated[bool, typer.Option(..., "--substitute-home", "-sh", help="Substitute ~ and $HOME in layout file with actual home directory path")] = False,
|
|
106
|
-
):
|
|
107
|
-
"""
|
|
108
|
-
Launch terminal sessions based on a layout configuration file.
|
|
109
|
-
"""
|
|
110
|
-
if layout_path is None:
|
|
41
|
+
layouts_file_resolved = Path.home().joinpath("dotfiles/machineconfig/layouts.json")
|
|
42
|
+
if not layouts_file_resolved.exists():
|
|
111
43
|
typer.echo(ctx.get_help())
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
44
|
+
typer.echo(f"❌ Layouts file not found: {layouts_file_resolved}", err=True)
|
|
45
|
+
raise typer.Exit(code=1)
|
|
46
|
+
|
|
47
|
+
if choose is None: layouts_names_resolved: list[str] = []
|
|
48
|
+
else: layouts_names_resolved = [name.strip() for name in choose.split(",") if name.strip()]
|
|
49
|
+
layouts_selected = select_layout(layouts_json_file=str(layouts_file_resolved), selected_layouts_names=layouts_names_resolved,
|
|
50
|
+
select_interactively=choose_interactively,)
|
|
51
|
+
if subsitute_home:
|
|
52
|
+
from machineconfig.utils.schemas.layouts.layout_types import substitute_home, LayoutConfig
|
|
53
|
+
layouts_modified: list["LayoutConfig"] = []
|
|
54
|
+
for a_layout in layouts_selected:
|
|
55
|
+
a_layout["layoutTabs"] = substitute_home(tabs=a_layout["layoutTabs"])
|
|
56
|
+
layouts_modified.append(a_layout)
|
|
57
|
+
layouts_selected = layouts_modified
|
|
115
58
|
|
|
116
|
-
|
|
117
|
-
|
|
59
|
+
import platform
|
|
60
|
+
backend_resolved: Literal["zellij", "windows-terminal"]
|
|
61
|
+
match backend:
|
|
62
|
+
case "windows-terminal" | "wt":
|
|
63
|
+
if platform.system().lower() != "windows":
|
|
64
|
+
typer.echo("Error: Windows Terminal layouts can only be started on Windows systems.", err=True)
|
|
65
|
+
raise typer.Exit(code=1)
|
|
66
|
+
backend_resolved = "windows-terminal"
|
|
67
|
+
case "zellij" | "z":
|
|
68
|
+
if platform.system().lower() == "windows":
|
|
69
|
+
typer.echo("Error: Zellij is not supported on Windows.", err=True)
|
|
70
|
+
raise typer.Exit(code=1)
|
|
71
|
+
backend_resolved = "zellij"
|
|
72
|
+
case "auto" | "a":
|
|
73
|
+
if platform.system().lower() == "windows":
|
|
74
|
+
backend_resolved = "windows-terminal"
|
|
75
|
+
else:
|
|
76
|
+
backend_resolved = "zellij"
|
|
77
|
+
case _:
|
|
78
|
+
typer.echo(f"Error: Unsupported backend '{backend}'.", err=True)
|
|
79
|
+
raise typer.Exit(code=1)
|
|
80
|
+
|
|
81
|
+
if not sequential and len(layouts_selected) > max_layouts:
|
|
118
82
|
raise ValueError(f"Number of layouts {len(layouts_selected)} exceeds the maximum allowed {max_layouts}. Please adjust your layout file.")
|
|
119
83
|
for a_layout in layouts_selected:
|
|
120
84
|
if len(a_layout["layoutTabs"]) > max_tabs:
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
85
|
+
raise ValueError(f"Layout '{a_layout.get('layoutName', 'Unnamed')}' has {len(a_layout['layoutTabs'])} tabs which exceeds the max of {max_tabs}.")
|
|
86
|
+
|
|
87
|
+
try:
|
|
88
|
+
run_layouts(
|
|
89
|
+
sleep_inbetween=sleep_inbetween, monitor=monitor, sequential=sequential, kill_upon_completion=kill_upon_completion,
|
|
90
|
+
layouts_selected=layouts_selected,
|
|
91
|
+
backend=backend_resolved)
|
|
92
|
+
except ValueError as e:
|
|
93
|
+
typer.echo(str(e))
|
|
94
|
+
raise typer.Exit(1) from e
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def attach_to_session(
|
|
98
|
+
name: Annotated[str | None, typer.Argument(help="Name of the Zellij session to attach to. If not provided, a list will be shown to choose from.")] = None,
|
|
99
|
+
new_session: Annotated[bool, typer.Option("--new-session", "-n", help="Create a new Zellij session instead of attaching to an existing one.", show_default=True)] = False,
|
|
100
|
+
kill_all: Annotated[bool, typer.Option("--kill-all", "-k", help="Kill all existing Zellij sessions before creating a new one.", show_default=True)] = False) -> None:
|
|
101
|
+
"""Choose a Zellij session to attach to."""
|
|
127
102
|
import platform
|
|
128
|
-
if platform.system()
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
print(f"❌ Unsupported platform: {platform.system()}")
|
|
103
|
+
if platform.system().lower() == "windows":
|
|
104
|
+
typer.echo("Error: Zellij is not supported on Windows.", err=True, color=True)
|
|
105
|
+
raise typer.Exit()
|
|
106
|
+
from machineconfig.scripts.python.helpers.helpers_sessions.attach_impl import choose_zellij_session as impl
|
|
107
|
+
action, payload = impl(name=name, new_session=new_session, kill_all=kill_all)
|
|
108
|
+
if action == "error":
|
|
109
|
+
typer.echo(payload, err=True, color=True)
|
|
110
|
+
raise typer.Exit()
|
|
111
|
+
if action == "run_script" and payload:
|
|
112
|
+
from machineconfig.utils.code import exit_then_run_shell_script
|
|
113
|
+
exit_then_run_shell_script(script= payload, strict=True)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def get_session_tabs() -> list[tuple[str, str]]:
|
|
118
|
+
"""Get all Zellij session tabs."""
|
|
119
|
+
from machineconfig.scripts.python.helpers.helpers_sessions.attach_impl import get_session_tabs as impl
|
|
120
|
+
result = impl()
|
|
121
|
+
print(result)
|
|
122
|
+
return result
|
|
123
|
+
def create_template(
|
|
124
|
+
name: Annotated[Optional[str], typer.Argument(..., help="Name of the layout template to create")] = None,
|
|
125
|
+
num_tabs: Annotated[int, typer.Option(..., "--num-tabs", "-t", help="Number of tabs to include in the template")] = 3,
|
|
126
|
+
) -> None:
|
|
127
|
+
"""Create a layout template file."""
|
|
128
|
+
from machineconfig.scripts.python.helpers.helpers_sessions.utils import create_template as impl
|
|
129
|
+
impl(name=name, num_tabs=num_tabs)
|
|
156
130
|
|
|
131
|
+
def create_from_function(
|
|
132
|
+
num_process: Annotated[int, typer.Option(..., "--num-process", "-n", help="Number of parallel processes to run")],
|
|
133
|
+
path: Annotated[str, typer.Option(..., "--path", "-p", help="Path to a Python or Shell script file or a directory containing such files")] = ".",
|
|
134
|
+
function: Annotated[Optional[str], typer.Option(..., "--function", "-f", help="Function to run from the Python file. If not provided, you will be prompted to choose.")] = None,
|
|
135
|
+
) -> None:
|
|
136
|
+
"""Create a layout from a function to run in multiple processes."""
|
|
137
|
+
from machineconfig.scripts.python.helpers.helpers_sessions.sessions_multiprocess import create_from_function as impl
|
|
138
|
+
impl(num_process=num_process, path=path, function=function)
|
|
157
139
|
|
|
158
|
-
def create_template(name: Annotated[Optional[str], typer.Argument(..., help="Name of the layout template to create")] = None,
|
|
159
|
-
num_tabs: Annotated[int, typer.Option(..., "--num-tabs", "-t", help="Number of tabs to include in the template")] = 3,
|
|
160
|
-
):
|
|
161
|
-
"""Create a layout template file."""
|
|
162
|
-
from machineconfig.utils.schemas.layouts.layout_types import LayoutsFile, TabConfig
|
|
163
|
-
from pathlib import Path
|
|
164
|
-
tabs: list[TabConfig] = []
|
|
165
|
-
for i in range(1, num_tabs + 1):
|
|
166
|
-
tab: TabConfig = {
|
|
167
|
-
"tabName": f"Tab{i}",
|
|
168
|
-
"startDir": "~/" + str(Path.cwd().relative_to(Path.home())),
|
|
169
|
-
"command": "bash",
|
|
170
|
-
}
|
|
171
|
-
tabs.append(tab)
|
|
172
|
-
layouts: list[LayoutConfig] = [
|
|
173
|
-
{
|
|
174
|
-
"layoutName": f"{Path.cwd().name}Layout",
|
|
175
|
-
"layoutTabs": tabs,
|
|
176
|
-
}
|
|
177
|
-
]
|
|
178
|
-
file: LayoutsFile = {
|
|
179
|
-
"$schema": "https://bit.ly/cfglayout", # type: ignore
|
|
180
|
-
"version": "0.1",
|
|
181
|
-
"layouts": layouts
|
|
182
|
-
}
|
|
183
|
-
import json
|
|
184
|
-
json_string = json.dumps(file, indent=4)
|
|
185
|
-
if name is None:
|
|
186
|
-
layout_path = Path.cwd() / "layout.json"
|
|
187
|
-
else:
|
|
188
|
-
layout_path = Path.cwd() / (name.replace(".json", "") + ".json")
|
|
189
|
-
layout_path.parent.mkdir(parents=True, exist_ok=True)
|
|
190
|
-
if layout_path.exists():
|
|
191
|
-
print(f"❌ File {layout_path} already exists. Aborting to avoid overwriting.")
|
|
192
|
-
return
|
|
193
|
-
layout_path.write_text(json_string, encoding="utf-8")
|
|
194
|
-
print(f"✅ Created layout template at {layout_path}")
|
|
195
140
|
|
|
141
|
+
def get_app() -> typer.Typer:
|
|
142
|
+
layouts_app = typer.Typer(help="Layouts management subcommands", no_args_is_help=True, add_help_option=True, add_completion=False)
|
|
196
143
|
|
|
197
|
-
|
|
198
|
-
layouts_app
|
|
199
|
-
from machineconfig.scripts.python.helpers_sessions.sessions_multiprocess import create_from_function
|
|
144
|
+
layouts_app.command("run", no_args_is_help=True, help=run.__doc__, short_help="[r] Run the selected layout(s)")(run)
|
|
145
|
+
layouts_app.command("r", no_args_is_help=True, help=run.__doc__, hidden=True)(run)
|
|
200
146
|
|
|
201
|
-
layouts_app.command("
|
|
202
|
-
layouts_app.command("
|
|
147
|
+
layouts_app.command("attach", no_args_is_help=False, help=attach_to_session.__doc__, short_help="[a] Attach to a Zellij session")(attach_to_session)
|
|
148
|
+
layouts_app.command("a", no_args_is_help=False, help=attach_to_session.__doc__, hidden=True)(attach_to_session)
|
|
203
149
|
|
|
204
|
-
layouts_app.command("
|
|
205
|
-
layouts_app.command("
|
|
150
|
+
layouts_app.command("create-from-function", no_args_is_help=True, short_help="[c] Create a layout from a function")(create_from_function)
|
|
151
|
+
layouts_app.command("c", no_args_is_help=True, hidden=True)(create_from_function)
|
|
206
152
|
|
|
207
|
-
layouts_app.command("balance-load", no_args_is_help=True, help="[b] Balance the load across sessions")(balance_load)
|
|
208
|
-
layouts_app.command("b", no_args_is_help=True, help=
|
|
153
|
+
layouts_app.command("balance-load", no_args_is_help=True, help=balance_load.__doc__, short_help="[b] Balance the load across sessions")(balance_load)
|
|
154
|
+
layouts_app.command("b", no_args_is_help=True, help=balance_load.__doc__, hidden=True)(balance_load)
|
|
209
155
|
|
|
210
|
-
layouts_app.command("create-template", no_args_is_help=False, help="[t] Create a layout template file")(create_template)
|
|
211
|
-
layouts_app.command("t", no_args_is_help=False, help=
|
|
156
|
+
layouts_app.command("create-template", no_args_is_help=False, help=create_template.__doc__, short_help="[t] Create a layout template file")(create_template)
|
|
157
|
+
layouts_app.command("t", no_args_is_help=False, help=create_template.__doc__, hidden=True)(create_template)
|
|
212
158
|
return layouts_app
|
|
213
159
|
|
|
214
160
|
|
|
215
|
-
def main():
|
|
161
|
+
def main() -> None:
|
|
216
162
|
layouts_app = get_app()
|
|
217
163
|
layouts_app()
|
|
218
164
|
|
|
219
165
|
|
|
220
166
|
if __name__ == "__main__":
|
|
221
|
-
|
|
167
|
+
pass
|
|
@@ -1,38 +1,120 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
from machineconfig.scripts.python.helpers_utils.download import download
|
|
1
|
+
"""Utility commands - lazy loading subcommands."""
|
|
2
|
+
|
|
4
3
|
import typer
|
|
5
|
-
from typing import Annotated
|
|
4
|
+
from typing import Annotated, Optional, Literal
|
|
6
5
|
|
|
7
6
|
|
|
8
|
-
def kill_process(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
interactive: Annotated[bool, typer.Option(..., "--interactive", "-i", help="Interactively choose the process to kill")] = True):
|
|
12
|
-
from machineconfig.utils.procs import main, ProcessManager
|
|
7
|
+
def kill_process(interactive: Annotated[bool, typer.Option(..., "--interactive", "-i", help="Interactively choose the process to kill")] = True) -> None:
|
|
8
|
+
"""⚔️ Choose a process to kill."""
|
|
9
|
+
from machineconfig.utils.procs import ProcessManager
|
|
13
10
|
if interactive:
|
|
14
|
-
|
|
11
|
+
proc = ProcessManager()
|
|
12
|
+
proc.choose_and_kill()
|
|
15
13
|
return
|
|
16
14
|
_ = ProcessManager
|
|
17
|
-
# pm = ProcessManager()
|
|
18
|
-
# if command:
|
|
19
|
-
# pm.filter_and_kill(name=command
|
|
20
|
-
# )
|
|
21
15
|
|
|
22
16
|
|
|
23
|
-
def upgrade_packages():
|
|
17
|
+
def upgrade_packages(root: Annotated[str, typer.Argument(help="Root directory of the project")] = ".") -> None:
|
|
18
|
+
"""⬆️ Upgrade project dependencies."""
|
|
24
19
|
from machineconfig.utils.upgrade_packages import generate_uv_add_commands
|
|
25
20
|
from pathlib import Path
|
|
26
|
-
|
|
21
|
+
root_resolved = Path(root).expanduser().absolute().resolve()
|
|
22
|
+
generate_uv_add_commands(pyproject_path=root_resolved / "pyproject.toml", output_path=root_resolved / "pyproject_init.sh")
|
|
23
|
+
def tui_env(which: Annotated[Literal["PATH", "p", "ENV", "e"], typer.Argument(help="Which environment variable to display.")] = "ENV") -> None:
|
|
24
|
+
"""📚 NAVIGATE ENV/PATH variable with TUI."""
|
|
25
|
+
from machineconfig.scripts.python.helpers.helpers_utils.python import tui_env as impl
|
|
26
|
+
impl(which=which)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def download(
|
|
30
|
+
url: Annotated[Optional[str], typer.Argument(..., help="The URL to download the file from.")] = None,
|
|
31
|
+
decompress: Annotated[bool, typer.Option(..., "--decompress", "-d", help="Decompress the file if it's an archive.")] = False,
|
|
32
|
+
output: Annotated[Optional[str], typer.Option("--output", "-o", help="The output file path.")] = None,
|
|
33
|
+
output_dir: Annotated[Optional[str], typer.Option("--output-dir", help="Directory to place the downloaded file in.")] = None,
|
|
34
|
+
) -> None:
|
|
35
|
+
"""⬇️ Download a file from a URL and optionally decompress it."""
|
|
36
|
+
from machineconfig.scripts.python.helpers.helpers_utils.download import download as impl
|
|
37
|
+
impl(url=url, decompress=decompress, output=output, output_dir=output_dir)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def get_machine_specs(hardware: Annotated[bool, typer.Option(..., "--hardware", "-h", help="Show compute capability")] = False) -> None:
|
|
41
|
+
"""💻 Get machine specifications."""
|
|
42
|
+
from machineconfig.scripts.python.helpers.helpers_utils.python import get_machine_specs as impl
|
|
43
|
+
impl(hardware=hardware)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def type_hint(path: Annotated[str, typer.Argument(..., help="Path to file/project dir to type hint.")] = ".",
|
|
47
|
+
dependency: Annotated[Literal["self-contained", "import"], typer.Option(..., "--dependency", "-d", help="Generated file is self contained or performs imports")] = "self-contained"
|
|
48
|
+
) -> None:
|
|
49
|
+
from machineconfig.type_hinting.typedict.generators import generate_names_file
|
|
50
|
+
from pathlib import Path
|
|
51
|
+
path_resolved = Path(path).resolve()
|
|
52
|
+
if not path_resolved.exists():
|
|
53
|
+
typer.echo(f"Error: The provided path '{path}' does not exist.", err=True)
|
|
54
|
+
raise typer.Exit(code=1)
|
|
55
|
+
if path_resolved.is_file():
|
|
56
|
+
modules = [path_resolved]
|
|
57
|
+
else:
|
|
58
|
+
if not (path_resolved / "pyproject.toml").exists():
|
|
59
|
+
typer.echo("Error: Provided directory path is not a project root (missing pyproject.toml).", err=True)
|
|
60
|
+
raise typer.Exit(code=1)
|
|
61
|
+
else:
|
|
62
|
+
modules = [file for file in path_resolved.rglob("dtypes.py") if ".venv" not in str(file)]
|
|
63
|
+
for input_file in modules:
|
|
64
|
+
print(f"Worked on: {input_file}")
|
|
65
|
+
output_file = input_file.parent.joinpath(f"{input_file.stem}_names.py")
|
|
66
|
+
generated_file = generate_names_file(input_file, output_file, search_paths=None, dependency=dependency)
|
|
67
|
+
print(f"Generated: {generated_file}")
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def init_project(
|
|
71
|
+
name: Annotated[Optional[str], typer.Option("--name", "-n", help="Name of the project.")] = None,
|
|
72
|
+
tmp_dir: Annotated[bool, typer.Option("--tmp-dir", "-t", help="Use a temporary directory for the project initialization.")] = False,
|
|
73
|
+
python: Annotated[Literal["3.11", "3.12", "3.13", "3.14"], typer.Option("--python", "-p", help="Python sub version for the uv virtual environment.")] = "3.13",
|
|
74
|
+
libraries: Annotated[Optional[str], typer.Option("--libraries", "-l", help="Additional packages to include in the uv virtual environment (space separated).")] = None,
|
|
75
|
+
group: Annotated[Optional[str], typer.Option("--group", "-g", help="group of packages names (no separation) p:plot, t:types, l:linting, i:interactive, d:data")] = "p,t,l,i,d",
|
|
76
|
+
) -> None:
|
|
77
|
+
"""🚀 Initialize a project with a uv virtual environment and install dev packages."""
|
|
78
|
+
from machineconfig.scripts.python.helpers.helpers_utils.python import init_project as impl
|
|
79
|
+
impl(name=name, tmp_dir=tmp_dir, python=python, libraries=libraries, group=group)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def edit_file_with_hx(path: Annotated[Optional[str], typer.Argument(..., help="The root directory of the project to edit, or a file path.")] = None) -> None:
|
|
83
|
+
"""✏️ Open a file in the default editor."""
|
|
84
|
+
from machineconfig.scripts.python.helpers.helpers_utils.python import edit_file_with_hx as impl
|
|
85
|
+
impl(path=path)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def merge_pdfs(
|
|
89
|
+
pdfs: Annotated[list[str], typer.Argument(..., help="Paths to the PDF files to merge.")],
|
|
90
|
+
output: Annotated[Optional[str], typer.Option("--output", "-o", help="Output merged PDF file path.")] = None,
|
|
91
|
+
compress: Annotated[bool, typer.Option("--compress", "-c", help="Compress the output PDF.")] = False,
|
|
92
|
+
) -> None:
|
|
93
|
+
"""📄 Merge two PDF files into one."""
|
|
94
|
+
from machineconfig.scripts.python.helpers.helpers_utils.pdf import merge_pdfs as impl
|
|
95
|
+
impl(pdfs=pdfs, output=output, compress=compress)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def compress_pdf(
|
|
99
|
+
pdf_input: Annotated[str, typer.Argument(..., help="Path to the input PDF file to compress.")],
|
|
100
|
+
output: Annotated[Optional[str], typer.Option("--output", "-o", help="Output compressed PDF file path.")] = None,
|
|
101
|
+
quality: Annotated[int, typer.Option("--quality", "-q", help="JPEG quality for image compression (0-100, 0=no change, 100=best).")] = 85,
|
|
102
|
+
image_dpi: Annotated[int, typer.Option("--image-dpi", "-d", help="Target DPI for image resampling.")] = 0,
|
|
103
|
+
compress_streams: Annotated[bool, typer.Option("--compress-streams", "-c", help="Compress uncompressed streams.")] = True,
|
|
104
|
+
use_objstms: Annotated[bool, typer.Option("--object-streams", "-s", help="Use object streams for additional compression.")] = True,
|
|
105
|
+
) -> None:
|
|
106
|
+
"""📦 Compress a PDF file."""
|
|
107
|
+
from machineconfig.scripts.python.helpers.helpers_utils.pdf import compress_pdf as impl
|
|
108
|
+
impl(pdf_input=pdf_input, output=output, quality=quality, image_dpi=image_dpi, compress_streams=compress_streams, use_objstms=use_objstms)
|
|
27
109
|
|
|
28
110
|
|
|
29
111
|
def get_app() -> typer.Typer:
|
|
30
|
-
app = typer.Typer(help="🛠️ utilities operations", no_args_is_help=True, add_help_option=
|
|
112
|
+
app = typer.Typer(help="🛠️ utilities operations", no_args_is_help=True, add_help_option=True, add_completion=False)
|
|
31
113
|
app.command(name="kill-process", no_args_is_help=False, help="⚔️ [k] Choose a process to kill")(kill_process)
|
|
32
|
-
app.command(name="k", no_args_is_help=False,
|
|
114
|
+
app.command(name="k", no_args_is_help=False, hidden=True)(kill_process)
|
|
33
115
|
|
|
34
116
|
app.command("environment", no_args_is_help=False, help="📚 [v] NAVIGATE ENV/PATH variable with TUI")(tui_env)
|
|
35
|
-
app.command("v", no_args_is_help=False,
|
|
117
|
+
app.command("v", no_args_is_help=False, hidden=True)(tui_env)
|
|
36
118
|
|
|
37
119
|
app.command(name="upgrade-packages", no_args_is_help=False, help="⬆️ [up] Upgrade project dependencies.")(upgrade_packages)
|
|
38
120
|
app.command(name="up", no_args_is_help=False, hidden=True)(upgrade_packages)
|
|
@@ -51,14 +133,12 @@ def get_app() -> typer.Typer:
|
|
|
51
133
|
app.command(name="pdf-compress", no_args_is_help=True, help="📦 [pc] Compress a PDF file.")(compress_pdf)
|
|
52
134
|
app.command(name="pc", no_args_is_help=True, hidden=True)(compress_pdf)
|
|
53
135
|
|
|
54
|
-
|
|
55
|
-
|
|
136
|
+
app.command(name="type-hint", no_args_is_help=True, help="📝 [t] Type hint a file or project directory.")(type_hint)
|
|
137
|
+
app.command(name="t", no_args_is_help=True, hidden=True)(type_hint)
|
|
56
138
|
|
|
57
139
|
return app
|
|
58
140
|
|
|
59
|
-
# def func():
|
|
60
|
-
# import pycr
|
|
61
141
|
|
|
62
142
|
def main():
|
|
63
143
|
app = get_app()
|
|
64
|
-
app()
|
|
144
|
+
app()
|