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
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
|
|
2
|
+
import platform
|
|
3
|
+
from typing import Annotated
|
|
4
|
+
|
|
5
|
+
import typer
|
|
6
|
+
|
|
7
|
+
from machineconfig.scripts.python.helpers.helpers_devops.mount_helpers.devices import list_devices as list_devices_internal
|
|
8
|
+
from machineconfig.scripts.python.helpers.helpers_devops.mount_helpers.linux import mount_linux, select_linux_partition
|
|
9
|
+
from machineconfig.scripts.python.helpers.helpers_devops.mount_helpers.macos import mount_macos
|
|
10
|
+
from machineconfig.scripts.python.helpers.helpers_devops.mount_helpers.selection import pick_device, resolve_device
|
|
11
|
+
from machineconfig.scripts.python.helpers.helpers_devops.mount_helpers.utils import format_device
|
|
12
|
+
from machineconfig.scripts.python.helpers.helpers_devops.mount_helpers.windows import mount_windows
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def list_devices() -> None:
|
|
16
|
+
entries = list_devices_internal()
|
|
17
|
+
if not entries:
|
|
18
|
+
typer.echo("No devices found")
|
|
19
|
+
return
|
|
20
|
+
for entry in entries:
|
|
21
|
+
typer.echo(format_device(entry))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def mount_device(
|
|
25
|
+
device_query: Annotated[str, typer.Argument(...)],
|
|
26
|
+
mount_point: Annotated[str, typer.Argument(...)],
|
|
27
|
+
) -> None:
|
|
28
|
+
try:
|
|
29
|
+
entries = list_devices_internal()
|
|
30
|
+
if not entries:
|
|
31
|
+
typer.echo("No devices found")
|
|
32
|
+
raise typer.Exit(1)
|
|
33
|
+
entry = resolve_device(entries, device_query)
|
|
34
|
+
platform_name = platform.system()
|
|
35
|
+
if platform_name == "Linux":
|
|
36
|
+
selected = select_linux_partition(entries, entry)
|
|
37
|
+
mount_linux(selected, mount_point)
|
|
38
|
+
elif platform_name == "Darwin":
|
|
39
|
+
mount_macos(entry, mount_point)
|
|
40
|
+
elif platform_name == "Windows":
|
|
41
|
+
mount_windows(entry, mount_point)
|
|
42
|
+
else:
|
|
43
|
+
typer.echo(f"Unsupported platform: {platform_name}")
|
|
44
|
+
raise typer.Exit(1)
|
|
45
|
+
typer.echo("Mount completed")
|
|
46
|
+
except RuntimeError as exc:
|
|
47
|
+
typer.echo(f"Mount failed: {exc}")
|
|
48
|
+
raise typer.Exit(1)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def mount_interactive() -> None:
|
|
52
|
+
try:
|
|
53
|
+
entries = list_devices_internal()
|
|
54
|
+
if not entries:
|
|
55
|
+
typer.echo("No devices found")
|
|
56
|
+
raise typer.Exit(1)
|
|
57
|
+
entry = pick_device(entries, header="Available devices")
|
|
58
|
+
platform_name = platform.system()
|
|
59
|
+
if platform_name == "Darwin":
|
|
60
|
+
mount_point = typer.prompt("Mount point (use '-' for default)")
|
|
61
|
+
else:
|
|
62
|
+
mount_point = typer.prompt("Mount point")
|
|
63
|
+
if platform_name == "Linux":
|
|
64
|
+
selected = select_linux_partition(entries, entry)
|
|
65
|
+
mount_linux(selected, mount_point)
|
|
66
|
+
elif platform_name == "Darwin":
|
|
67
|
+
mount_macos(entry, mount_point)
|
|
68
|
+
elif platform_name == "Windows":
|
|
69
|
+
mount_windows(entry, mount_point)
|
|
70
|
+
else:
|
|
71
|
+
typer.echo(f"Unsupported platform: {platform_name}")
|
|
72
|
+
raise typer.Exit(1)
|
|
73
|
+
typer.echo("Mount completed")
|
|
74
|
+
except RuntimeError as exc:
|
|
75
|
+
typer.echo(f"Mount failed: {exc}")
|
|
76
|
+
raise typer.Exit(1)
|
|
77
|
+
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
|
|
2
|
+
import typer
|
|
3
|
+
from typing import Annotated, Optional, Literal
|
|
4
|
+
from machineconfig.profile.create_links_export import REPO_LOOSE
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def sync(
|
|
8
|
+
direction: Annotated[Literal["up", "u", "down", "d"], typer.Argument(..., help="Direction of sync: backup or retrieve")],
|
|
9
|
+
cloud: Annotated[Optional[str], typer.Option("--cloud", "-c", help="☁️ Cloud configuration name (rclone config name)")] = None,
|
|
10
|
+
which: Annotated[
|
|
11
|
+
Optional[str], typer.Option("--which", "-w", help="📝 Comma-separated list of items to BACKUP (from backup.toml), or 'all' for all items")
|
|
12
|
+
] = None,
|
|
13
|
+
repo: Annotated[REPO_LOOSE, typer.Option("--repo", "-r", help="📁 Which backup configuration to use: 'library' or 'user'")] = "all",
|
|
14
|
+
# interactive: Annotated[bool, typer.Option("--interactive", "-i", help="🤔 Prompt the selection of which items to process")] = False,
|
|
15
|
+
):
|
|
16
|
+
from machineconfig.scripts.python.helpers.helpers_devops.cli_backup_retrieve import main_backup_retrieve
|
|
17
|
+
match direction:
|
|
18
|
+
case "up" | "u":
|
|
19
|
+
direction_resolved = "BACKUP"
|
|
20
|
+
case "down" | "d":
|
|
21
|
+
direction_resolved = "RETRIEVE"
|
|
22
|
+
case _:
|
|
23
|
+
typer.echo("Error: Invalid direction. Use 'up' or 'down'.")
|
|
24
|
+
raise typer.Exit(code=1)
|
|
25
|
+
main_backup_retrieve(direction=direction_resolved, which=which, cloud=cloud, repo=repo)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def register_data(
|
|
29
|
+
path_local: Annotated[str, typer.Argument(..., help="Local file/folder path to back up.")],
|
|
30
|
+
group: Annotated[str, typer.Option("--group", "-g", help="Group section name in backup.toml.")] = "default",
|
|
31
|
+
name: Annotated[Optional[str], typer.Option("--name", "-n", help="Entry name inside the group in backup.toml.")] = None,
|
|
32
|
+
path_cloud: Annotated[Optional[str], typer.Option("--path-cloud", "-C", help="Cloud path override (optional).")] = None,
|
|
33
|
+
zip_: Annotated[bool, typer.Option("--zip/--no-zip", "-z/-nz", help="Zip before uploading.")] = False,
|
|
34
|
+
encrypt: Annotated[bool, typer.Option("--encrypt/--no-encrypt", "-e/-ne", help="Encrypt before uploading.")] = False,
|
|
35
|
+
rel2home: Annotated[Optional[bool], typer.Option("--rel2home/--no-rel2home", "-r/-nr", help="Treat the local path as relative to home.")] = None,
|
|
36
|
+
os: Annotated[str, typer.Option("--os", "-o", help="OS filter for this backup entry (comma-separated, or 'any').")] = "any",
|
|
37
|
+
) -> None:
|
|
38
|
+
from machineconfig.scripts.python.helpers.helpers_devops.cli_backup_retrieve import register_backup_entry
|
|
39
|
+
|
|
40
|
+
try:
|
|
41
|
+
backup_path, entry_name, replaced = register_backup_entry(
|
|
42
|
+
path_local=path_local, group=group, entry_name=name, path_cloud=path_cloud, zip=zip_, encrypt=encrypt, rel2home=rel2home, os=os
|
|
43
|
+
)
|
|
44
|
+
except ValueError as exc:
|
|
45
|
+
msg = typer.style("Error: ", fg=typer.colors.RED) + str(exc)
|
|
46
|
+
typer.echo(msg)
|
|
47
|
+
raise typer.Exit(code=1)
|
|
48
|
+
action = "Updated" if replaced else "Added"
|
|
49
|
+
typer.echo(f"{action} backup entry '{entry_name}' in {backup_path}")
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def get_app() -> typer.Typer:
|
|
53
|
+
app = typer.Typer(
|
|
54
|
+
name="data",
|
|
55
|
+
help="🗄️ [d] Backup and retrieve configuration files and directories to/from cloud storage using rclone.",
|
|
56
|
+
no_args_is_help=True,
|
|
57
|
+
add_help_option=True,
|
|
58
|
+
add_completion=False,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
app.command(name="sync", no_args_is_help=True, hidden=False, help="🔄 [s] Sync (backup) files and directories to cloud storage using rclone.")(
|
|
62
|
+
sync
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
app.command(name="s", no_args_is_help=True, hidden=True)(sync)
|
|
66
|
+
|
|
67
|
+
app.command(name="register", no_args_is_help=True, hidden=False, help="📝 [r] Register a new backup entry in user backup.toml.")(register_data)
|
|
68
|
+
|
|
69
|
+
app.command(name="r", no_args_is_help=True, hidden=True)(register_data)
|
|
70
|
+
|
|
71
|
+
return app
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
|
|
2
|
+
import machineconfig.scripts.python.helpers.helpers_devops.cli_share_file
|
|
3
|
+
import machineconfig.scripts.python.helpers.helpers_devops.cli_share_terminal as cli_share_terminal
|
|
4
|
+
import machineconfig.scripts.python.helpers.helpers_devops.cli_share_server as cli_share_server
|
|
5
|
+
import machineconfig.scripts.python.helpers.helpers_devops.cli_ssh as cli_ssh
|
|
6
|
+
import machineconfig.scripts.python.helpers.helpers_devops.cli_share_temp as cli_share_temp
|
|
7
|
+
import typer
|
|
8
|
+
from typing import Annotated, Literal
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def switch_public_ip_address(
|
|
12
|
+
wait_seconds: Annotated[float, typer.Option(..., "--wait", "-w", help="Seconds to wait between steps")] = 2.0,
|
|
13
|
+
max_trials: Annotated[int, typer.Option(..., "--max-trials", "-m", help="Max number of switch attempts")] = 10,
|
|
14
|
+
) -> None:
|
|
15
|
+
"""🔁 Switch public IP address (Cloudflare WARP)"""
|
|
16
|
+
import machineconfig.scripts.python.helpers.helpers_network.address_switch as helper
|
|
17
|
+
helper.switch_public_ip_address(max_trials=max_trials, wait_seconds=wait_seconds)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def show_address() -> None:
|
|
21
|
+
"""📌 Show this computer addresses on network"""
|
|
22
|
+
import machineconfig.scripts.python.helpers.helpers_network.address as helper
|
|
23
|
+
|
|
24
|
+
try:
|
|
25
|
+
loaded_json = helper.get_public_ip_address()
|
|
26
|
+
from rich import print_json
|
|
27
|
+
print_json(data=loaded_json)
|
|
28
|
+
except Exception as e:
|
|
29
|
+
print(f"⚠️ Could not fetch public IP address: {e}")
|
|
30
|
+
loaded_json = {}
|
|
31
|
+
|
|
32
|
+
from rich.table import Table
|
|
33
|
+
from rich.console import Console
|
|
34
|
+
res = helper.get_all_ipv4_addresses()
|
|
35
|
+
res.append( ("Public IP", loaded_json.get("ip", "N/A")))
|
|
36
|
+
|
|
37
|
+
# loc = loaded_json["loc"]
|
|
38
|
+
# cmd = f"""curl "https://maps.geoapify.com/v1/staticmap?style=osm-bright&width=600&height=300¢er=lonlat:{loc}&zoom=6&marker=lonlat:{loc};color:%23ff0000;size:medium&apiKey=$GEOAPIFY_API_KEY" -o map.png && chafa map.png"""
|
|
39
|
+
# from machineconfig.utils.code import run_shell_script
|
|
40
|
+
# run_shell_script(script=cmd)
|
|
41
|
+
|
|
42
|
+
table = Table(title="Network Interfaces")
|
|
43
|
+
table.add_column("Interface", style="cyan")
|
|
44
|
+
table.add_column("IP Address", style="green")
|
|
45
|
+
|
|
46
|
+
for iface, ip in res:
|
|
47
|
+
table.add_row(iface, ip)
|
|
48
|
+
|
|
49
|
+
console = Console()
|
|
50
|
+
console.print(table)
|
|
51
|
+
|
|
52
|
+
res = helper.select_lan_ipv4(prefer_vpn=False)
|
|
53
|
+
if res is not None:
|
|
54
|
+
# ip, iface = res
|
|
55
|
+
# print(f"Selected IP: {ip} on interface: {iface}")
|
|
56
|
+
print(f"LAN IPv4: {res}")
|
|
57
|
+
else:
|
|
58
|
+
print("No network interfaces found.")
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def bind_wsl_port(port: Annotated[int, typer.Option(..., "--port", "-p", help="Port number to bind")]):
|
|
63
|
+
code = f"""
|
|
64
|
+
|
|
65
|
+
$wsl_ip = (wsl.exe hostname -I).Trim().Split(' ')[0]
|
|
66
|
+
netsh interface portproxy add v4tov4 listenport={port} listenaddress=0.0.0.0 connectport={port} connectaddress=$wsl_ip
|
|
67
|
+
|
|
68
|
+
"""
|
|
69
|
+
from machineconfig.utils.code import exit_then_run_shell_script
|
|
70
|
+
exit_then_run_shell_script(code)
|
|
71
|
+
def open_wsl_port(ports: Annotated[str, typer.Argument(..., help="Comma-separated ports or port ranges (e.g., '8080,3000-3005,443')")]):
|
|
72
|
+
"""🔥 Open Windows firewall ports for WSL (Windows only)."""
|
|
73
|
+
import machineconfig.utils.ssh_utils.wsl as wsl_utils
|
|
74
|
+
wsl_utils.open_wsl_port(ports)
|
|
75
|
+
def link_wsl_and_windows_home(windows_username: Annotated[str | None, typer.Option("--windows-username", "-u", help="Windows username to use (optional, auto-detected if not provided)")] = None):
|
|
76
|
+
"""🔗 Link WSL home and Windows home directories."""
|
|
77
|
+
import machineconfig.utils.ssh_utils.wsl as wsl_utils
|
|
78
|
+
wsl_utils.link_wsl_and_windows(windows_username)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def wifi_select(
|
|
82
|
+
ssid: Annotated[str, typer.Option("-n", "--ssid", help="🔗 SSID of WiFi (from config)")] = "MyPhoneHotSpot",
|
|
83
|
+
manual: Annotated[bool, typer.Option("-m", "--manual", help="🔍 Manual network selection mode")] = False,
|
|
84
|
+
list_: Annotated[bool, typer.Option("-l", "--list", help="📡 List available networks only")] = False,
|
|
85
|
+
) -> None:
|
|
86
|
+
"""Main function with fallback network selection"""
|
|
87
|
+
from rich.panel import Panel
|
|
88
|
+
from rich.prompt import Confirm
|
|
89
|
+
from rich.console import Console
|
|
90
|
+
from machineconfig.scripts.python.helpers.helpers_network.wifi_conn import try_config_connection, manual_network_selection, display_available_networks
|
|
91
|
+
console = Console()
|
|
92
|
+
console.print(Panel("📶 Welcome to the WiFi Connector Tool", title="[bold blue]WiFi Connection[/bold blue]", border_style="blue"))
|
|
93
|
+
|
|
94
|
+
# If user just wants to list networks
|
|
95
|
+
if list_:
|
|
96
|
+
display_available_networks()
|
|
97
|
+
return
|
|
98
|
+
|
|
99
|
+
# If user wants manual mode, skip config and go straight to selection
|
|
100
|
+
if manual:
|
|
101
|
+
console.print("[blue]🔍 Manual network selection mode[/blue]")
|
|
102
|
+
if manual_network_selection():
|
|
103
|
+
console.print("[green]🎉 Successfully connected![/green]")
|
|
104
|
+
else:
|
|
105
|
+
console.print("[red]❌ Failed to connect[/red]")
|
|
106
|
+
return
|
|
107
|
+
|
|
108
|
+
# Try to connect using configuration first
|
|
109
|
+
console.print(f"[blue]🔍 Attempting to connect to configured network: {ssid}[/blue]")
|
|
110
|
+
|
|
111
|
+
if try_config_connection(ssid):
|
|
112
|
+
console.print("[green]🎉 Successfully connected using configuration![/green]")
|
|
113
|
+
return
|
|
114
|
+
|
|
115
|
+
# Configuration failed, offer fallback options
|
|
116
|
+
console.print("\n[yellow]⚠️ Configuration connection failed or not available[/yellow]")
|
|
117
|
+
|
|
118
|
+
if Confirm.ask("[blue]Would you like to manually select a network?[/blue]", default=True):
|
|
119
|
+
if manual_network_selection():
|
|
120
|
+
console.print("[green]🎉 Successfully connected![/green]")
|
|
121
|
+
else:
|
|
122
|
+
console.print("[red]❌ Failed to connect[/red]")
|
|
123
|
+
else:
|
|
124
|
+
console.print("[blue]👋 Goodbye![/blue]")
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def reset_cloudflare_tunnel(task: Annotated[Literal["oneoff-shell-process", "oneoff-background-process", "as-service"], typer.Option(..., "--task", "-t", help="Task to perform", case_sensitive=False, show_choices=True)],
|
|
129
|
+
tunnel_name: Annotated[str | None, typer.Option("--tunnel-name", "-n", help="Name of the Cloudflare tunnel to run")] = None,
|
|
130
|
+
):
|
|
131
|
+
code = """
|
|
132
|
+
# cloudflared tunnel route dns glenn # creates CNAMES in Cloudflare dashboard
|
|
133
|
+
# sudo systemctl stop cloudflared
|
|
134
|
+
"""
|
|
135
|
+
match task:
|
|
136
|
+
case "oneoff-shell-process":
|
|
137
|
+
if tunnel_name is None: tunnel_name = ""
|
|
138
|
+
code = f"""cloudflared tunnel run {tunnel_name} # This is running like a normal command """
|
|
139
|
+
case "oneoff-background-process":
|
|
140
|
+
if tunnel_name is None: tunnel_name = ""
|
|
141
|
+
import getpass
|
|
142
|
+
user_name = getpass.getuser()
|
|
143
|
+
code = f"""
|
|
144
|
+
# This verion runs like a deamon, but its not peristent across reboots
|
|
145
|
+
sudo systemd-run \
|
|
146
|
+
--unit=cloudflared-tunnel \
|
|
147
|
+
--description="Cloudflared Tunnel (transient)" \
|
|
148
|
+
--property=Restart=on-failure \
|
|
149
|
+
--property=RestartSec=5 \
|
|
150
|
+
--property=User={user_name} \
|
|
151
|
+
--property=Group={user_name} \
|
|
152
|
+
--property=Environment=HOME=/home/{user_name} \
|
|
153
|
+
--property=WorkingDirectory=/home/{user_name} \
|
|
154
|
+
/home/{user_name}/.local/bin/cloudflared \
|
|
155
|
+
--config /home/{user_name}/.cloudflared/config.yml \
|
|
156
|
+
tunnel run {tunnel_name}
|
|
157
|
+
"""
|
|
158
|
+
case "as-service":
|
|
159
|
+
code = """
|
|
160
|
+
home_dir=$HOME
|
|
161
|
+
cloudflared_path="$home_dir/.local/bin/cloudflared"
|
|
162
|
+
sudo $cloudflared_path service uninstall
|
|
163
|
+
sudo rm /etc/cloudflared/config.yml || true
|
|
164
|
+
sudo $cloudflared_path --config $home_dir/.cloudflared/config.yml service install
|
|
165
|
+
"""
|
|
166
|
+
|
|
167
|
+
from machineconfig.utils.code import exit_then_run_shell_script, print_code
|
|
168
|
+
print_code(code, lexer="bash", desc="code to achieve the goal")
|
|
169
|
+
yes = typer.confirm("Do you want to run the above commands now?", default=False)
|
|
170
|
+
if yes:
|
|
171
|
+
exit_then_run_shell_script(code)
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def vscode_share(
|
|
176
|
+
action: Annotated[Literal["run", "install-service", "uninstall-service", "share-local"], typer.Option(..., "--action", "-a", help="Action to perform", case_sensitive=False, show_choices=True)],
|
|
177
|
+
name: Annotated[str | None, typer.Option("--name", "-n", help="Name for the tunnel/service")] = None,
|
|
178
|
+
path: Annotated[str | None, typer.Option("--path", "-p", help="Path to share locally (for share-local)")] = None,
|
|
179
|
+
extra_args: Annotated[str | None, typer.Option("--extra-args", "-e", help="Extra args to append to the code tunnel command")] = None,
|
|
180
|
+
) -> None:
|
|
181
|
+
"""🧑💻 Share workspace using VS Code Tunnels ("code tunnel")
|
|
182
|
+
|
|
183
|
+
Note: this helper prints recommended commands and optionally runs them.
|
|
184
|
+
If you need more functionality, consult VS Code Tunnels docs: https://code.visualstudio.com/docs/remote/tunnels
|
|
185
|
+
"""
|
|
186
|
+
accept = "--accept-server-license-terms"
|
|
187
|
+
name_part = f"--name {name}" if name else ""
|
|
188
|
+
extra = extra_args or ""
|
|
189
|
+
|
|
190
|
+
if action == "run":
|
|
191
|
+
cmd = f"code tunnel {name_part} {accept} {extra}".strip()
|
|
192
|
+
desc = "Run a one-off VS Code tunnel (foreground)"
|
|
193
|
+
elif action == "install-service":
|
|
194
|
+
cmd = f"code tunnel service install {accept} {name_part}".strip()
|
|
195
|
+
desc = "Install code tunnel as a service"
|
|
196
|
+
elif action == "uninstall-service":
|
|
197
|
+
cmd = "code tunnel service uninstall"
|
|
198
|
+
desc = "Uninstall code tunnel service"
|
|
199
|
+
elif action == "share-local":
|
|
200
|
+
p = path or "."
|
|
201
|
+
# Some VS Code CLI integrations prefer starting a tunnel and then using the editor to expose resources.
|
|
202
|
+
cmd = f"code tunnel {name_part} {accept} {extra}".strip()
|
|
203
|
+
desc = f"Start tunnel and then share local path: {p} (use VS Code UI to forward ports / share files)"
|
|
204
|
+
else:
|
|
205
|
+
print(f"Unknown action: {action}")
|
|
206
|
+
return
|
|
207
|
+
|
|
208
|
+
from machineconfig.utils.code import print_code, exit_then_run_shell_script
|
|
209
|
+
print_code(cmd, lexer="bash", desc=desc)
|
|
210
|
+
|
|
211
|
+
if typer.confirm("Do you want to run the above command now?", default=False):
|
|
212
|
+
exit_then_run_shell_script(cmd)
|
|
213
|
+
else:
|
|
214
|
+
print("Command not executed. Use the printed command in your terminal when ready.")
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
def add_ip_exclusion_to_warp(ip: Annotated[str, typer.Option(..., "--ip", help="IP address(es) to exclude from WARP (Comma separated)")]):
|
|
219
|
+
ips = ip.split(",")
|
|
220
|
+
res = ""
|
|
221
|
+
for an_ip in ips:
|
|
222
|
+
res += f'sudo warp-cli tunnel ip add {an_ip}\n'
|
|
223
|
+
print(f"Adding IP exclusion to WARP for: {an_ip}")
|
|
224
|
+
code = f"""
|
|
225
|
+
{res}
|
|
226
|
+
echo "Restarting WARP connection..."
|
|
227
|
+
sudo warp-cli disconnect
|
|
228
|
+
echo "Waiting for 2 seconds..."
|
|
229
|
+
sleep 2
|
|
230
|
+
echo "Reconnecting WARP..."
|
|
231
|
+
sudo warp-cli connect
|
|
232
|
+
"""
|
|
233
|
+
print(code)
|
|
234
|
+
print("NOTE: Please run the above commands in your terminal to apply the changes.")
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
def get_app():
|
|
238
|
+
nw_apps = typer.Typer(help="🔐 [n] Network subcommands", no_args_is_help=True, add_help_option=True, add_completion=False)
|
|
239
|
+
nw_apps.command(name="share-terminal", help="📡 [t] Share terminal via web browser")(cli_share_terminal.share_terminal)
|
|
240
|
+
nw_apps.command(name="t", help="Share terminal via web browser", hidden=True)(cli_share_terminal.share_terminal)
|
|
241
|
+
|
|
242
|
+
nw_apps.command(name="share-server", help="🌐 [s] Start local/global server to share files/folders via web browser", no_args_is_help=True)(cli_share_server.web_file_explorer)
|
|
243
|
+
nw_apps.command(name="s", help="Start local/global server to share files/folders via web browser", hidden=True, no_args_is_help=True)(cli_share_server.web_file_explorer)
|
|
244
|
+
|
|
245
|
+
# app = cli_share_server.get_share_file_app()
|
|
246
|
+
# nw_apps.add_typer(app, name="share-file", help="📁 [f] Share a file via relay server", no_args_is_help=True)
|
|
247
|
+
# nw_apps.add_typer(app, name="f", help="Share a file via relay server", hidden=True, no_args_is_help=True)
|
|
248
|
+
nw_apps.command(name="send", no_args_is_help=True, hidden=False, help="📁 [sx] send files from here.")(machineconfig.scripts.python.helpers.helpers_devops.cli_share_file.share_file_send)
|
|
249
|
+
nw_apps.command(name="sx", no_args_is_help=True, hidden=True, help="📁 [sx] send files from here.")(machineconfig.scripts.python.helpers.helpers_devops.cli_share_file.share_file_send)
|
|
250
|
+
nw_apps.command(name="receive", no_args_is_help=True, hidden=False, help="📁 [rx] receive files to here.")(machineconfig.scripts.python.helpers.helpers_devops.cli_share_file.share_file_receive)
|
|
251
|
+
nw_apps.command(name="rx", no_args_is_help=True, hidden=True, help="📁 [rx] receive files to here.")(machineconfig.scripts.python.helpers.helpers_devops.cli_share_file.share_file_receive)
|
|
252
|
+
|
|
253
|
+
nw_apps.command(name="share-temp-file", help="🌡️ [T] Share a file via temp.sh")(cli_share_temp.upload_file)
|
|
254
|
+
nw_apps.command(name="T", help="Share a file via temp.sh", hidden=True)(cli_share_temp.upload_file)
|
|
255
|
+
|
|
256
|
+
nw_apps.add_typer(cli_ssh.get_app(), name="ssh", help="🔐 [S] SSH subcommands")
|
|
257
|
+
nw_apps.add_typer(cli_ssh.get_app(), name="S", help="SSH subcommands", hidden=True)
|
|
258
|
+
|
|
259
|
+
nw_apps.command(name="show-address", help="📌 [a] Show this computer addresses on network")(show_address)
|
|
260
|
+
nw_apps.command(name="a", help="Show this computer addresses on network", hidden=True)(show_address)
|
|
261
|
+
|
|
262
|
+
nw_apps.command(name="switch-public-ip", help="🔁 [c] Switch public IP address (Cloudflare WARP)")(switch_public_ip_address)
|
|
263
|
+
nw_apps.command(name="c", help="Switch public IP address (Cloudflare WARP)", hidden=True)(switch_public_ip_address)
|
|
264
|
+
|
|
265
|
+
nw_apps.command(name="wifi-select", no_args_is_help=True, help="📶 [w] WiFi connection utility.")(wifi_select)
|
|
266
|
+
nw_apps.command(name="w", no_args_is_help=True, hidden=True)(wifi_select)
|
|
267
|
+
|
|
268
|
+
nw_apps.command(name="bind-wsl-port", help="🔌 [b] Bind WSL port to Windows host", no_args_is_help=True)(bind_wsl_port)
|
|
269
|
+
nw_apps.command(name="b", help="Bind WSL port to Windows host", hidden=True, no_args_is_help=True)(bind_wsl_port)
|
|
270
|
+
nw_apps.command(name="open-wsl-port", no_args_is_help=True, help="🔥 [o] Open Windows firewall ports for WSL.", hidden=False)(open_wsl_port)
|
|
271
|
+
nw_apps.command(name="o", no_args_is_help=True, help="Open Windows firewall ports for WSL.", hidden=True)(open_wsl_port)
|
|
272
|
+
nw_apps.command(name="link-wsl-windows", no_args_is_help=False, help="🔗 [l] Link WSL home and Windows home directories.", hidden=False)(link_wsl_and_windows_home)
|
|
273
|
+
nw_apps.command(name="l", no_args_is_help=False, help="Link WSL home and Windows home directories.", hidden=True)(link_wsl_and_windows_home)
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
nw_apps.command(name="reset-cloudflare-tunnel", help="☁️ [r] Reset Cloudflare tunnel service")(reset_cloudflare_tunnel)
|
|
277
|
+
nw_apps.command(name="r", help="Reset Cloudflare tunnel service", hidden=True)(reset_cloudflare_tunnel)
|
|
278
|
+
nw_apps.command(name="add-ip-exclusion-to-warp", help="🚫 [p] Add IP exclusion to WARP")(add_ip_exclusion_to_warp)
|
|
279
|
+
nw_apps.command(name="p", help="Add IP exclusion to WARP", hidden=True)(add_ip_exclusion_to_warp)
|
|
280
|
+
|
|
281
|
+
# VS Code Tunnels helper
|
|
282
|
+
nw_apps.command(name="vscode-share", no_args_is_help=True, help="🧑💻 [v] Share workspace via VS Code Tunnels")(vscode_share)
|
|
283
|
+
nw_apps.command(name="v", no_args_is_help=True, hidden=True, help="Share workspace via VS Code Tunnels")(vscode_share)
|
|
284
|
+
|
|
285
|
+
return nw_apps
|