machineconfig 6.82__py3-none-any.whl → 7.98__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/cloud_manager.py +1 -1
- machineconfig/cluster/sessions_managers/utils/maker.py +25 -13
- machineconfig/cluster/sessions_managers/wt_local.py +16 -221
- machineconfig/cluster/sessions_managers/wt_local_manager.py +55 -193
- machineconfig/cluster/sessions_managers/wt_remote_manager.py +42 -198
- machineconfig/cluster/sessions_managers/wt_utils/manager_persistence.py +52 -0
- machineconfig/cluster/sessions_managers/wt_utils/monitoring_helpers.py +50 -0
- machineconfig/cluster/sessions_managers/wt_utils/status_reporting.py +76 -0
- machineconfig/cluster/sessions_managers/wt_utils/wt_helpers.py +199 -0
- 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/custom/boxes.py +2 -2
- machineconfig/jobs/installer/custom/hx.py +75 -18
- machineconfig/jobs/installer/custom/yazi.py +119 -0
- machineconfig/jobs/installer/custom_dev/brave.py +5 -3
- machineconfig/jobs/installer/custom_dev/cloudflare_warp_cli.py +23 -0
- machineconfig/jobs/installer/custom_dev/code.py +4 -1
- machineconfig/jobs/installer/custom_dev/dubdb_adbc.py +1 -1
- machineconfig/jobs/installer/custom_dev/nerdfont.py +1 -1
- machineconfig/jobs/installer/custom_dev/nerfont_windows_helper.py +27 -22
- machineconfig/jobs/installer/custom_dev/sysabc.py +139 -0
- machineconfig/jobs/installer/custom_dev/wezterm.py +2 -19
- machineconfig/jobs/installer/custom_dev/winget.py +10 -14
- machineconfig/jobs/installer/installer_data.json +1287 -216
- machineconfig/jobs/installer/linux_scripts/q.sh +10 -7
- machineconfig/jobs/installer/linux_scripts/redis.sh +1 -0
- machineconfig/jobs/installer/package_groups.py +58 -89
- machineconfig/jobs/installer/powershell_scripts/install_fonts.ps1 +129 -34
- machineconfig/logger.py +0 -1
- machineconfig/profile/create_helper.py +43 -16
- machineconfig/profile/create_links.py +2 -1
- machineconfig/profile/create_links_export.py +64 -18
- machineconfig/profile/create_shell_profile.py +78 -127
- machineconfig/profile/mapper.toml +15 -8
- machineconfig/scripts/__init__.py +0 -4
- machineconfig/scripts/linux/wrap_mcfg +46 -0
- machineconfig/scripts/nu/wrap_mcfg.nu +69 -0
- machineconfig/scripts/python/agents.py +52 -37
- 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/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/ai/{vscode_tasks.py → utils/vscode_tasks.py} +7 -2
- machineconfig/scripts/python/croshell.py +77 -78
- machineconfig/scripts/python/devops.py +39 -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 +84 -115
- machineconfig/scripts/python/ftpx.py +42 -16
- 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/run_py_script.py +79 -0
- machineconfig/scripts/python/helpers/symantic_search.py +25 -0
- machineconfig/scripts/python/helpers/tmp_py_scripts/a.py +26 -0
- machineconfig/scripts/python/{helpers_fire → helpers_agents}/agentic_frameworks/fire_crush.json +1 -1
- machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_crush.py +39 -0
- machineconfig/scripts/python/{helpers_fire → helpers_agents}/agentic_frameworks/fire_cursor_agents.py +3 -4
- machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_gemini.py +55 -0
- machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_qwen.py +30 -0
- machineconfig/scripts/python/{helpers_fire → helpers_agents}/fire_agents_help_launch.py +32 -13
- machineconfig/scripts/python/{helpers_fire → helpers_agents}/fire_agents_helper_types.py +11 -14
- machineconfig/scripts/python/helpers_agents/templates/prompt.txt +10 -0
- machineconfig/scripts/python/helpers_agents/templates/template.sh +32 -0
- 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 +46 -61
- machineconfig/scripts/python/helpers_devops/cli_config_dotfile.py +67 -55
- machineconfig/scripts/python/helpers_devops/cli_nw.py +157 -16
- machineconfig/scripts/python/helpers_devops/cli_repos.py +55 -21
- machineconfig/scripts/python/helpers_devops/cli_self.py +98 -48
- machineconfig/scripts/python/helpers_devops/cli_share_file.py +137 -0
- machineconfig/scripts/python/helpers_devops/cli_share_server.py +80 -42
- machineconfig/scripts/python/helpers_devops/{cli_terminal.py → cli_share_terminal.py} +15 -17
- machineconfig/scripts/python/helpers_devops/cli_utils.py +3 -128
- 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/themes/choose_wezterm_theme.py +1 -1
- machineconfig/scripts/python/{helpers_fire/helpers4.py → helpers_fire_command/file_wrangler.py} +56 -20
- machineconfig/scripts/python/helpers_fire_command/fire_jobs_route_helper.py +26 -16
- machineconfig/scripts/python/helpers_msearch/__init__.py +5 -0
- machineconfig/scripts/{linux → python/helpers_msearch/scripts_linux}/fzfg +3 -3
- machineconfig/scripts/python/helpers_msearch/scripts_windows/fzfg.ps1 +59 -0
- machineconfig/scripts/python/helpers_navigator/command_tree.py +50 -18
- machineconfig/scripts/python/helpers_network/address.py +132 -0
- machineconfig/scripts/python/{nw → helpers_network}/devops_add_ssh_key.py +24 -5
- machineconfig/scripts/python/{nw → helpers_network}/mount_nfs +0 -1
- 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 → helpers_network}/ssh_debug_linux.py +7 -7
- machineconfig/scripts/python/{nw → helpers_network}/ssh_debug_windows.py +4 -4
- machineconfig/scripts/python/{nw → helpers_network}/wifi_conn.py +1 -53
- machineconfig/scripts/python/{nw → helpers_network}/wsl_windows_transfer.py +3 -2
- machineconfig/scripts/python/helpers_repos/clone.py +0 -1
- machineconfig/scripts/python/helpers_repos/cloud_repo_sync.py +46 -19
- machineconfig/scripts/python/helpers_repos/entrypoint.py +2 -1
- machineconfig/scripts/python/helpers_repos/grource.py +1 -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 +20 -13
- machineconfig/scripts/python/helpers_utils/download.py +150 -0
- machineconfig/scripts/python/helpers_utils/path.py +185 -0
- machineconfig/scripts/python/interactive.py +19 -26
- machineconfig/scripts/python/{mcfg.py → mcfg_entry.py} +10 -0
- machineconfig/scripts/python/msearch.py +71 -0
- machineconfig/scripts/python/sessions.py +94 -25
- machineconfig/scripts/python/terminal.py +133 -0
- machineconfig/scripts/python/utils.py +28 -30
- machineconfig/scripts/windows/mounts/mount_ssh.ps1 +1 -1
- machineconfig/scripts/windows/wrap_mcfg.ps1 +63 -0
- machineconfig/settings/broot/conf.toml +1 -1
- machineconfig/settings/helix/config.toml +16 -0
- machineconfig/settings/helix/languages.toml +13 -4
- machineconfig/settings/helix/yazi-picker.sh +12 -0
- machineconfig/settings/lf/linux/exe/lfcd.sh +1 -0
- machineconfig/settings/lf/linux/exe/previewer.sh +3 -2
- machineconfig/settings/lf/windows/lfcd.ps1 +1 -1
- machineconfig/settings/lf/windows/lfrc +14 -16
- machineconfig/settings/marimo/marimo.toml +1 -1
- machineconfig/settings/marimo/snippets/globalize.py +34 -0
- machineconfig/settings/shells/bash/init.sh +43 -11
- machineconfig/settings/shells/ipy/profiles/default/startup/playext.py +1 -1
- machineconfig/settings/shells/nushell/config.nu +2 -32
- machineconfig/settings/shells/nushell/env.nu +45 -6
- machineconfig/settings/shells/nushell/init.nu +314 -0
- machineconfig/settings/shells/pwsh/init.ps1 +40 -14
- machineconfig/settings/shells/starship/starship.toml +16 -0
- machineconfig/settings/shells/wezterm/wezterm.lua +2 -0
- machineconfig/settings/shells/wt/settings.json +14 -5
- machineconfig/settings/shells/zsh/init.sh +17 -19
- 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/yazi/init.lua +61 -0
- machineconfig/settings/yazi/keymap_linux.toml +94 -0
- machineconfig/settings/yazi/keymap_windows.toml +78 -0
- machineconfig/settings/yazi/shell/yazi_cd.ps1 +33 -0
- machineconfig/settings/yazi/shell/yazi_cd.sh +8 -0
- machineconfig/settings/yazi/theme.toml +4 -0
- machineconfig/settings/yazi/yazi_linux.toml +84 -0
- machineconfig/settings/yazi/yazi_windows.toml +58 -0
- machineconfig/setup_linux/__init__.py +2 -1
- machineconfig/setup_linux/web_shortcuts/interactive.sh +27 -12
- machineconfig/setup_linux/web_shortcuts/live_from_github.sh +31 -0
- machineconfig/setup_mac/__init__.py +2 -3
- machineconfig/setup_mac/apps_gui.sh +248 -0
- machineconfig/setup_windows/__init__.py +3 -3
- machineconfig/setup_windows/uv.ps1 +8 -1
- machineconfig/setup_windows/web_shortcuts/interactive.ps1 +26 -11
- 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 +99 -32
- machineconfig/utils/files/ascii_art.py +1 -1
- machineconfig/utils/files/headers.py +3 -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 +42 -99
- 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 -61
- machineconfig/utils/io.py +69 -1
- machineconfig/utils/links.py +56 -38
- machineconfig/utils/meta.py +33 -18
- machineconfig/utils/options.py +46 -18
- machineconfig/utils/options_tv.py +119 -0
- machineconfig/utils/path_extended.py +44 -95
- machineconfig/utils/path_helper.py +76 -23
- machineconfig/utils/procs.py +1 -1
- machineconfig/utils/scheduler.py +20 -53
- machineconfig/utils/scheduling.py +0 -2
- machineconfig/utils/schemas/fire_agents/fire_agents_input.py +1 -1
- machineconfig/utils/schemas/layouts/layout_types.py +1 -1
- machineconfig/utils/ssh.py +159 -412
- 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 +302 -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 +104 -28
- machineconfig/utils/ve.py +12 -4
- machineconfig-7.98.dist-info/METADATA +132 -0
- {machineconfig-6.82.dist-info → machineconfig-7.98.dist-info}/RECORD +259 -196
- {machineconfig-6.82.dist-info → machineconfig-7.98.dist-info}/entry_points.txt +4 -1
- 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/scripts/linux/fzf2g +0 -21
- machineconfig/scripts/linux/fzfag +0 -17
- machineconfig/scripts/linux/fzffg +0 -25
- machineconfig/scripts/linux/fzfrga +0 -21
- machineconfig/scripts/linux/mcfgs +0 -38
- machineconfig/scripts/linux/other/share_smb +0 -1
- machineconfig/scripts/linux/skrg +0 -4
- machineconfig/scripts/linux/warp-cli.sh +0 -122
- machineconfig/scripts/linux/z_ls +0 -104
- machineconfig/scripts/python/ai/command_runner/prompt.txt +0 -9
- machineconfig/scripts/python/helpers_fire/agentic_frameworks/fire_crush.py +0 -37
- machineconfig/scripts/python/helpers_fire/agentic_frameworks/fire_gemini.py +0 -44
- machineconfig/scripts/python/helpers_fire/agentic_frameworks/fire_qwen.py +0 -43
- machineconfig/scripts/python/helpers_fire/prompt.txt +0 -2
- machineconfig/scripts/python/helpers_fire/template.sh +0 -15
- machineconfig/scripts/python/helpers_repos/count_lines_frontend.py +0 -17
- machineconfig/scripts/python/helpers_repos/secure_repo.py +0 -15
- machineconfig/scripts/python/nw/add_ssh_key.py +0 -148
- machineconfig/scripts/windows/fzfb.ps1 +0 -3
- machineconfig/scripts/windows/fzfg.ps1 +0 -2
- machineconfig/scripts/windows/fzfrga.bat +0 -20
- machineconfig/scripts/windows/mcfgs.ps1 +0 -17
- 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 -4
- machineconfig/setup_linux/apps.sh +0 -66
- machineconfig/setup_linux/others/cli_installation.sh +0 -137
- machineconfig/setup_mac/apps.sh +0 -73
- machineconfig/setup_windows/apps.ps1 +0 -62
- machineconfig/utils/installer_utils/installer.py +0 -225
- machineconfig-6.82.dist-info/METADATA +0 -82
- /machineconfig/jobs/installer/linux_scripts/{warp-cli.sh → cloudflare_warp_cli.sh} +0 -0
- /machineconfig/scripts/python/{helpers_fire → ai/utils}/__init__.py +0 -0
- /machineconfig/scripts/python/{helpers_fire/agentic_frameworks → helpers_agents}/__init__.py +0 -0
- /machineconfig/scripts/python/{nw → helpers_agents/agentic_frameworks}/__init__.py +0 -0
- /machineconfig/scripts/python/{helpers_fire → helpers_agents}/fire_agents_help_search.py +0 -0
- /machineconfig/scripts/python/{helpers_fire → helpers_agents}/fire_agents_load_balancer.py +0 -0
- /machineconfig/scripts/python/{helpers_fire → helpers_agents/templates}/template.ps1 +0 -0
- /machineconfig/{settings/shells/pwsh/profile.ps1 → scripts/python/helpers_fire_command/f.py} +0 -0
- /machineconfig/{settings/yazi/keymap.toml → scripts/python/helpers_network/__init__.py} +0 -0
- /machineconfig/scripts/python/{nw → helpers_network}/devops_add_identity.py +0 -0
- /machineconfig/scripts/python/{nw → helpers_network}/mount_drive +0 -0
- /machineconfig/scripts/python/{nw → helpers_network}/mount_nw_drive +0 -0
- /machineconfig/scripts/python/{nw → helpers_network}/mount_nw_drive.py +0 -0
- /machineconfig/scripts/python/{nw → helpers_network}/mount_smb +0 -0
- /machineconfig/scripts/python/{nw → helpers_network}/onetimeshare.py +0 -0
- /machineconfig/scripts/{Restore-ThunderbirdProfile.ps1 → windows/mounts/Restore-ThunderbirdProfile.ps1} +0 -0
- /machineconfig/{jobs/installer/powershell_scripts → setup_windows/ssh}/openssh-server_add_key.ps1 +0 -0
- /machineconfig/{jobs/installer/powershell_scripts → setup_windows/ssh}/openssh-server_copy-ssh-id.ps1 +0 -0
- {machineconfig-6.82.dist-info → machineconfig-7.98.dist-info}/WHEEL +0 -0
- {machineconfig-6.82.dist-info → machineconfig-7.98.dist-info}/top_level.txt +0 -0
|
@@ -1,55 +1,24 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
from typing import Literal, Annotated
|
|
3
|
+
from typing import Literal, Annotated
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
import typer
|
|
6
|
+
import machineconfig.scripts.python.helpers_devops.cli_config_dotfile as dotfile_module
|
|
7
|
+
import machineconfig.profile.create_links_export as create_links_export
|
|
6
8
|
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
def private(method: Annotated[Literal["symlink", "copy"], typer.Option(..., "--method", "-m", help="Method to use for linking files")],
|
|
10
|
-
on_conflict: Annotated[Literal["throwError", "overwriteSelfManaged", "backupSelfManaged", "overwriteDefaultPath", "backupDefaultPath"], typer.Option(..., "--on-conflict", "-o", help="Action to take on conflict")] = "throwError",
|
|
11
|
-
which: Annotated[Optional[str], typer.Option(..., "--which", "-w", help="Specific items to process")] = None,
|
|
12
|
-
interactive: Annotated[bool, typer.Option(..., "--interactive", "-ia", help="Run in interactive mode")] = False):
|
|
13
|
-
"""🔗 Manage private configuration files."""
|
|
14
|
-
import machineconfig.profile.create_links_export as create_links_export
|
|
15
|
-
create_links_export.main_private_from_parser(method=method, on_conflict=on_conflict, which=which, interactive=interactive)
|
|
16
|
-
|
|
17
|
-
def public(method: Annotated[Literal["symlink", "copy"], typer.Option(..., "--method", "-m", help="Method to use for setting up the config file.")],
|
|
18
|
-
on_conflict: Annotated[Literal["throwError", "overwriteDefaultPath", "backupDefaultPath"], typer.Option(..., "--on-conflict", "-o", help="Action to take on conflict")] = "throwError",
|
|
19
|
-
which: Annotated[Optional[str], typer.Option(..., "--which", "-w", help="Specific items to process")] = None,
|
|
20
|
-
interactive: Annotated[bool, typer.Option(..., "--interactive", "-ia", help="Run in interactive mode")] = False):
|
|
21
|
-
"""🔗 Manage public configuration files."""
|
|
22
|
-
import machineconfig.profile.create_links_export as create_links_export
|
|
23
|
-
create_links_export.main_public_from_parser(method=method, on_conflict=on_conflict, which=which, interactive=interactive)
|
|
24
|
-
|
|
25
|
-
def dotfile(file: Annotated[str, typer.Argument(help="file/folder path.")],
|
|
26
|
-
overwrite: Annotated[bool, typer.Option("--overwrite", "-o", help="Overwrite.")] = False,
|
|
27
|
-
dest: Annotated[str, typer.Option("--dest", "-d", help="destination folder")] = "",
|
|
28
|
-
):
|
|
29
|
-
"""🔗 Manage dotfiles."""
|
|
30
|
-
import machineconfig.scripts.python.helpers_devops.cli_config_dotfile as dotfile_module
|
|
31
|
-
dotfile_module.main(file=file, overwrite=overwrite, dest=dest)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
def shell():
|
|
10
|
+
def configure_shell_profile(which: Annotated[Literal["default", "d", "nushell", "n"], typer.Option(..., "--which", "-w", help="Which shell profile to create/configure")]="default"):
|
|
35
11
|
"""🔗 Configure your shell profile."""
|
|
36
|
-
from machineconfig.profile.create_shell_profile import create_default_shell_profile
|
|
37
|
-
|
|
38
|
-
|
|
12
|
+
from machineconfig.profile.create_shell_profile import create_default_shell_profile, create_nu_shell_profile
|
|
13
|
+
match which:
|
|
14
|
+
case "nushell" | "n":
|
|
15
|
+
create_nu_shell_profile()
|
|
16
|
+
return
|
|
17
|
+
case "default" | "d":
|
|
18
|
+
create_default_shell_profile()
|
|
19
|
+
return
|
|
20
|
+
typer.echo(f"[red]Error:[/] Unknown shell profile type: {which}")
|
|
39
21
|
|
|
40
|
-
def path():
|
|
41
|
-
"""📚 NAVIGATE PATH variable with TUI"""
|
|
42
|
-
from machineconfig.scripts.python import env_manager as navigator
|
|
43
|
-
from pathlib import Path
|
|
44
|
-
path = Path(navigator.__file__).resolve().parent.joinpath("path_manager_tui.py")
|
|
45
|
-
from machineconfig.utils.code import run_shell_script, get_uv_command_executing_python_script
|
|
46
|
-
uv_with = ["textual"]
|
|
47
|
-
uv_project_dir = None
|
|
48
|
-
if not Path.home().joinpath("code/machineconfig").exists():
|
|
49
|
-
uv_with.append("machineconfig>=6.81")
|
|
50
|
-
else:
|
|
51
|
-
uv_project_dir = str(Path.home().joinpath("code/machineconfig"))
|
|
52
|
-
run_shell_script(get_uv_command_executing_python_script(python_script=path.read_text(encoding="utf-8"), uv_with=uv_with, uv_project_dir=uv_project_dir)[0])
|
|
53
22
|
|
|
54
23
|
|
|
55
24
|
def pwsh_theme():
|
|
@@ -59,6 +28,7 @@ def pwsh_theme():
|
|
|
59
28
|
import subprocess
|
|
60
29
|
subprocess.run(["pwsh", "-File", str(file)])
|
|
61
30
|
|
|
31
|
+
|
|
62
32
|
def starship_theme():
|
|
63
33
|
"""🔗 Select starship prompt theme."""
|
|
64
34
|
import subprocess
|
|
@@ -87,34 +57,49 @@ def starship_theme():
|
|
|
87
57
|
except ValueError:
|
|
88
58
|
typer.echo("❌ Please enter a valid number")
|
|
89
59
|
|
|
90
|
-
|
|
60
|
+
|
|
61
|
+
def copy_assets(which: Annotated[Literal["scripts", "s", "settings", "t", "both", "b"], typer.Argument(..., help="Which assets to copy")]):
|
|
91
62
|
"""🔗 Copy asset files from library to machine."""
|
|
92
63
|
import machineconfig.profile.create_helper as create_helper
|
|
93
64
|
match which:
|
|
94
|
-
case "both":
|
|
65
|
+
case "both" | "b":
|
|
66
|
+
create_helper.copy_assets_to_machine(which="scripts")
|
|
67
|
+
create_helper.copy_assets_to_machine(which="settings")
|
|
68
|
+
return
|
|
69
|
+
case "scripts" | "s":
|
|
95
70
|
create_helper.copy_assets_to_machine(which="scripts")
|
|
71
|
+
return
|
|
72
|
+
case "settings" | "t":
|
|
96
73
|
create_helper.copy_assets_to_machine(which="settings")
|
|
97
|
-
|
|
98
|
-
|
|
74
|
+
return
|
|
75
|
+
typer.echo(f"[red]Error:[/] Unknown asset type: {which}")
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def link_wsl_and_windows_home():
|
|
79
|
+
"""🔗 Link WSL home and Windows home directories."""
|
|
80
|
+
import machineconfig.utils.ssh_utils.wsl as wsl_utils
|
|
81
|
+
wsl_utils.link_wsl_and_windows()
|
|
99
82
|
|
|
100
83
|
|
|
101
84
|
def get_app():
|
|
102
85
|
config_apps = typer.Typer(help="⚙️ [c] configuration subcommands", no_args_is_help=True, add_help_option=False, add_completion=False)
|
|
103
|
-
config_apps.command("private", no_args_is_help=True, help="🔗
|
|
104
|
-
config_apps.command("v", no_args_is_help=True, hidden=True)(
|
|
105
|
-
config_apps.command("public", no_args_is_help=True, help="🔗
|
|
106
|
-
config_apps.command("b", no_args_is_help=True, help="Manage public configuration files.", hidden=True)(
|
|
107
|
-
config_apps.command("dotfile", no_args_is_help=True, help="🔗
|
|
108
|
-
config_apps.command("d", no_args_is_help=True, hidden=True)(
|
|
109
|
-
config_apps.command("shell", no_args_is_help=False, help="🔗
|
|
110
|
-
config_apps.command("s", no_args_is_help=False, help="Configure your shell profile.", hidden=True)(
|
|
111
|
-
config_apps.command("
|
|
112
|
-
config_apps.command("p", no_args_is_help=False, help="NAVIGATE PATH variable with TUI", hidden=True)(path)
|
|
113
|
-
config_apps.command("starship-theme", no_args_is_help=False, help="🔗 [t] Select starship prompt theme.")(starship_theme)
|
|
86
|
+
config_apps.command("private", no_args_is_help=True, help="🔗 [v] Manage private configuration files.")(create_links_export.main_private_from_parser)
|
|
87
|
+
config_apps.command("v", no_args_is_help=True, hidden=True)(create_links_export.main_private_from_parser)
|
|
88
|
+
config_apps.command("public", no_args_is_help=True, help="🔗 [b] Manage public configuration files.")(create_links_export.main_public_from_parser)
|
|
89
|
+
config_apps.command("b", no_args_is_help=True, help="Manage public configuration files.", hidden=True)(create_links_export.main_public_from_parser)
|
|
90
|
+
config_apps.command("dotfile", no_args_is_help=True, help="🔗 [d] Manage dotfiles.")(dotfile_module.main)
|
|
91
|
+
config_apps.command("d", no_args_is_help=True, hidden=True)(dotfile_module.main)
|
|
92
|
+
config_apps.command("shell", no_args_is_help=False, help="🔗 [s] Configure your shell profile.")(configure_shell_profile)
|
|
93
|
+
config_apps.command("s", no_args_is_help=False, help="Configure your shell profile.", hidden=True)(configure_shell_profile)
|
|
94
|
+
config_apps.command("starship-theme", no_args_is_help=False, help="🔗 [t] Select starship prompt theme.")(starship_theme)
|
|
114
95
|
config_apps.command("t", no_args_is_help=False, help="Select starship prompt theme.", hidden=True)(starship_theme)
|
|
115
|
-
config_apps.command("pwsh-theme", no_args_is_help=False, help="🔗
|
|
96
|
+
config_apps.command("pwsh-theme", no_args_is_help=False, help="🔗 [T] Select powershell prompt theme.")(pwsh_theme)
|
|
116
97
|
config_apps.command("T", no_args_is_help=False, help="Select powershell prompt theme.", hidden=True)(pwsh_theme)
|
|
117
98
|
|
|
118
|
-
config_apps.command("copy-assets", no_args_is_help=True, help="🔗
|
|
99
|
+
config_apps.command("copy-assets", no_args_is_help=True, help="🔗 [c] Copy asset files from library to machine.", hidden=False)(copy_assets)
|
|
119
100
|
config_apps.command("c", no_args_is_help=True, help="Copy asset files from library to machine.", hidden=True)(copy_assets)
|
|
101
|
+
|
|
102
|
+
config_apps.command("link-wsl-windows", no_args_is_help=False, help="🔗 [l] Link WSL home and Windows home directories.", hidden=False)(link_wsl_and_windows_home)
|
|
103
|
+
config_apps.command("l", no_args_is_help=False, help="Link WSL home and Windows home directories.", hidden=True)(link_wsl_and_windows_home)
|
|
104
|
+
|
|
120
105
|
return config_apps
|
|
@@ -1,72 +1,84 @@
|
|
|
1
|
-
"""Like yadm and dotter."""
|
|
2
1
|
|
|
3
|
-
|
|
2
|
+
"""Like yadm and dotter."""
|
|
4
3
|
|
|
4
|
+
from machineconfig.profile.create_links_export import ON_CONFLICT_LOOSE, ON_CONFLICT_MAPPER
|
|
5
|
+
from typing import Annotated, Literal
|
|
5
6
|
import typer
|
|
6
7
|
|
|
7
8
|
|
|
9
|
+
|
|
8
10
|
def main(
|
|
9
11
|
file: Annotated[str, typer.Argument(help="file/folder path.")],
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
)
|
|
13
|
-
|
|
12
|
+
method: Annotated[Literal["symlink", "s", "copy", "c"], typer.Option(..., "--method", "-m", help="Method to use for linking files")] = "copy",
|
|
13
|
+
on_conflict: Annotated[ON_CONFLICT_LOOSE, typer.Option(..., "--on-conflict", "-o", help="Action to take on conflict")] = "throw-error",
|
|
14
|
+
sensitivity: Annotated[Literal["private", "v", "public", "b"], typer.Option(..., "--sensitivity", "-s", help="Sensitivity of the config file.")] = "private",
|
|
15
|
+
destination: Annotated[str, typer.Option("--destination", "-d", help="destination folder (override the default, use at your own risk)")] = "",
|
|
16
|
+
shared: Annotated[bool, typer.Option("--shared", "-sh", help="Whether the config file is shared across destinations directory.")] = False,
|
|
17
|
+
) -> None:
|
|
14
18
|
from rich.console import Console
|
|
15
19
|
from rich.panel import Panel
|
|
20
|
+
from machineconfig.utils.links import symlink_map, copy_map
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
match sensitivity:
|
|
23
|
+
case "private" | "v":
|
|
24
|
+
backup_root = Path.home().joinpath("dotfiles/mapper")
|
|
25
|
+
case "public" | "b":
|
|
26
|
+
from machineconfig.utils.source_of_truth import CONFIG_ROOT
|
|
27
|
+
backup_root = Path(CONFIG_ROOT).joinpath("dotfiles/mapper")
|
|
16
28
|
|
|
17
|
-
from machineconfig.utils.links import symlink_map
|
|
18
|
-
from machineconfig.utils.path_extended import PathExtended
|
|
19
|
-
from machineconfig.utils.source_of_truth import CONFIG_ROOT
|
|
20
29
|
console = Console()
|
|
21
|
-
orig_path =
|
|
22
|
-
if
|
|
23
|
-
if
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
junction = orig_path.split(at="Roaming", sep=-1)[1]
|
|
27
|
-
elif ".config" in str(orig_path):
|
|
28
|
-
junction = orig_path.split(at=".config", sep=-1)[1]
|
|
30
|
+
orig_path = Path(file).expanduser().absolute()
|
|
31
|
+
if destination == "":
|
|
32
|
+
if shared:
|
|
33
|
+
new_path = backup_root.joinpath("shared").joinpath(orig_path.name)
|
|
34
|
+
new_path.parent.mkdir(parents=True, exist_ok=True)
|
|
29
35
|
else:
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
new_path = backup_root.joinpath(orig_path.relative_to(Path.home()))
|
|
37
|
+
new_path.parent.mkdir(parents=True, exist_ok=True)
|
|
32
38
|
else:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
]
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
f"
|
|
58
|
-
|
|
59
|
-
]
|
|
60
|
-
)
|
|
39
|
+
if shared:
|
|
40
|
+
dest_path = Path(destination).expanduser().absolute()
|
|
41
|
+
dest_path.mkdir(parents=True, exist_ok=True)
|
|
42
|
+
new_path = dest_path.joinpath("shared").joinpath(orig_path.name)
|
|
43
|
+
new_path.parent.mkdir(parents=True, exist_ok=True)
|
|
44
|
+
else:
|
|
45
|
+
dest_path = Path(destination).expanduser().absolute()
|
|
46
|
+
dest_path.mkdir(parents=True, exist_ok=True)
|
|
47
|
+
new_path = dest_path.joinpath(orig_path.name)
|
|
48
|
+
match method:
|
|
49
|
+
case "copy" | "c":
|
|
50
|
+
try:
|
|
51
|
+
copy_map(config_file_default_path=orig_path, self_managed_config_file_path=new_path, on_conflict=ON_CONFLICT_MAPPER[on_conflict]) # type: ignore[arg-type]
|
|
52
|
+
except Exception as e:
|
|
53
|
+
typer.echo(f"[red]Error:[/] {e}")
|
|
54
|
+
typer.Exit(code=1)
|
|
55
|
+
return
|
|
56
|
+
case "symlink" | "s":
|
|
57
|
+
try:
|
|
58
|
+
symlink_map(config_file_default_path=orig_path, self_managed_config_file_path=new_path, on_conflict=ON_CONFLICT_MAPPER[on_conflict]) # type: ignore[arg-type]
|
|
59
|
+
except Exception as e:
|
|
60
|
+
typer.echo(f"[red]Error:[/] {e}")
|
|
61
|
+
typer.Exit(code=1)
|
|
62
|
+
case _:
|
|
63
|
+
raise ValueError(f"Unknown method: {method}")
|
|
64
|
+
console.print(Panel("\n".join(["✅ Symbolic link created successfully!", "🔄 Add the following snippet to mapper.toml to persist this mapping:",]), title="Symlink Created", border_style="green", padding=(1, 2),))
|
|
61
65
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
)
|
|
66
|
+
# mapper_snippet = "\n".join(
|
|
67
|
+
# [
|
|
68
|
+
# f"[bold]📝 Edit configuration file:[/] [cyan]nano {Path(CONFIG_ROOT)}/symlinks/mapper.toml[/cyan]",
|
|
69
|
+
# "",
|
|
70
|
+
# f"[{new_path.parent.name}]",
|
|
71
|
+
# f"{orig_path.name.split('.')[0]} = {{ this = '{orig_path.as_posix()}', to_this = '{new_path.as_posix()}' }}",
|
|
72
|
+
# ]
|
|
73
|
+
# )
|
|
74
|
+
# console.print(
|
|
75
|
+
# Panel(
|
|
76
|
+
# mapper_snippet,
|
|
77
|
+
# title="Mapper Entry",
|
|
78
|
+
# border_style="cyan",
|
|
79
|
+
# padding=(1, 2),
|
|
80
|
+
# )
|
|
81
|
+
# )
|
|
70
82
|
|
|
71
83
|
|
|
72
84
|
def arg_parser() -> None:
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import machineconfig.scripts.python.helpers_devops.
|
|
2
|
+
import machineconfig.scripts.python.helpers_devops.cli_share_file
|
|
3
|
+
import machineconfig.scripts.python.helpers_devops.cli_share_terminal as cli_share_terminal
|
|
3
4
|
import machineconfig.scripts.python.helpers_devops.cli_share_server as cli_share_server
|
|
4
5
|
import typer
|
|
5
6
|
from typing import Optional, Annotated
|
|
@@ -25,41 +26,169 @@ def add_ssh_key(path: Annotated[Optional[str], typer.Option(..., help="Path to t
|
|
|
25
26
|
github: Annotated[Optional[str], typer.Option(..., "--github", "-g", help="Fetch public keys from a GitHub username")] = None
|
|
26
27
|
):
|
|
27
28
|
"""🔑 SSH add pub key to this machine so its accessible by owner of corresponding private key."""
|
|
28
|
-
import machineconfig.scripts.python.
|
|
29
|
+
import machineconfig.scripts.python.helpers_network.devops_add_ssh_key as helper
|
|
29
30
|
helper.main(pub_path=path, pub_choose=choose, pub_val=value, from_github=github)
|
|
30
31
|
def add_ssh_identity():
|
|
31
32
|
"""🗝️ SSH add identity (private key) to this machine"""
|
|
32
|
-
import machineconfig.scripts.python.
|
|
33
|
+
import machineconfig.scripts.python.helpers_network.devops_add_identity as helper
|
|
33
34
|
helper.main()
|
|
34
35
|
|
|
35
36
|
|
|
36
|
-
def show_address():
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
def show_address() -> None:
|
|
38
|
+
"""📌 Show this computer addresses on network"""
|
|
39
|
+
from machineconfig.utils.installer_utils.installer_cli import install_if_missing
|
|
40
|
+
import subprocess
|
|
41
|
+
install_if_missing("ipinfo")
|
|
42
|
+
result = subprocess.run(
|
|
43
|
+
["ipinfo", "myip", "--json"],
|
|
44
|
+
check=True,
|
|
45
|
+
capture_output=True,
|
|
46
|
+
text=True,
|
|
47
|
+
encoding="utf-8",
|
|
48
|
+
)
|
|
49
|
+
import json
|
|
50
|
+
loaded_json = json.loads(result.stdout)
|
|
51
|
+
from rich import print_json
|
|
52
|
+
print_json(data=loaded_json)
|
|
53
|
+
|
|
54
|
+
import machineconfig.scripts.python.helpers_network.address as helper
|
|
55
|
+
from rich.table import Table
|
|
56
|
+
from rich.console import Console
|
|
57
|
+
res = helper.get_all_ipv4_addresses()
|
|
58
|
+
res.append( ("Public IP", loaded_json.get("ip", "N/A")))
|
|
59
|
+
|
|
60
|
+
# loc = loaded_json["loc"]
|
|
61
|
+
# 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"""
|
|
62
|
+
# from machineconfig.utils.code import run_shell_script
|
|
63
|
+
# run_shell_script(script=cmd)
|
|
64
|
+
|
|
65
|
+
table = Table(title="Network Interfaces")
|
|
66
|
+
table.add_column("Interface", style="cyan")
|
|
67
|
+
table.add_column("IP Address", style="green")
|
|
68
|
+
|
|
69
|
+
for iface, ip in res:
|
|
70
|
+
table.add_row(iface, ip)
|
|
71
|
+
|
|
72
|
+
console = Console()
|
|
73
|
+
console.print(table)
|
|
74
|
+
|
|
75
|
+
res = helper.select_lan_ipv4(prefer_vpn=False)
|
|
76
|
+
if res is not None:
|
|
77
|
+
# ip, iface = res
|
|
78
|
+
# print(f"Selected IP: {ip} on interface: {iface}")
|
|
79
|
+
print(f"LAN IPv4: {res}")
|
|
80
|
+
else:
|
|
81
|
+
print("No network interfaces found.")
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def bind_wsl_port(port: Annotated[int, typer.Option(..., "--port", "-p", help="Port number to bind")]):
|
|
86
|
+
code = f"""
|
|
87
|
+
|
|
88
|
+
$wsl_ip = (wsl.exe hostname -I).Trim().Split(' ')[0]
|
|
89
|
+
netsh interface portproxy add v4tov4 listenport={port} listenaddress=0.0.0.0 connectport={port} connectaddress=$wsl_ip
|
|
90
|
+
|
|
91
|
+
"""
|
|
92
|
+
from machineconfig.utils.code import exit_then_run_shell_script
|
|
93
|
+
exit_then_run_shell_script(code)
|
|
43
94
|
|
|
44
95
|
|
|
45
96
|
def debug_ssh():
|
|
46
97
|
"""🐛 SSH debug"""
|
|
47
98
|
from platform import system
|
|
48
99
|
if system() == "Linux" or system() == "Darwin":
|
|
49
|
-
import machineconfig.scripts.python.
|
|
100
|
+
import machineconfig.scripts.python.helpers_network.ssh_debug_linux as helper
|
|
50
101
|
helper.ssh_debug_linux()
|
|
51
102
|
elif system() == "Windows":
|
|
52
|
-
import machineconfig.scripts.python.
|
|
103
|
+
import machineconfig.scripts.python.helpers_network.ssh_debug_windows as helper
|
|
53
104
|
helper.ssh_debug_windows()
|
|
54
105
|
else:
|
|
55
106
|
raise NotImplementedError(f"Platform {system()} is not supported.")
|
|
56
107
|
|
|
108
|
+
def wifi_select(
|
|
109
|
+
ssid: Annotated[str, typer.Option("-n", "--ssid", help="🔗 SSID of WiFi (from config)")] = "MyPhoneHotSpot",
|
|
110
|
+
manual: Annotated[bool, typer.Option("-m", "--manual", help="🔍 Manual network selection mode")] = False,
|
|
111
|
+
list_: Annotated[bool, typer.Option("-l", "--list", help="📡 List available networks only")] = False,
|
|
112
|
+
) -> None:
|
|
113
|
+
"""Main function with fallback network selection"""
|
|
114
|
+
from rich.panel import Panel
|
|
115
|
+
from rich.prompt import Confirm
|
|
116
|
+
from rich.console import Console
|
|
117
|
+
from machineconfig.scripts.python.helpers_network.wifi_conn import try_config_connection, manual_network_selection, display_available_networks
|
|
118
|
+
console = Console()
|
|
119
|
+
console.print(Panel("📶 Welcome to the WiFi Connector Tool", title="[bold blue]WiFi Connection[/bold blue]", border_style="blue"))
|
|
120
|
+
|
|
121
|
+
# If user just wants to list networks
|
|
122
|
+
if list_:
|
|
123
|
+
display_available_networks()
|
|
124
|
+
return
|
|
125
|
+
|
|
126
|
+
# If user wants manual mode, skip config and go straight to selection
|
|
127
|
+
if manual:
|
|
128
|
+
console.print("[blue]🔍 Manual network selection mode[/blue]")
|
|
129
|
+
if manual_network_selection():
|
|
130
|
+
console.print("[green]🎉 Successfully connected![/green]")
|
|
131
|
+
else:
|
|
132
|
+
console.print("[red]❌ Failed to connect[/red]")
|
|
133
|
+
return
|
|
134
|
+
|
|
135
|
+
# Try to connect using configuration first
|
|
136
|
+
console.print(f"[blue]🔍 Attempting to connect to configured network: {ssid}[/blue]")
|
|
137
|
+
|
|
138
|
+
if try_config_connection(ssid):
|
|
139
|
+
console.print("[green]🎉 Successfully connected using configuration![/green]")
|
|
140
|
+
return
|
|
141
|
+
|
|
142
|
+
# Configuration failed, offer fallback options
|
|
143
|
+
console.print("\n[yellow]⚠️ Configuration connection failed or not available[/yellow]")
|
|
144
|
+
|
|
145
|
+
if Confirm.ask("[blue]Would you like to manually select a network?[/blue]", default=True):
|
|
146
|
+
if manual_network_selection():
|
|
147
|
+
console.print("[green]🎉 Successfully connected![/green]")
|
|
148
|
+
else:
|
|
149
|
+
console.print("[red]❌ Failed to connect[/red]")
|
|
150
|
+
else:
|
|
151
|
+
console.print("[blue]👋 Goodbye![/blue]")
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def reset_cloudflare_tunnel():
|
|
156
|
+
code = """
|
|
157
|
+
# cloudflared tunnel route dns glenn # creates CNAMES in Cloudflare dashboard
|
|
158
|
+
# sudo systemctl stop cloudflared
|
|
159
|
+
# test: cloudflared tunnel run glenn
|
|
160
|
+
home_dir=$HOME
|
|
161
|
+
cloudflared_path="$home_dir/.local/bin/cloudflared"
|
|
162
|
+
sudo $cloudflared_path service uninstall
|
|
163
|
+
sudo rm /etc/cloudflared/config.yml || true
|
|
164
|
+
sudo $cloudflared_path --config $home_dir/.cloudflared/config.yml service install
|
|
165
|
+
"""
|
|
166
|
+
print(code)
|
|
167
|
+
def add_ip_exclusion_to_warp(ip: Annotated[str, typer.Option(..., "--ip", help="IP address to exclude from WARP")]):
|
|
168
|
+
code = f"""
|
|
169
|
+
sudo warp-cli tunnel ip add {ip}
|
|
170
|
+
sudo warp-cli disconnect
|
|
171
|
+
sudo warp-cli connect
|
|
172
|
+
"""
|
|
173
|
+
print(code)
|
|
174
|
+
|
|
175
|
+
|
|
57
176
|
def get_app():
|
|
58
177
|
nw_apps = typer.Typer(help="🔐 [n] Network subcommands", no_args_is_help=True, add_help_option=False, add_completion=False)
|
|
59
|
-
nw_apps.command(name="share-terminal", help="📡 [t] Share terminal via web browser")(
|
|
60
|
-
nw_apps.command(name="t", help="Share terminal via web browser", hidden=True)(
|
|
61
|
-
|
|
62
|
-
nw_apps.command(name="
|
|
178
|
+
nw_apps.command(name="share-terminal", help="📡 [t] Share terminal via web browser")(cli_share_terminal.share_terminal)
|
|
179
|
+
nw_apps.command(name="t", help="Share terminal via web browser", hidden=True)(cli_share_terminal.share_terminal)
|
|
180
|
+
|
|
181
|
+
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)
|
|
182
|
+
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)
|
|
183
|
+
|
|
184
|
+
# app = cli_share_server.get_share_file_app()
|
|
185
|
+
# nw_apps.add_typer(app, name="share-file", help="📁 [f] Share a file via relay server", no_args_is_help=True)
|
|
186
|
+
# nw_apps.add_typer(app, name="f", help="Share a file via relay server", hidden=True, no_args_is_help=True)
|
|
187
|
+
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)
|
|
188
|
+
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)
|
|
189
|
+
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)
|
|
190
|
+
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)
|
|
191
|
+
|
|
63
192
|
nw_apps.command(name="install-ssh-server", help="📡 [i] Install SSH server")(install_ssh_server)
|
|
64
193
|
nw_apps.command(name="i", help="Install SSH server", hidden=True)(install_ssh_server)
|
|
65
194
|
nw_apps.command(name="add-ssh-key", help="🔑 [k] Add SSH public key to this machine", no_args_is_help=True)(add_ssh_key)
|
|
@@ -70,4 +199,16 @@ def get_app():
|
|
|
70
199
|
nw_apps.command(name="a", help="Show this computer addresses on network", hidden=True)(show_address)
|
|
71
200
|
nw_apps.command(name="debug-ssh", help="🐛 [d] Debug SSH connection")(debug_ssh)
|
|
72
201
|
nw_apps.command(name="d", help="Debug SSH connection", hidden=True)(debug_ssh)
|
|
202
|
+
|
|
203
|
+
nw_apps.command(name="wifi-select", no_args_is_help=True, help="📶 [w] WiFi connection utility.")(wifi_select)
|
|
204
|
+
nw_apps.command(name="w", no_args_is_help=True, hidden=True)(wifi_select)
|
|
205
|
+
|
|
206
|
+
nw_apps.command(name="bind-wsl-port", help="🔌 [b] Bind WSL port to Windows host", no_args_is_help=True)(bind_wsl_port)
|
|
207
|
+
nw_apps.command(name="b", help="Bind WSL port to Windows host", hidden=True, no_args_is_help=True)(bind_wsl_port)
|
|
208
|
+
|
|
209
|
+
nw_apps.command(name="reset-cloudflare-tunnel", help="☁️ [r] Reset Cloudflare tunnel service")(reset_cloudflare_tunnel)
|
|
210
|
+
nw_apps.command(name="r", help="Reset Cloudflare tunnel service", hidden=True)(reset_cloudflare_tunnel)
|
|
211
|
+
nw_apps.command(name="add-ip-exclusion-to-warp", help="🚫 [p] Add IP exclusion to WARP")(add_ip_exclusion_to_warp)
|
|
212
|
+
nw_apps.command(name="p", help="Add IP exclusion to WARP", hidden=True)(add_ip_exclusion_to_warp)
|
|
213
|
+
|
|
73
214
|
return nw_apps
|
|
@@ -8,38 +8,38 @@ in the event that username@github.com is not mentioned in the remote url.
|
|
|
8
8
|
from pathlib import Path
|
|
9
9
|
from typing import Annotated, Optional
|
|
10
10
|
import typer
|
|
11
|
-
from machineconfig.scripts.python.helpers_repos.
|
|
11
|
+
from machineconfig.scripts.python.helpers_repos.cloud_repo_sync import main as secure_repo_main
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
DirectoryArgument = Annotated[Optional[str], typer.Argument(help="📁 Directory containing repo(s).")]
|
|
15
15
|
RecursiveOption = Annotated[bool, typer.Option("--recursive", "-r", help="🔍 Recurse into nested repositories.")]
|
|
16
|
-
|
|
16
|
+
UVsyncOption = Annotated[bool, typer.Option("--uv-sync/--no-uv-sync", "-u/-ns", help="Automatic uv sync after pulls.")]
|
|
17
17
|
CloudOption = Annotated[Optional[str], typer.Option("--cloud", "-c", help="☁️ Upload to or download from this cloud remote.")]
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
def push(directory: DirectoryArgument = None, recursive: RecursiveOption = False,
|
|
20
|
+
def push(directory: DirectoryArgument = None, recursive: RecursiveOption = False, auto_uv_sync: UVsyncOption = False) -> None:
|
|
21
21
|
"""🚀 Push changes across repositories."""
|
|
22
22
|
from machineconfig.scripts.python.helpers_repos.entrypoint import git_operations
|
|
23
|
-
git_operations(directory, pull=False, commit=False, push=True, recursive=recursive, auto_uv_sync=
|
|
23
|
+
git_operations(directory, pull=False, commit=False, push=True, recursive=recursive, auto_uv_sync=auto_uv_sync)
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
def pull(directory: DirectoryArgument = None, recursive: RecursiveOption = False,
|
|
26
|
+
def pull(directory: DirectoryArgument = None, recursive: RecursiveOption = False, auto_uv_sync: UVsyncOption = False) -> None:
|
|
27
27
|
"""⬇️ Pull changes across repositories."""
|
|
28
28
|
from machineconfig.scripts.python.helpers_repos.entrypoint import git_operations
|
|
29
29
|
|
|
30
|
-
git_operations(directory, pull=True, commit=False, push=False, recursive=recursive, auto_uv_sync=
|
|
30
|
+
git_operations(directory, pull=True, commit=False, push=False, recursive=recursive, auto_uv_sync=auto_uv_sync)
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
def commit(directory: DirectoryArgument = None, recursive: RecursiveOption = False,
|
|
33
|
+
def commit(directory: DirectoryArgument = None, recursive: RecursiveOption = False, auto_uv_sync: UVsyncOption = False) -> None:
|
|
34
34
|
"""💾 Commit changes across repositories."""
|
|
35
35
|
from machineconfig.scripts.python.helpers_repos.entrypoint import git_operations
|
|
36
|
-
git_operations(directory, pull=False, commit=True, push=False, recursive=recursive, auto_uv_sync=
|
|
36
|
+
git_operations(directory, pull=False, commit=True, push=False, recursive=recursive, auto_uv_sync=auto_uv_sync)
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
def sync(directory: DirectoryArgument = None, recursive: RecursiveOption = False,
|
|
39
|
+
def sync(directory: DirectoryArgument = None, recursive: RecursiveOption = False, auto_uv_sync: UVsyncOption = False) -> None:
|
|
40
40
|
"""🔄 Pull, commit, and push changes across repositories."""
|
|
41
41
|
from machineconfig.scripts.python.helpers_repos.entrypoint import git_operations
|
|
42
|
-
git_operations(directory, pull=True, commit=True, push=True, recursive=recursive, auto_uv_sync=
|
|
42
|
+
git_operations(directory, pull=True, commit=True, push=True, recursive=recursive, auto_uv_sync=auto_uv_sync)
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
def capture(directory: DirectoryArgument = None, cloud: CloudOption = None) -> None:
|
|
@@ -71,15 +71,40 @@ 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>=7.98"])
|
|
79
80
|
|
|
80
81
|
|
|
81
|
-
def
|
|
82
|
-
|
|
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]>=7.98"])
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def analyze_repo_development(repo_path: Annotated[str, typer.Argument(..., help="Path to the git repository")]):
|
|
91
|
+
# from machineconfig.scripts.python.helpers_repos import count_lines
|
|
92
|
+
# from pathlib import Path
|
|
93
|
+
|
|
94
|
+
# count_lines_path = Path(count_lines.__file__)
|
|
95
|
+
# # --project $HOME/code/ machineconfig --group plot
|
|
96
|
+
# cmd = f"""uv run --python 3.14 --with "machineconfig[plot]>=7.98" {count_lines_path} analyze-over-time {repo_path}"""
|
|
97
|
+
# from machineconfig.utils.code import run_shell_script
|
|
98
|
+
# run_shell_script(cmd)
|
|
99
|
+
def func(repo_path: str):
|
|
100
|
+
from machineconfig.scripts.python.helpers_repos.repo_analyzer_2 import analyze_over_time
|
|
101
|
+
analyze_over_time(repo_path=repo_path)
|
|
102
|
+
from machineconfig.utils.code import run_lambda_function
|
|
103
|
+
run_lambda_function(lambda: func(repo_path=repo_path), uv_project_dir=None, uv_with=["machineconfig[plot]>=7.98"])
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def gource_viz(
|
|
107
|
+
repo: Annotated[str, typer.Option(..., "--repo", "-r", help="Path to git repository to visualize")] = ".",
|
|
83
108
|
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
109
|
resolution: Annotated[str, typer.Option(..., "--resolution", "-res", help="Video resolution (e.g., 1920x1080, 1280x720)")] = "1920x1080",
|
|
85
110
|
seconds_per_day: Annotated[float, typer.Option(..., "--seconds-per-day", "-spd", help="Speed of simulation (lower = faster)")] = 0.1,
|
|
@@ -160,22 +185,31 @@ def get_app():
|
|
|
160
185
|
repos_apps.command(name="c", help="Commit changes across repositories", hidden=True)(commit)
|
|
161
186
|
repos_apps.command(name="sync", help="🔄 [y] Pull, commit, and push changes across repositories")(sync)
|
|
162
187
|
repos_apps.command(name="s", help="Pull, commit, and push changes across repositories", hidden=True)(sync)
|
|
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)(
|
|
188
|
+
repos_apps.command(name="analyze", help="📊 [a] Analyze repository development over time")(analyze_repo_development)
|
|
189
|
+
repos_apps.command(name="a", help="Analyze repository development over time", hidden=True)(analyze_repo_development)
|
|
165
190
|
repos_apps.command(name="secure", help="🔐 [s] Securely sync git repository to/from cloud with encryption")(secure_repo_main)
|
|
166
191
|
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="
|
|
192
|
+
|
|
193
|
+
repos_apps.command(name="viz", help="🎬 [v] Visualize repository activity using Gource")(gource_viz)
|
|
194
|
+
repos_apps.command(name="v", help="Visualize repository activity using Gource", hidden=True)(gource_viz)
|
|
195
|
+
|
|
196
|
+
repos_apps.command(name="count-lines", help="📄 [l] Count python lines of code in current repo + historical edits.")(count_lines_in_repo)
|
|
197
|
+
repos_apps.command(name="l", help="Count python lines of code in current repo + historical edits.", hidden=True)(count_lines_in_repo)
|
|
198
|
+
|
|
169
199
|
repos_apps.command(name="cleanup", help="🧹 [n] Clean repository directories from cache files")(cleanup)
|
|
170
200
|
repos_apps.command(name="n", help="Clean repository directories from cache files", hidden=True)(cleanup)
|
|
171
201
|
|
|
172
202
|
mirror_app.command(name="capture", help="📝 [cap] Record repositories into a repos.json specification")(capture)
|
|
173
203
|
mirror_app.command(name="cap", help="Record repositories into a repos.json specification", hidden=True)(capture)
|
|
204
|
+
|
|
174
205
|
mirror_app.command(name="clone", help="📥 [clo] Clone repositories described by a repos.json specification")(clone)
|
|
175
206
|
mirror_app.command(name="clo", help="Clone repositories described by a repos.json specification", hidden=True)(clone)
|
|
207
|
+
|
|
176
208
|
mirror_app.command(name="checkout-to-commit", help="🔀 [ctc] Check out specific commits listed in the specification")(checkout_command)
|
|
177
209
|
mirror_app.command(name="ctc", help="Check out specific commits listed in the specification", hidden=True)(checkout_command)
|
|
210
|
+
|
|
178
211
|
mirror_app.command(name="checkout-to-branch", help="🔀 [ctb] Check out to the main branch defined in the specification")(checkout_to_branch_command)
|
|
179
212
|
mirror_app.command(name="ctb", help="Check out to the main branch defined in the specification", hidden=True)(checkout_to_branch_command)
|
|
180
213
|
|
|
181
214
|
return repos_apps
|
|
215
|
+
|