machineconfig 7.98__py3-none-any.whl → 8.51__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +26 -20
- 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/powershell_scripts/mount_ssh.ps1 +13 -0
- machineconfig/jobs/scripts/powershell_scripts/obs.ps1 +4 -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 +225 -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 +98 -0
- machineconfig/scripts/python/helpers/helpers_devops/cli_config_dotfile.py +274 -0
- machineconfig/scripts/python/helpers/helpers_devops/cli_data.py +67 -0
- machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/cli_nw.py +69 -82
- machineconfig/scripts/python/helpers/helpers_devops/cli_repos.py +274 -0
- machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/cli_self.py +47 -22
- 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_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/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_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 +1 -1
- 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_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_network → helpers/helpers_network}/mount_ssh.py +2 -2
- machineconfig/scripts/python/helpers/helpers_network/ssh_add_identity.py +73 -0
- machineconfig/scripts/python/helpers/helpers_network/ssh_add_ssh_key.py +175 -0
- machineconfig/scripts/python/helpers/helpers_network/ssh_debug_linux.py +319 -0
- machineconfig/scripts/python/helpers/helpers_network/ssh_debug_windows.py +275 -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 +118 -34
- 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/sessions_impl.py +186 -0
- machineconfig/scripts/python/{helpers_sessions → helpers/helpers_sessions}/sessions_multiprocess.py +1 -2
- machineconfig/scripts/python/helpers/helpers_terminal/__init__.py +0 -0
- machineconfig/scripts/python/helpers/helpers_terminal/terminal_impl.py +96 -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 +133 -48
- machineconfig/scripts/python/msearch.py +16 -61
- machineconfig/scripts/python/sessions.py +68 -203
- machineconfig/scripts/python/terminal.py +27 -102
- machineconfig/scripts/python/utils.py +101 -22
- 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 -3
- 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 +69 -1
- machineconfig/settings/shells/pwsh/search_pwsh_history.ps1 +99 -0
- machineconfig/settings/shells/wezterm/wezterm.lua +4 -1
- machineconfig/settings/shells/wt/settings.json +21 -21
- machineconfig/settings/shells/zsh/init.sh +25 -4
- 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/layouts/st.kdl +40 -9
- machineconfig/settings/zellij/layouts/st2.kdl +1 -1
- 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 +1 -15
- machineconfig/utils/installer_utils/installer_helper.py +2 -2
- machineconfig/utils/installer_utils/installer_locator_utils.py +13 -13
- 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/scheduler.py +8 -2
- machineconfig/utils/schemas/fire_agents/fire_agents_input.py +1 -1
- machineconfig/utils/source_of_truth.py +6 -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.51.dist-info}/METADATA +30 -22
- machineconfig-8.51.dist-info/RECORD +543 -0
- machineconfig/jobs/installer/check_installations.py +0 -248
- machineconfig/profile/backup.toml +0 -49
- machineconfig/profile/mapper.toml +0 -263
- 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_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/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/windows/mounts/mount_ssh.ps1 +0 -13
- 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/obs.ps1 +0 -4
- 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 → checks}/__init__.py +0 -0
- /machineconfig/{scripts/python/helpers_agents → 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/{setup_linux/others → jobs/scripts/bash_scripts}/android.sh +0 -0
- /machineconfig/jobs/{installer/linux_scripts → scripts/bash_scripts}/lid.sh +0 -0
- /machineconfig/{scripts/python/helpers_network → jobs/scripts/bash_scripts}/mount_drive +0 -0
- /machineconfig/{scripts/python/helpers_network → jobs/scripts/bash_scripts}/mount_nfs +0 -0
- /machineconfig/{scripts/python/helpers_network → jobs/scripts/bash_scripts}/mount_nw_drive +0 -0
- /machineconfig/{scripts/python/helpers_network → jobs/scripts/bash_scripts}/mount_smb +0 -0
- /machineconfig/{scripts/linux/other → jobs/scripts/bash_scripts}/share_cloud.sh +0 -0
- /machineconfig/{scripts/linux/other → jobs/scripts/bash_scripts}/share_nfs +0 -0
- /machineconfig/{scripts/linux/other → jobs/scripts/bash_scripts}/start_docker +0 -0
- /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/Restore-ThunderbirdProfile.ps1 +0 -0
- /machineconfig/{setup_windows/others → jobs/scripts/powershell_scripts}/docker.ps1 +0 -0
- /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/mount_nfs.ps1 +0 -0
- /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/mount_nw.ps1 +0 -0
- /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/mount_smb.ps1 +0 -0
- /machineconfig/{setup_windows/others → jobs/scripts/powershell_scripts}/power_options.ps1 +0 -0
- /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/share_cloud.cmd +0 -0
- /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/share_smb.ps1 +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_agents/agentic_frameworks → graph}/__init__.py +0 -0
- /machineconfig/scripts/python/{helpers_cloud → 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_croshell → helpers/helpers_agents}/__init__.py +0 -0
- /machineconfig/scripts/python/{helpers_devops → 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_devops/themes → 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_fire_command → 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_network → helpers/helpers_devops}/__init__.py +0 -0
- /machineconfig/scripts/python/{helpers_sessions → helpers/helpers_devops/themes}/__init__.py +0 -0
- /machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/themes/choose_pwsh_theme.ps1 +0 -0
- /machineconfig/{setup_windows/wt_and_pwsh → scripts/python/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 → helpers/helpers_fire_command}/f.py +0 -0
- /machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_fire_command}/fire_jobs_streamlit_helper.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_devops/themes/choose_starship_theme.ps1 → helpers/helpers_network/__init__.py} +0 -0
- /machineconfig/scripts/python/{helpers_network → helpers/helpers_network}/mount_nfs.py +0 -0
- /machineconfig/scripts/python/{helpers_network → helpers/helpers_network}/mount_nw_drive.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.51.dist-info}/WHEEL +0 -0
- {machineconfig-7.98.dist-info → machineconfig-8.51.dist-info}/entry_points.txt +0 -0
- {machineconfig-7.98.dist-info → machineconfig-8.51.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import typer
|
|
3
3
|
from typing import Annotated, Literal
|
|
4
|
+
from machineconfig.utils.ssh_utils.abc import MACHINECONFIG_VERSION
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
def copy_both_assets():
|
|
@@ -69,12 +70,12 @@ def update(copy_assets: Annotated[bool, typer.Option("--assets-copy/--no-assets-
|
|
|
69
70
|
uv self update
|
|
70
71
|
cd ~/code/machineconfig
|
|
71
72
|
git pull
|
|
72
|
-
uv tool install --upgrade --editable $HOME/code/machineconfig
|
|
73
|
+
uv tool install --no-cache --upgrade --editable $HOME/code/machineconfig
|
|
73
74
|
"""
|
|
74
75
|
else:
|
|
75
76
|
shell_script = """
|
|
76
77
|
uv self update
|
|
77
|
-
uv tool install --upgrade machineconfig
|
|
78
|
+
uv tool install --no-cache --upgrade machineconfig
|
|
78
79
|
"""
|
|
79
80
|
import platform
|
|
80
81
|
if platform.system() == "Windows":
|
|
@@ -86,38 +87,63 @@ uv tool install --upgrade machineconfig
|
|
|
86
87
|
exit_then_run_shell_script(shell_script + "\n" + uv_command, strict=True)
|
|
87
88
|
else:
|
|
88
89
|
from machineconfig.utils.code import run_shell_script
|
|
89
|
-
run_shell_script(shell_script)
|
|
90
|
+
run_shell_script(shell_script, display_script=True, clean_env=False)
|
|
90
91
|
if copy_assets:
|
|
91
92
|
copy_both_assets()
|
|
92
93
|
if link_public_configs:
|
|
93
94
|
import machineconfig.profile.create_links_export as create_links_export
|
|
94
|
-
create_links_export.
|
|
95
|
+
create_links_export.main_from_parser(sensitivity="public", method="copy", on_conflict="overwrite-default-path", which="all")
|
|
95
96
|
|
|
96
97
|
|
|
97
|
-
def install(
|
|
98
|
+
def install(copy_assets: Annotated[bool, typer.Option("--copy-assets/--no-assets-copy", "-a/-na", help="Copy (overwrite) assets to the machine after the update")] = True,
|
|
99
|
+
dev: Annotated[bool, typer.Option("--dev", "-d", help="Install from local development code instead of PyPI")] = False,
|
|
100
|
+
|
|
101
|
+
):
|
|
98
102
|
"""📋 CLONE machienconfig locally and incorporate to shell profile for faster execution and nightly updates."""
|
|
99
|
-
from machineconfig.utils.code import run_shell_script,
|
|
103
|
+
from machineconfig.utils.code import run_shell_script, get_uv_command, get_shell_script_running_lambda_function, exit_then_run_shell_script
|
|
100
104
|
from pathlib import Path
|
|
101
105
|
import platform
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
106
|
+
mcfg_path = Path.home().joinpath("code/machineconfig")
|
|
107
|
+
_ = run_shell_script
|
|
108
|
+
if dev and not mcfg_path.exists():
|
|
109
|
+
# clone: https://github.com/thisismygitrepo/machineconfig.git
|
|
110
|
+
import git
|
|
111
|
+
mcfg_path.parent.mkdir(parents=True, exist_ok=True)
|
|
112
|
+
git.Repo.clone_from("https://github.com/thisismygitrepo/machineconfig.git", str(mcfg_path))
|
|
113
|
+
# now we need to run `uv sync` to install dependencies
|
|
114
|
+
|
|
115
|
+
uv_command = get_uv_command(platform=platform.system())
|
|
116
|
+
if copy_assets:
|
|
117
|
+
def func():
|
|
118
|
+
from machineconfig.profile.create_shell_profile import create_default_shell_profile
|
|
119
|
+
create_default_shell_profile() # involves copying assets too
|
|
120
|
+
uv_command2, _script_path = get_shell_script_running_lambda_function(lambda: func(),
|
|
121
|
+
uv_with=["machineconfig"], uv_project_dir=None)
|
|
105
122
|
else:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
123
|
+
uv_command2 = ""
|
|
124
|
+
if mcfg_path.exists():
|
|
125
|
+
exit_then_run_shell_script(f"""
|
|
126
|
+
cd {str(mcfg_path)}
|
|
127
|
+
{uv_command} sync
|
|
128
|
+
{uv_command} tool install --upgrade --editable "{str(mcfg_path)}"
|
|
129
|
+
{uv_command2}
|
|
130
|
+
""")
|
|
131
|
+
else:
|
|
132
|
+
exit_then_run_shell_script(rf"""
|
|
133
|
+
{uv_command} tool install --upgrade "{MACHINECONFIG_VERSION}"
|
|
134
|
+
{uv_command2}
|
|
135
|
+
""")
|
|
110
136
|
|
|
111
137
|
|
|
112
138
|
|
|
113
139
|
def interactive():
|
|
114
140
|
"""🤖 INTERACTIVE configuration of machine."""
|
|
115
|
-
from machineconfig.scripts.python.interactive import main
|
|
141
|
+
from machineconfig.scripts.python.helpers.helpers_devops.interactive import main
|
|
116
142
|
main()
|
|
117
143
|
|
|
118
144
|
def status():
|
|
119
145
|
"""📊 STATUS of machine, shell profile, apps, symlinks, dotfiles, etc."""
|
|
120
|
-
import machineconfig.scripts.python.helpers_devops.devops_status as helper
|
|
146
|
+
import machineconfig.scripts.python.helpers.helpers_devops.devops_status as helper
|
|
121
147
|
helper.main()
|
|
122
148
|
|
|
123
149
|
|
|
@@ -128,7 +154,7 @@ def navigate():
|
|
|
128
154
|
path = Path(navigator.__file__).resolve().parent.joinpath("devops_navigator.py")
|
|
129
155
|
from machineconfig.utils.code import exit_then_run_shell_script
|
|
130
156
|
if Path.home().joinpath("code/machineconfig").exists(): executable = f"""--project "{str(Path.home().joinpath("code/machineconfig"))}" --with textual"""
|
|
131
|
-
else: executable = """--with "
|
|
157
|
+
else: executable = f"""--with "{MACHINECONFIG_VERSION},textual" """
|
|
132
158
|
exit_then_run_shell_script(f"""uv run {executable} {path}""")
|
|
133
159
|
|
|
134
160
|
def readme():
|
|
@@ -152,21 +178,20 @@ def readme():
|
|
|
152
178
|
|
|
153
179
|
|
|
154
180
|
def get_app():
|
|
155
|
-
cli_app = typer.Typer(help="🔄 [s] self operations subcommands", no_args_is_help=True, add_help_option=
|
|
181
|
+
cli_app = typer.Typer(help="🔄 [s] self operations subcommands", no_args_is_help=True, add_help_option=True, add_completion=False)
|
|
156
182
|
cli_app.command("update", no_args_is_help=False, help="🔄 [u] UPDATE machineconfig")(update)
|
|
157
183
|
cli_app.command("u", no_args_is_help=False, hidden=True)(update)
|
|
158
|
-
cli_app.command("interactive", no_args_is_help=False, help="🤖 [
|
|
159
|
-
cli_app.command("
|
|
184
|
+
cli_app.command("interactive", no_args_is_help=False, help="🤖 [ia] INTERACTIVE configuration of machine.")(interactive)
|
|
185
|
+
cli_app.command("ia", no_args_is_help=False, help="INTERACTIVE configuration of machine.", hidden=True)(interactive)
|
|
160
186
|
cli_app.command(name="init", no_args_is_help=False, help="🦐 [t] Define and manage configurations")(init)
|
|
161
187
|
cli_app.command(name="t", no_args_is_help=False, hidden=True)(init)
|
|
162
188
|
cli_app.command("status", no_args_is_help=False, help="📊 [s] STATUS of machine, shell profile, apps, symlinks, dotfiles, etc.")(status)
|
|
163
189
|
cli_app.command("s", no_args_is_help=False, help="STATUS of machine, shell profile, apps, symlinks, dotfiles, etc.", hidden=True)(status)
|
|
164
|
-
cli_app.command("install", no_args_is_help=False, help="📋 [
|
|
165
|
-
cli_app.command("
|
|
190
|
+
cli_app.command("install", no_args_is_help=False, help="📋 [i] CLONE machienconfig locally and incorporate to shell profile for faster execution and nightly updates.")(install)
|
|
191
|
+
cli_app.command("i", no_args_is_help=False, help="CLONE machienconfig locally and incorporate to shell profile for faster execution and nightly updates.", hidden=True)(install)
|
|
166
192
|
cli_app.command("navigate", no_args_is_help=False, help="📚 [n] NAVIGATE command structure with TUI")(navigate)
|
|
167
193
|
cli_app.command("n", no_args_is_help=False, help="NAVIGATE command structure with TUI", hidden=True)(navigate)
|
|
168
194
|
|
|
169
195
|
cli_app.command("readme", no_args_is_help=False, help="📚 [r] render readme markdown in terminal.")(readme)
|
|
170
196
|
cli_app.command("r", no_args_is_help=False, hidden=True)(readme)
|
|
171
197
|
return cli_app
|
|
172
|
-
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import typer
|
|
3
|
-
from typing import Annotated
|
|
3
|
+
from typing import Annotated, Literal
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def share_file_receive(code_args: Annotated[list[str], typer.Argument(help="Receive code or relay command. Examples: '7121-donor-olympic-bicycle' or '--relay 10.17.62.206:443 7121-donor-olympic-bicycle'")],
|
|
@@ -97,41 +97,55 @@ def share_file_send(path: Annotated[str, typer.Argument(help="Path to the file o
|
|
|
97
97
|
code: Annotated[str | None, typer.Option("--code", "-c", help="Codephrase used to connect to relay")] = None,
|
|
98
98
|
text: Annotated[str | None, typer.Option("--text", "-t", help="Send some text")] = None,
|
|
99
99
|
qrcode: Annotated[bool, typer.Option("--qrcode", "--qr", help="Show receive code as a qrcode")] = False,
|
|
100
|
+
backend: Annotated[Literal["wormhole", "w", "croc", "c"], typer.Option("--backend", "-b", help="Backend to use")] = "croc",
|
|
100
101
|
) -> None:
|
|
101
102
|
"""Send a file using croc with relay server."""
|
|
102
|
-
from machineconfig.utils.installer_utils.installer_cli import install_if_missing
|
|
103
|
-
install_if_missing(which="croc")
|
|
104
|
-
# Get relay server IP from environment or use default
|
|
105
|
-
import machineconfig.scripts.python.helpers_network.address as helper
|
|
106
|
-
res = helper.select_lan_ipv4(prefer_vpn=False)
|
|
107
|
-
if res is None:
|
|
108
|
-
typer.echo("❌ Error: Could not determine local LAN IPv4 address for relay.", err=True)
|
|
109
|
-
raise typer.Exit(code=1)
|
|
110
|
-
local_ip_v4 = res
|
|
111
103
|
import platform
|
|
112
|
-
relay_port = "443"
|
|
113
|
-
is_windows = platform.system() == "Windows"
|
|
114
|
-
|
|
115
|
-
# Build command parts
|
|
116
|
-
relay_arg = f"--relay {local_ip_v4}:{relay_port} --ip {local_ip_v4}:{relay_port}"
|
|
117
|
-
zip_arg = "--zip" if zip_folder else ""
|
|
118
|
-
text_arg = f"--text '{text}'" if text else ""
|
|
119
|
-
qrcode_arg = "--qrcode" if qrcode else ""
|
|
120
|
-
path_arg = f"{path}" if not text else ""
|
|
121
104
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
105
|
+
match backend:
|
|
106
|
+
case "wormhole" | "w":
|
|
107
|
+
if code is None: code_line = ""
|
|
108
|
+
else: code_line = f"--code {code}"
|
|
109
|
+
if text is not None: text_line = f"--text '{text}'"
|
|
110
|
+
else: text_line = f"'{path}'"
|
|
111
|
+
script = f"""
|
|
112
|
+
uvx magic-wormhole send {code_line} {text_line}
|
|
113
|
+
"""
|
|
114
|
+
print(f"🚀 Sending file: {path}. Use: uvx magic-wormhole receive ")
|
|
115
|
+
case "croc" | "c":
|
|
116
|
+
from machineconfig.utils.installer_utils.installer_cli import install_if_missing
|
|
117
|
+
install_if_missing(which="croc")
|
|
118
|
+
|
|
119
|
+
# Get relay server IP from environment or use default
|
|
120
|
+
import machineconfig.scripts.python.helpers.helpers_network.address as helper
|
|
121
|
+
res = helper.select_lan_ipv4(prefer_vpn=False)
|
|
122
|
+
if res is None:
|
|
123
|
+
typer.echo("❌ Error: Could not determine local LAN IPv4 address for relay.", err=True)
|
|
124
|
+
raise typer.Exit(code=1)
|
|
125
|
+
local_ip_v4 = res
|
|
126
|
+
relay_port = "443"
|
|
127
|
+
is_windows = platform.system() == "Windows"
|
|
128
|
+
# Build command parts
|
|
129
|
+
relay_arg = f"--relay {local_ip_v4}:{relay_port} --ip {local_ip_v4}:{relay_port}"
|
|
130
|
+
zip_arg = "--zip" if zip_folder else ""
|
|
131
|
+
text_arg = f"--text '{text}'" if text else ""
|
|
132
|
+
qrcode_arg = "--qrcode" if qrcode else ""
|
|
133
|
+
path_arg = f"{path}" if not text else ""
|
|
134
|
+
|
|
135
|
+
if is_windows:
|
|
136
|
+
# Windows PowerShell format
|
|
137
|
+
code_arg = f"--code {code}" if code else ""
|
|
138
|
+
script = f"""croc {relay_arg} send {zip_arg} {code_arg} {qrcode_arg} {text_arg} {path_arg}"""
|
|
139
|
+
else:
|
|
140
|
+
# Linux/macOS Bash format
|
|
141
|
+
if code:
|
|
142
|
+
script = f"""
|
|
143
|
+
export CROC_SECRET="{code}"
|
|
130
144
|
croc {relay_arg} send {zip_arg} {qrcode_arg} {text_arg} {path_arg}"""
|
|
131
|
-
|
|
132
|
-
|
|
145
|
+
else:
|
|
146
|
+
script = f"""croc {relay_arg} send {zip_arg} {qrcode_arg} {text_arg} {path_arg}"""
|
|
133
147
|
|
|
134
148
|
typer.echo(f"🚀 Sending file: {path}. Use: devops network receive")
|
|
135
149
|
from machineconfig.utils.code import exit_then_run_shell_script, print_code
|
|
136
150
|
print_code(code=script, desc="🚀 sending file with croc", lexer="bash" if platform.system() != "Windows" else "powershell")
|
|
137
|
-
exit_then_run_shell_script(script=script, strict=False)
|
|
151
|
+
exit_then_run_shell_script(script=script, strict=False)
|
|
@@ -1,42 +1,17 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
2
|
from typing import Optional, Annotated
|
|
3
|
-
from machineconfig.scripts.python.helpers_devops.cli_share_file import share_file_receive, share_file_send
|
|
3
|
+
from machineconfig.scripts.python.helpers.helpers_devops.cli_share_file import share_file_receive, share_file_send
|
|
4
|
+
from machineconfig.utils.accessories import display_with_flashy_style
|
|
4
5
|
import typer
|
|
5
6
|
|
|
6
7
|
|
|
7
|
-
def display_share_url(local_ip_v4: str, port: int, protocol: str = "http") -> None:
|
|
8
|
-
"""Display a flashy, unmissable share URL announcement."""
|
|
9
|
-
from rich.console import Console
|
|
10
|
-
from rich.panel import Panel
|
|
11
|
-
from rich.text import Text
|
|
12
|
-
from rich.align import Align
|
|
13
|
-
console = Console()
|
|
14
|
-
# Create the main message with styling
|
|
15
|
-
url_text = Text(f"{protocol}://{local_ip_v4}:{port}", style="bold bright_cyan underline")
|
|
16
|
-
message = Text.assemble(
|
|
17
|
-
("🚀 ", "bright_red"),
|
|
18
|
-
("Share server is now accessible at: ", "bright_white bold"),
|
|
19
|
-
url_text,
|
|
20
|
-
(" 🚀", "bright_red")
|
|
21
|
-
)
|
|
22
|
-
# Create a fancy panel with borders and styling
|
|
23
|
-
panel = Panel(
|
|
24
|
-
Align.center(message),
|
|
25
|
-
title="[bold bright_green]🌐 SHARE SERVER READY 🌐[/bold bright_green]",
|
|
26
|
-
subtitle="[italic bright_yellow]⚡ Click the link above to access your shared files! ⚡[/italic bright_yellow]",
|
|
27
|
-
border_style="bright_magenta",
|
|
28
|
-
padding=(1, 2),
|
|
29
|
-
expand=False
|
|
30
|
-
)
|
|
31
|
-
# Print with extra spacing and attention-grabbing elements
|
|
32
|
-
console.print(panel)
|
|
33
|
-
|
|
34
|
-
|
|
35
8
|
def web_file_explorer(
|
|
36
9
|
path: Annotated[str, typer.Argument(help="Path to the file or directory to share")],
|
|
37
10
|
port: Annotated[Optional[int], typer.Option("--port", "-p", help="Port to run the share server on (default: 8080)")] = None,
|
|
38
11
|
username: Annotated[Optional[str], typer.Option("--username", "-u", help="Username for share access (default: current user)")] = None,
|
|
12
|
+
no_auth: Annotated[bool, typer.Option("--no-auth", "-na", help="Disable authentication for share access")] = False,
|
|
39
13
|
password: Annotated[Optional[str], typer.Option("--password", "-w", help="Password for share access (default: from ~/dotfiles/creds/passwords/quick_password)")] = None,
|
|
14
|
+
bind_address: Annotated[str, typer.Option("--bind", "-a", help="Address to bind the server to")] = "0.0.0.0",
|
|
40
15
|
over_internet: Annotated[bool, typer.Option("--over-internet", "-i", help="Expose the share server over the internet using ngrok")] = False,
|
|
41
16
|
backend: Annotated[str, typer.Option("--backend", "-b", help="Backend to use: filebrowser (default), miniserve, qrcp, or easy-sharing")] = "miniserve",
|
|
42
17
|
) -> None:
|
|
@@ -48,22 +23,22 @@ def web_file_explorer(
|
|
|
48
23
|
install_if_missing(which=backend)
|
|
49
24
|
if over_internet:
|
|
50
25
|
install_if_missing(which="ngrok")
|
|
51
|
-
if
|
|
52
|
-
import getpass
|
|
53
|
-
username = getpass.getuser()
|
|
54
|
-
|
|
55
|
-
if password is None:
|
|
26
|
+
if password is None and not no_auth:
|
|
56
27
|
pwd_path = Path.home().joinpath("dotfiles/creds/passwords/quick_password")
|
|
57
28
|
if pwd_path.exists():
|
|
58
29
|
password = pwd_path.read_text(encoding="utf-8").strip()
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
30
|
+
if username is None:
|
|
31
|
+
import getpass
|
|
32
|
+
username = getpass.getuser()
|
|
33
|
+
# else:
|
|
34
|
+
# typer.echo(f"⚠️ WARNING: Password not provided and default password file does not exist.\nPath: {pwd_path}\nUsing default password: 'quick_password' (insecure!)", err=True)
|
|
35
|
+
# raise typer.Exit(code=1)
|
|
36
|
+
|
|
62
37
|
|
|
63
38
|
if port is None:
|
|
64
39
|
port = 8080
|
|
65
40
|
|
|
66
|
-
import machineconfig.scripts.python.helpers_network.address as helper
|
|
41
|
+
import machineconfig.scripts.python.helpers.helpers_network.address as helper
|
|
67
42
|
res = helper.select_lan_ipv4(prefer_vpn=False)
|
|
68
43
|
if res is None:
|
|
69
44
|
typer.echo("❌ ERROR: Could not determine local LAN IPv4 address for share server.", err=True)
|
|
@@ -71,7 +46,7 @@ def web_file_explorer(
|
|
|
71
46
|
local_ip_v4 = res
|
|
72
47
|
|
|
73
48
|
protocol = "http"
|
|
74
|
-
|
|
49
|
+
display_with_flashy_style(msg=f"{protocol}://{local_ip_v4}:{port}/", title="Local Network Share URL")
|
|
75
50
|
|
|
76
51
|
path_obj = Path(path).resolve()
|
|
77
52
|
if not path_obj.exists():
|
|
@@ -83,14 +58,22 @@ def web_file_explorer(
|
|
|
83
58
|
db_path.parent.mkdir(parents=True, exist_ok=True)
|
|
84
59
|
command = f"""
|
|
85
60
|
filebrowser users add {username} "{password}" --database {db_path}
|
|
86
|
-
filebrowser --address
|
|
61
|
+
filebrowser --address {bind_address} --port {port} --root "{path_obj}" --database {db_path}
|
|
87
62
|
"""
|
|
88
63
|
elif backend == "miniserve":
|
|
89
|
-
|
|
64
|
+
if username and password:
|
|
65
|
+
auth_line = f"""--auth "{username}:{password}" """
|
|
66
|
+
else:
|
|
67
|
+
auth_line = ""
|
|
68
|
+
command = f"""miniserve --port {port} --interfaces {bind_address} {auth_line} --upload-files --mkdir --enable-tar --enable-tar-gz --enable-zip --qrcode "{path_obj}" """
|
|
90
69
|
elif backend == "easy-sharing":
|
|
91
|
-
|
|
70
|
+
if username is None and password is None:
|
|
71
|
+
auth_line = ""
|
|
72
|
+
else:
|
|
73
|
+
auth_line = f'--username "{username}" --password "{password}"'
|
|
74
|
+
command = f"""easy-sharing --port {port} {auth_line} "{path_obj}" """
|
|
92
75
|
elif backend == "qrcp":
|
|
93
|
-
command = f"""qrcp "{path_obj}" """
|
|
76
|
+
command = f"""qrcp --port {port} --bind {bind_address} "{path_obj}" """
|
|
94
77
|
else:
|
|
95
78
|
typer.echo(f"❌ ERROR: Unknown backend '{backend}'", err=True)
|
|
96
79
|
raise typer.Exit(code=1)
|
machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/cli_share_terminal.py
RENAMED
|
@@ -46,6 +46,7 @@ def share_terminal(
|
|
|
46
46
|
port: Annotated[Optional[int], typer.Option("--port", "-p", help="Port to run the terminal server on (default: 7681)")] = None,
|
|
47
47
|
username: Annotated[Optional[str], typer.Option("--username", "-u", help="Username for terminal access (default: current user)")] = None,
|
|
48
48
|
password: Annotated[Optional[str], typer.Option("--password", "-w", help="Password for terminal access (default: from ~/dotfiles/creds/passwords/quick_password)")] = None,
|
|
49
|
+
no_auth: Annotated[bool, typer.Option("--no-auth", "-n", help="Disable authentication (not recommended)")] = False,
|
|
49
50
|
start_command: Annotated[Optional[str], typer.Option("--start-command", "-s", help="Command to run on terminal start (default: bash/powershell)")] = None,
|
|
50
51
|
ssl: Annotated[bool, typer.Option("--ssl", "-S", help="Enable SSL")] = False,
|
|
51
52
|
ssl_cert: Annotated[Optional[str], typer.Option("--ssl-cert", "-C", help="SSL certificate file path")] = None,
|
|
@@ -61,12 +62,14 @@ def share_terminal(
|
|
|
61
62
|
if username is None:
|
|
62
63
|
import getpass
|
|
63
64
|
username = getpass.getuser()
|
|
64
|
-
if password is None:
|
|
65
|
+
if password is None and not no_auth:
|
|
65
66
|
pwd_path = Path.home().joinpath("dotfiles/creds/passwords/quick_password")
|
|
66
67
|
if pwd_path.exists():
|
|
67
68
|
password = pwd_path.read_text(encoding="utf-8").strip()
|
|
68
69
|
else:
|
|
69
|
-
raise ValueError("Password not provided and default password file does not exist.")
|
|
70
|
+
# raise ValueError("Password not provided and default password file does not exist.")
|
|
71
|
+
print("❌ Error: Password not provided and default password file does not exist.")
|
|
72
|
+
raise typer.Exit(code=1)
|
|
70
73
|
|
|
71
74
|
if port is None:
|
|
72
75
|
port = 7681 # Default port for ttyd
|
|
@@ -83,14 +86,17 @@ def share_terminal(
|
|
|
83
86
|
key_path = Path(ssl_key)
|
|
84
87
|
|
|
85
88
|
if not cert_path.exists():
|
|
86
|
-
|
|
89
|
+
print(f"❌ Error: SSL certificate file not found: {ssl_cert}")
|
|
90
|
+
raise typer.Exit(code=1)
|
|
87
91
|
if not key_path.exists():
|
|
88
|
-
|
|
92
|
+
print(f"❌ Error: SSL key file not found: {ssl_key}")
|
|
93
|
+
raise typer.Exit(code=1)
|
|
89
94
|
|
|
90
95
|
if ssl_ca and not Path(ssl_ca).exists():
|
|
91
|
-
|
|
96
|
+
print(f"❌ Error: SSL CA file not found: {ssl_ca}")
|
|
97
|
+
raise typer.Exit(code=1)
|
|
92
98
|
|
|
93
|
-
import machineconfig.scripts.python.helpers_network.address as helper
|
|
99
|
+
import machineconfig.scripts.python.helpers.helpers_network.address as helper
|
|
94
100
|
res = helper.select_lan_ipv4(prefer_vpn=False)
|
|
95
101
|
if res is None:
|
|
96
102
|
print("❌ Error: Could not determine local LAN IPv4 address for terminal.")
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import typer
|
|
2
|
+
from typing import Optional, Annotated
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def install_ssh_server() -> None:
|
|
6
|
+
"""📡 Install SSH server"""
|
|
7
|
+
import platform
|
|
8
|
+
if platform.system() == "Windows":
|
|
9
|
+
script = _get_windows_ssh_server_install_script()
|
|
10
|
+
elif platform.system() == "Linux" or platform.system() == "Darwin":
|
|
11
|
+
script = """
|
|
12
|
+
sudo nala install openssh-server -y || true # try to install first
|
|
13
|
+
# sudo nala purge openssh-server -y
|
|
14
|
+
# sudo nala install openssh-server -y
|
|
15
|
+
echo "✅ FINISHED installing openssh-server."
|
|
16
|
+
"""
|
|
17
|
+
else:
|
|
18
|
+
print(f"❌ Error: Platform {platform.system()} is not supported.")
|
|
19
|
+
raise typer.Exit(code=1)
|
|
20
|
+
from machineconfig.utils.code import run_shell_script
|
|
21
|
+
run_shell_script(script=script, display_script=True, clean_env=False)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def change_ssh_port(port: Annotated[int, typer.Option(..., "--port", "-p", help="SSH port to use")] = 2222) -> None:
|
|
25
|
+
"""🔌 Change SSH port (Linux/WSL only, default: 2222)"""
|
|
26
|
+
import platform
|
|
27
|
+
if platform.system() != "Linux":
|
|
28
|
+
print("❌ Error: change_ssh_port requires Linux environment")
|
|
29
|
+
raise typer.Exit(code=1)
|
|
30
|
+
from machineconfig.utils.ssh_utils.wsl import change_ssh_port as _change_ssh_port
|
|
31
|
+
_change_ssh_port(port=port)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _get_windows_ssh_server_install_script(use_winget: bool = True) -> str:
|
|
35
|
+
install_winget = r'''
|
|
36
|
+
Write-Host "Installing OpenSSH via winget..." -ForegroundColor Cyan
|
|
37
|
+
winget install --no-upgrade --Id Microsoft.OpenSSH.Preview --source winget --accept-package-agreements --accept-source-agreements
|
|
38
|
+
$wingetSshPath = "C:\Program Files\OpenSSH"
|
|
39
|
+
$currentMachinePath = [System.Environment]::GetEnvironmentVariable("Path", "Machine")
|
|
40
|
+
if ($currentMachinePath -notlike "*$wingetSshPath*") {
|
|
41
|
+
Write-Host "Adding OpenSSH to system PATH..." -ForegroundColor Yellow
|
|
42
|
+
[System.Environment]::SetEnvironmentVariable("Path", "$currentMachinePath;$wingetSshPath", "Machine")
|
|
43
|
+
}
|
|
44
|
+
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
|
45
|
+
'''
|
|
46
|
+
install_capability = r'''
|
|
47
|
+
Write-Host "Installing OpenSSH via Windows Capability..." -ForegroundColor Cyan
|
|
48
|
+
Add-WindowsCapability -Online -Name OpenSSH.Server
|
|
49
|
+
Add-WindowsCapability -Online -Name OpenSSH.Client
|
|
50
|
+
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
|
|
51
|
+
'''
|
|
52
|
+
configure_sshd_service = r'''
|
|
53
|
+
$serviceExists = Get-Service -Name sshd -ErrorAction SilentlyContinue
|
|
54
|
+
if (-not $serviceExists) {
|
|
55
|
+
Write-Host "sshd service not found, registering manually..." -ForegroundColor Yellow
|
|
56
|
+
sc.exe create sshd binPath= "$sshdExePath" start= auto
|
|
57
|
+
if ($LASTEXITCODE -ne 0) { throw "Failed to create sshd service" }
|
|
58
|
+
}
|
|
59
|
+
Set-Service -Name sshd -StartupType Automatic
|
|
60
|
+
Start-Service sshd
|
|
61
|
+
Write-Host "sshd service started successfully." -ForegroundColor Green
|
|
62
|
+
'''
|
|
63
|
+
configure_firewall = r'''
|
|
64
|
+
$existingRule = Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue
|
|
65
|
+
if (-not $existingRule) {
|
|
66
|
+
Write-Host "Creating firewall rule for SSH..." -ForegroundColor Yellow
|
|
67
|
+
New-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -DisplayName "OpenSSH SSH Server" -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 -Program $sshdExePath
|
|
68
|
+
} else {
|
|
69
|
+
Write-Host "Firewall rule already exists." -ForegroundColor Green
|
|
70
|
+
}
|
|
71
|
+
'''
|
|
72
|
+
configure_default_shell = r'''
|
|
73
|
+
Write-Host "Configuring default shell for SSH..." -ForegroundColor Cyan
|
|
74
|
+
$shell = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
|
|
75
|
+
if (-not (Test-Path "HKLM:\SOFTWARE\OpenSSH")) { New-Item -Path "HKLM:\SOFTWARE\OpenSSH" -Force | Out-Null }
|
|
76
|
+
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value $shell -PropertyType String -Force | Out-Null
|
|
77
|
+
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShellCommandOption -Value "/c" -PropertyType String -Force | Out-Null
|
|
78
|
+
Write-Host "Default shell set to: $shell" -ForegroundColor Green
|
|
79
|
+
'''
|
|
80
|
+
configure_ssh_agent = r'''
|
|
81
|
+
Write-Host "Configuring ssh-agent service..." -ForegroundColor Cyan
|
|
82
|
+
$agentService = Get-Service -Name ssh-agent -ErrorAction SilentlyContinue
|
|
83
|
+
if ($agentService) {
|
|
84
|
+
Set-Service -Name ssh-agent -StartupType Automatic
|
|
85
|
+
Start-Service ssh-agent -ErrorAction SilentlyContinue
|
|
86
|
+
Write-Host "ssh-agent service configured and started." -ForegroundColor Green
|
|
87
|
+
} else {
|
|
88
|
+
Write-Host "ssh-agent service not available." -ForegroundColor Yellow
|
|
89
|
+
}
|
|
90
|
+
'''
|
|
91
|
+
ensure_ssh_directory = r'''
|
|
92
|
+
$sshDir = Join-Path $env:USERPROFILE ".ssh"
|
|
93
|
+
if (-not (Test-Path $sshDir)) {
|
|
94
|
+
New-Item -ItemType Directory -Path $sshDir -Force | Out-Null
|
|
95
|
+
Write-Host "Created .ssh directory at: $sshDir" -ForegroundColor Green
|
|
96
|
+
}
|
|
97
|
+
'''
|
|
98
|
+
if use_winget:
|
|
99
|
+
install_method = install_winget
|
|
100
|
+
sshd_exe_path = r'C:\Program Files\OpenSSH\sshd.exe'
|
|
101
|
+
else:
|
|
102
|
+
install_method = install_capability
|
|
103
|
+
sshd_exe_path = r'$env:WINDIR\System32\OpenSSH\sshd.exe'
|
|
104
|
+
return fr'''
|
|
105
|
+
$ErrorActionPreference = "Stop"
|
|
106
|
+
try {{ Set-ExecutionPolicy -Scope CurrentUser Bypass -ErrorAction SilentlyContinue }} catch {{ }}
|
|
107
|
+
Write-Host "========================================" -ForegroundColor Magenta
|
|
108
|
+
Write-Host "OpenSSH Server Installation for Windows" -ForegroundColor Magenta
|
|
109
|
+
Write-Host "========================================" -ForegroundColor Magenta
|
|
110
|
+
{install_method}
|
|
111
|
+
$sshdExePath = "{sshd_exe_path}"
|
|
112
|
+
{configure_sshd_service}
|
|
113
|
+
{configure_firewall}
|
|
114
|
+
{configure_default_shell}
|
|
115
|
+
{configure_ssh_agent}
|
|
116
|
+
{ensure_ssh_directory}
|
|
117
|
+
Write-Host "========================================" -ForegroundColor Magenta
|
|
118
|
+
Write-Host "OpenSSH Server installation complete!" -ForegroundColor Green
|
|
119
|
+
Write-Host "SSH config directory: $env:ProgramData\ssh" -ForegroundColor Cyan
|
|
120
|
+
Write-Host "========================================" -ForegroundColor Magenta
|
|
121
|
+
'''
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def add_ssh_key(
|
|
125
|
+
path: Annotated[Optional[str], typer.Option(..., help="Path to the public key file")] = None,
|
|
126
|
+
choose: Annotated[bool, typer.Option(..., "--choose", "-c", help="Choose from available public keys in ~/.ssh/*.pub")] = False,
|
|
127
|
+
value: Annotated[bool, typer.Option(..., "--value", "-v", help="Paste the public key content manually")] = False,
|
|
128
|
+
github: Annotated[Optional[str], typer.Option(..., "--github", "-g", help="Fetch public keys from a GitHub username")] = None,
|
|
129
|
+
) -> None:
|
|
130
|
+
"""🔑 Add SSH public key to this machine so its accessible by owner of corresponding private key."""
|
|
131
|
+
import machineconfig.scripts.python.helpers.helpers_network.ssh_add_ssh_key as helper
|
|
132
|
+
helper.main(pub_path=path, pub_choose=choose, pub_val=value, from_github=github)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def add_ssh_identity() -> None:
|
|
136
|
+
"""🗝️ Add SSH identity (private key) to this machine"""
|
|
137
|
+
import machineconfig.scripts.python.helpers.helpers_network.ssh_add_identity as helper
|
|
138
|
+
helper.main()
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def debug_ssh() -> None:
|
|
142
|
+
"""🐛 Debug SSH connection"""
|
|
143
|
+
from platform import system
|
|
144
|
+
if system() == "Linux" or system() == "Darwin":
|
|
145
|
+
import machineconfig.scripts.python.helpers.helpers_network.ssh_debug_linux as helper
|
|
146
|
+
helper.ssh_debug_linux()
|
|
147
|
+
elif system() == "Windows":
|
|
148
|
+
import machineconfig.scripts.python.helpers.helpers_network.ssh_debug_windows as helper
|
|
149
|
+
helper.ssh_debug_windows()
|
|
150
|
+
else:
|
|
151
|
+
print(f"❌ Error: Platform {system()} is not supported.")
|
|
152
|
+
raise typer.Exit(code=1)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def get_app() -> typer.Typer:
|
|
156
|
+
ssh_app = typer.Typer(help="🔐 SSH subcommands", no_args_is_help=True, add_help_option=True, add_completion=False)
|
|
157
|
+
ssh_app.command(name="install-server", help="📡 [i] Install SSH server")(install_ssh_server)
|
|
158
|
+
ssh_app.command(name="i", help="Install SSH server", hidden=True)(install_ssh_server)
|
|
159
|
+
ssh_app.command(name="change-port", help="🔌 [p] Change SSH port (Linux/WSL only)")(change_ssh_port)
|
|
160
|
+
ssh_app.command(name="p", help="Change SSH port", hidden=True)(change_ssh_port)
|
|
161
|
+
ssh_app.command(name="add-key", help="🔑 [k] Add SSH public key to this machine", no_args_is_help=True)(add_ssh_key)
|
|
162
|
+
ssh_app.command(name="k", help="Add SSH public key to this machine", hidden=True, no_args_is_help=True)(add_ssh_key)
|
|
163
|
+
ssh_app.command(name="add-identity", help="🗝️ [A] Add SSH identity (private key) to this machine")(add_ssh_identity)
|
|
164
|
+
ssh_app.command(name="A", help="Add SSH identity (private key) to this machine", hidden=True)(add_ssh_identity)
|
|
165
|
+
ssh_app.command(name="debug", help="🐛 [d] Debug SSH connection")(debug_ssh)
|
|
166
|
+
ssh_app.command(name="d", help="Debug SSH connection", hidden=True)(debug_ssh)
|
|
167
|
+
return ssh_app
|
|
@@ -11,7 +11,7 @@ from rich.table import Table
|
|
|
11
11
|
from rich.text import Text
|
|
12
12
|
|
|
13
13
|
from machineconfig.utils.path_extended import PathExtended
|
|
14
|
-
from machineconfig.utils.source_of_truth import CONFIG_ROOT, DEFAULTS_PATH
|
|
14
|
+
from machineconfig.utils.source_of_truth import CONFIG_ROOT, DEFAULTS_PATH
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
console = Console()
|
|
@@ -137,7 +137,7 @@ def _check_config_files_status() -> dict[str, Any]:
|
|
|
137
137
|
from machineconfig.profile.create_links import read_mapper
|
|
138
138
|
|
|
139
139
|
try:
|
|
140
|
-
mapper = read_mapper()
|
|
140
|
+
mapper = read_mapper(repo="library")
|
|
141
141
|
public_configs = list(mapper.get("public", {}).keys())
|
|
142
142
|
private_configs = list(mapper.get("private", {}).keys())
|
|
143
143
|
|
|
@@ -205,10 +205,16 @@ def _check_backup_config() -> dict[str, Any]:
|
|
|
205
205
|
cloud_config = "Not configured"
|
|
206
206
|
|
|
207
207
|
try:
|
|
208
|
-
|
|
208
|
+
from machineconfig.scripts.python.helpers.helpers_devops.backup_config import LIBRARY_BACKUP_PATH
|
|
209
|
+
backup_file = LIBRARY_BACKUP_PATH
|
|
209
210
|
if backup_file.exists():
|
|
210
211
|
backup_data = tomllib.loads(backup_file.read_text(encoding="utf-8"))
|
|
211
|
-
backup_items =
|
|
212
|
+
backup_items: list[str] = []
|
|
213
|
+
for group_name, entries in backup_data.items():
|
|
214
|
+
if isinstance(entries, dict):
|
|
215
|
+
backup_items.extend([f"{group_name}.{entry_name}" for entry_name in entries.keys()])
|
|
216
|
+
else:
|
|
217
|
+
backup_items.append(str(group_name))
|
|
212
218
|
backup_items_count = len(backup_items)
|
|
213
219
|
else:
|
|
214
220
|
backup_items = []
|
|
@@ -466,8 +472,8 @@ def main() -> None:
|
|
|
466
472
|
console.print("\n")
|
|
467
473
|
|
|
468
474
|
# system_info = _check_system_info()
|
|
469
|
-
# from machineconfig.scripts.python.helpers_devops.devops_system_info import _check_system_info
|
|
470
|
-
from machineconfig.scripts.python.helpers_utils.
|
|
475
|
+
# from machineconfig.scripts.python.helpers.helpers_devops.devops_system_info import _check_system_info
|
|
476
|
+
from machineconfig.scripts.python.helpers.helpers_utils.python import get_machine_specs
|
|
471
477
|
system_info = get_machine_specs()
|
|
472
478
|
from typing import cast
|
|
473
479
|
system_info = cast(dict[str, str], system_info)
|
machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/devops_update_repos.py
RENAMED
|
@@ -9,7 +9,7 @@ from rich.panel import Panel
|
|
|
9
9
|
from rich.table import Table
|
|
10
10
|
from rich.text import Text
|
|
11
11
|
|
|
12
|
-
from machineconfig.scripts.python.helpers_repos.update import RepositoryUpdateResult, run_uv_sync, update_repository
|
|
12
|
+
from machineconfig.scripts.python.helpers.helpers_repos.update import RepositoryUpdateResult, run_uv_sync, update_repository
|
|
13
13
|
from machineconfig.utils.io import read_ini
|
|
14
14
|
from machineconfig.utils.source_of_truth import DEFAULTS_PATH
|
|
15
15
|
|