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