machineconfig 7.39__py3-none-any.whl → 7.46__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.

Files changed (44) hide show
  1. machineconfig/jobs/installer/custom/hx.py +60 -8
  2. machineconfig/jobs/installer/installer_data.json +51 -0
  3. machineconfig/jobs/installer/package_groups.py +6 -5
  4. machineconfig/profile/create_helper.py +53 -17
  5. machineconfig/profile/create_links_export.py +8 -5
  6. machineconfig/profile/mapper.toml +5 -0
  7. machineconfig/scripts/python/croshell.py +4 -4
  8. machineconfig/scripts/python/env_manager/path_manager_tui.py +1 -1
  9. machineconfig/scripts/python/explore.py +49 -0
  10. machineconfig/scripts/python/helpers_devops/cli_config.py +2 -1
  11. machineconfig/scripts/python/helpers_devops/cli_nw.py +7 -6
  12. machineconfig/scripts/python/helpers_devops/cli_repos.py +1 -1
  13. machineconfig/scripts/python/helpers_devops/cli_self.py +3 -3
  14. machineconfig/scripts/python/helpers_devops/cli_share_file.py +137 -0
  15. machineconfig/scripts/python/helpers_devops/cli_share_server.py +62 -166
  16. machineconfig/scripts/python/helpers_devops/cli_utils.py +26 -30
  17. machineconfig/scripts/python/helpers_repos/cloud_repo_sync.py +1 -1
  18. machineconfig/scripts/python/helpers_repos/count_lines_frontend.py +1 -1
  19. machineconfig/scripts/python/helpers_repos/grource.py +1 -1
  20. machineconfig/scripts/python/utils.py +3 -1
  21. machineconfig/scripts/windows/mounts/mount_ssh.ps1 +1 -1
  22. machineconfig/settings/broot/conf.toml +1 -1
  23. machineconfig/settings/helix/config.toml +16 -0
  24. machineconfig/settings/helix/languages.toml +13 -4
  25. machineconfig/settings/helix/yazi-picker.sh +12 -0
  26. machineconfig/settings/lf/linux/exe/lfcd.sh +1 -0
  27. machineconfig/settings/lf/linux/exe/previewer.sh +3 -2
  28. machineconfig/settings/shells/bash/init.sh +4 -3
  29. machineconfig/settings/shells/pwsh/init.ps1 +4 -3
  30. machineconfig/settings/shells/zsh/init.sh +17 -12
  31. machineconfig/settings/yazi/init.lua +36 -0
  32. machineconfig/settings/yazi/keymap.toml +79 -0
  33. machineconfig/settings/yazi/shell/yazi_cd.ps1 +9 -0
  34. machineconfig/settings/yazi/shell/yazi_cd.sh +8 -0
  35. machineconfig/settings/yazi/yazi.toml +13 -0
  36. machineconfig/setup_linux/web_shortcuts/interactive.sh +10 -10
  37. machineconfig/setup_windows/apps.ps1 +2 -2
  38. machineconfig/setup_windows/web_shortcuts/interactive.ps1 +10 -10
  39. machineconfig/utils/ssh.py +1 -1
  40. {machineconfig-7.39.dist-info → machineconfig-7.46.dist-info}/METADATA +1 -1
  41. {machineconfig-7.39.dist-info → machineconfig-7.46.dist-info}/RECORD +44 -38
  42. {machineconfig-7.39.dist-info → machineconfig-7.46.dist-info}/entry_points.txt +1 -0
  43. {machineconfig-7.39.dist-info → machineconfig-7.46.dist-info}/WHEEL +0 -0
  44. {machineconfig-7.39.dist-info → machineconfig-7.46.dist-info}/top_level.txt +0 -0
@@ -33,7 +33,7 @@ config_dict: InstallerData = {
33
33
  }
34
34
 
35
35
 
36
- def main(installer_data: InstallerData, version: Optional[str], install_lib: bool = False):
36
+ def main(installer_data: InstallerData, version: Optional[str], install_lib: bool = True):
37
37
  _ = installer_data
38
38
  console = Console()
39
39
 
@@ -73,9 +73,6 @@ def main(installer_data: InstallerData, version: Optional[str], install_lib: boo
73
73
  print("\n🗑️ [Step 3/5] Cleaning up previous installation (if any)...")
74
74
  runtime_path = PathExtended.home().joinpath(".config/helix/runtime")
75
75
  contrib_path = PathExtended.home().joinpath(".config/helix/contrib")
76
- runtime_path.delete(sure=True, verbose=False)
77
- contrib_path.delete(sure=True, verbose=False)
78
- print(f" ✨ Cleaned '{runtime_path}' and '{contrib_path}'.")
79
76
 
80
77
  print("\n📦 [Step 4/5] Installing Helix components...")
81
78
  target_config_dir = PathExtended.home().joinpath(".config/helix").expanduser()
@@ -85,9 +82,40 @@ def main(installer_data: InstallerData, version: Optional[str], install_lib: boo
85
82
  target_bin_path = PathExtended(LINUX_INSTALL_PATH) if platform.system() == "Linux" else PathExtended("/usr/local/bin")
86
83
  exe_name = "hx"
87
84
  hx_file.move(folder=target_bin_path, overwrite=True)
85
+
86
+ # Always install contrib (regardless of install_lib flag) — treat it like the executable.
87
+ contrib_path.delete(sure=True, verbose=False)
88
+ contrib.move(folder=target_config_dir, overwrite=True)
89
+
90
+ # Install runtime only if install_lib is True. When copying runtime, copy all subfolders
91
+ # except 'grammars' (for which we only copy the specific python.so file if present).
88
92
  if install_lib:
89
- contrib.move(folder=target_config_dir, overwrite=True)
90
- runtime.move(folder=target_config_dir, overwrite=True)
93
+ runtime_path.delete(sure=True, verbose=False)
94
+ print(f" ✨ Cleaned '{runtime_path}' and '{contrib_path}'.")
95
+ target_runtime = target_config_dir.joinpath("runtime")
96
+ target_runtime.mkdir(parents=True, exist_ok=True)
97
+
98
+ # iterate runtime children and copy selectively
99
+ for child in runtime.iterdir():
100
+ # skip non-existent or weird entries
101
+ if not child.exists():
102
+ continue
103
+ if child.name == "grammars":
104
+ # copy only the python.so file from runtime/grammars if it exists
105
+ python_so = child.joinpath("python.so")
106
+ if python_so.exists() and python_so.is_file():
107
+ dest = target_runtime.joinpath("grammars")
108
+ python_so.copy(folder=dest, overwrite=True)
109
+ else:
110
+ # copy the whole child (file or directory) into target_runtime
111
+ # for directories, copy will create target_runtime/<child.name>
112
+ try:
113
+ child.copy(folder=target_runtime, overwrite=True)
114
+ except Exception:
115
+ # fallback: try copying contents if it's a directory
116
+ if child.is_dir():
117
+ for sub in child.iterdir():
118
+ sub.copy(folder=target_runtime.joinpath(child.name), overwrite=True)
91
119
  system_name = "Linux" if platform.system() == "Linux" else "macOS"
92
120
  console.print(
93
121
  Panel(
@@ -103,9 +131,33 @@ def main(installer_data: InstallerData, version: Optional[str], install_lib: boo
103
131
  target_bin_path = PathExtended(WINDOWS_INSTALL_PATH)
104
132
  exe_name = "hx.exe"
105
133
  hx_file.move(folder=target_bin_path, overwrite=True)
134
+
135
+ # Always install contrib (regardless of install_lib flag)
136
+ contrib_path.delete(sure=True, verbose=False)
137
+ contrib.move(folder=target_config_dir, overwrite=True)
138
+
139
+ # Install runtime only if install_lib is True. Copy selectively as on POSIX.
106
140
  if install_lib:
107
- contrib.move(folder=target_config_dir, overwrite=True)
108
- runtime.move(folder=target_config_dir, overwrite=True)
141
+ runtime_path.delete(sure=True, verbose=False)
142
+ print(f" ✨ Cleaned '{runtime_path}' and '{contrib_path}'.")
143
+ target_runtime = target_config_dir.joinpath("runtime")
144
+ target_runtime.mkdir(parents=True, exist_ok=True)
145
+
146
+ for child in runtime.iterdir():
147
+ if not child.exists():
148
+ continue
149
+ if child.name == "grammars":
150
+ python_so = child.joinpath("python.so")
151
+ if python_so.exists() and python_so.is_file():
152
+ dest = target_runtime.joinpath("grammars")
153
+ python_so.copy(folder=dest, overwrite=True)
154
+ else:
155
+ try:
156
+ child.copy(folder=target_runtime, overwrite=True)
157
+ except Exception:
158
+ if child.is_dir():
159
+ for sub in child.iterdir():
160
+ sub.copy(folder=target_runtime.joinpath(child.name), overwrite=True)
109
161
  console.print(
110
162
  Panel(
111
163
  f"""✅ SUCCESS | Helix editor installed successfully on Windows!
@@ -69,6 +69,23 @@
69
69
  }
70
70
  }
71
71
  },
72
+ {
73
+ "appName": "timg",
74
+ "repoURL": "CMD",
75
+ "doc": "👁️ terminal image previewer.",
76
+ "fileNamePattern": {
77
+ "amd64": {
78
+ "linux": "sudo apt install timg",
79
+ "windows": null,
80
+ "macos": "brew install timg"
81
+ },
82
+ "arm64": {
83
+ "linux": "sudo apt install timg",
84
+ "windows": null,
85
+ "macos": "brew install timg"
86
+ }
87
+ }
88
+ },
72
89
  {
73
90
  "appName": "diskonaut",
74
91
  "repoURL": "https://github.com/imsnif/diskonaut",
@@ -1735,6 +1752,23 @@
1735
1752
  }
1736
1753
  }
1737
1754
  },
1755
+ {
1756
+ "appName": "miniserve",
1757
+ "repoURL": "https://github.com/svenstaro/miniserve",
1758
+ "doc": "📂 A small, self-contained file server with directory listings",
1759
+ "fileNamePattern": {
1760
+ "amd64": {
1761
+ "linux": "miniserve-{version}-x86_64-unknown-linux-musl",
1762
+ "darwin": "miniserve-{version}-x86_64-apple-darwin",
1763
+ "windows": "miniserve-{version}-x86_64-pc-windows-msvc.exe"
1764
+ },
1765
+ "arm64": {
1766
+ "linux": "miniserve-{version}-aarch64-unknown-linux-musl",
1767
+ "darwin": "miniserve-{version}-aarch64-apple-darwin",
1768
+ "windows": "miniserve-{version}-aarch64-pc-windows-msvc.exe"
1769
+ }
1770
+ }
1771
+ },
1738
1772
  {
1739
1773
  "appName": "cloudreve",
1740
1774
  "repoURL": "https://github.com/cloudreve/Cloudreve",
@@ -2212,6 +2246,23 @@
2212
2246
  }
2213
2247
  }
2214
2248
  },
2249
+ {
2250
+ "appName": "aichat",
2251
+ "repoURL": "https://github.com/sigoden/aichat",
2252
+ "doc": "Terminal-based CLI agents and tools for productivity and coding.",
2253
+ "fileNamePattern": {
2254
+ "amd64": {
2255
+ "linux": "aichat-{version}-x86_64-unknown-linux-musl.tar.gz",
2256
+ "macos": "aichat-{version}-x86_64-apple-darwin.tar.gz",
2257
+ "windows": "aichat-{version}-x86_64-pc-windows-msvc.zip"
2258
+ },
2259
+ "arm64": {
2260
+ "linux": "aichat-{version}-aarch64-unknown-linux-musl.tar.gz",
2261
+ "macos": "aichat-{version}-aarch64-apple-darwin.tar.gz",
2262
+ "windows": "aichat-{version}-aarch64-pc-windows-msvc.zip"
2263
+ }
2264
+ }
2265
+ },
2215
2266
  {
2216
2267
  "appName": "qwen-code",
2217
2268
  "repoURL": "CMD",
@@ -3,6 +3,7 @@ from typing import Literal, TypeAlias, Union
3
3
  # AI/LLM Tools - AI-powered coding and chat assistants
4
4
  AGENTS = [
5
5
  "aider",
6
+ "aichat",
6
7
  "copilot",
7
8
  "gemini",
8
9
  "crush",
@@ -144,7 +145,6 @@ PACKAGES_MISC_DEV = [
144
145
  "Gorilla",
145
146
  "Redis",
146
147
  "transmission",
147
- "exa",
148
148
  "bytehound",
149
149
  "atuin",
150
150
  "xcrawl3r",
@@ -187,11 +187,12 @@ PACKAGES_FILE = [
187
187
  "pistol",
188
188
  "bat",
189
189
  "viu",
190
- "xplr",
191
- "joshuto",
192
- "lf",
193
- "tere",
190
+ # "xplr",
191
+ # "joshuto",
192
+ # "lf",
194
193
  "yazi",
194
+ "tere",
195
+ # "exa",
195
196
  "lsd",
196
197
  "zoxide",
197
198
  "diskonaut",
@@ -1,38 +1,74 @@
1
1
 
2
2
  from typing import Literal
3
+ from pathlib import Path
4
+ import shutil
3
5
  from machineconfig.utils.source_of_truth import LIBRARY_ROOT, CONFIG_ROOT
4
6
 
5
7
 
6
- def copy_assets_to_machine(which: Literal["scripts", "settings"]):
7
- # callers, symlink public, shell profile adder (requires init.ps1 and scripts dir to be present on machine)
8
+ def _copy_path(source: Path, target: Path, overwrite: bool = False) -> None:
9
+ source = source.expanduser().resolve()
10
+ target = target.expanduser().resolve()
11
+ if not source.exists():
12
+ raise FileNotFoundError(f"Source path does not exist: {source}")
13
+ target.parent.mkdir(parents=True, exist_ok=True)
14
+ if target.exists() and not overwrite:
15
+ raise FileExistsError(f"Target already exists and overwrite=False: {target}")
16
+ if target.exists() and overwrite:
17
+ if target.is_dir():
18
+ shutil.rmtree(target)
19
+ else:
20
+ target.unlink()
21
+ if source.is_file():
22
+ shutil.copy2(source, target)
23
+ elif source.is_dir():
24
+ shutil.copytree(source, target, dirs_exist_ok=overwrite)
25
+ else:
26
+ raise ValueError(f"Source is neither file nor directory: {source}")
27
+
28
+
29
+ def copy_assets_to_machine(which: Literal["scripts", "settings"]) -> None:
8
30
  import platform
9
- if platform.system().lower() == "windows":
31
+ import subprocess
32
+
33
+ system_name = platform.system().lower()
34
+ if system_name == "windows":
10
35
  system = "windows"
11
- elif platform.system().lower() == "linux" or platform.system().lower() == "darwin":
36
+ elif system_name in {"linux", "darwin"}:
12
37
  system = "linux"
13
38
  else:
14
- raise NotImplementedError(f"System {platform.system().lower()} not supported")
15
- from machineconfig.utils.path_extended import PathExtended
39
+ raise NotImplementedError(f"System {system_name} not supported")
40
+
16
41
  match which:
17
42
  case "scripts":
18
43
  source = LIBRARY_ROOT.joinpath("scripts", system)
19
- target = CONFIG_ROOT.joinpath("scripts", system)
20
-
21
- PathExtended(LIBRARY_ROOT.joinpath("scripts", "nu", "wrap_mcfg.nu")).copy(folder=CONFIG_ROOT.joinpath("scripts"), overwrite=True)
44
+ target = CONFIG_ROOT.joinpath("scripts")
45
+
46
+ wrap_mcfg_source = LIBRARY_ROOT.joinpath("scripts", "nu", "wrap_mcfg.nu")
47
+ wrap_mcfg_target = CONFIG_ROOT.joinpath("scripts", "wrap_mcfg.nu")
48
+ wrap_mcfg_target.parent.mkdir(parents=True, exist_ok=True)
49
+ _copy_path(source=wrap_mcfg_source, target=wrap_mcfg_target, overwrite=True)
22
50
  case "settings":
23
51
  source = LIBRARY_ROOT.joinpath("settings")
24
52
  target = CONFIG_ROOT.joinpath("settings")
25
53
 
26
- PathExtended(source).copy(folder=target.parent, overwrite=True)
27
-
28
- import platform
29
- system = platform.system().lower()
30
- if system == "linux" and which == "scripts":
31
- import subprocess
54
+ _copy_path(source=source, target=target, overwrite=True)
55
+
56
+ if system_name == "linux" and which == "scripts":
32
57
  from rich.console import Console
33
58
  console = Console()
34
59
  console.print("\n[bold]📜 Setting executable permissions for scripts...[/bold]")
35
- subprocess.run(f"chmod +x {CONFIG_ROOT.joinpath(f'scripts/{system.lower()}')} -R", shell=True, capture_output=True, text=True)
60
+ scripts_path = CONFIG_ROOT.joinpath(f"scripts/{system_name}")
61
+ subprocess.run(f"chmod +x {scripts_path} -R", shell=True, capture_output=True, text=True, check=False)
36
62
  console.print("[green]✅ Script permissions updated[/green]")
37
63
 
38
-
64
+ home_dir = Path.home()
65
+ if system_name == "windows":
66
+ yazi_plugins_dir = home_dir.joinpath("AppData", "Roaming", "yazi", "config")
67
+ else:
68
+ yazi_plugins_dir = home_dir.joinpath(".config", "yazi")
69
+
70
+ yazi_plugins_path = yazi_plugins_dir.joinpath("plugins")
71
+ if not yazi_plugins_path.exists():
72
+ yazi_plugins_dir.mkdir(parents=True, exist_ok=True)
73
+ import git
74
+ git.Repo.clone_from("https://github.com/yazi-rs/plugins", yazi_plugins_path)
@@ -19,10 +19,10 @@ ON_CONFLICT_MAPPER: dict[str, ON_CONFLICT_STRICT] = {
19
19
  }
20
20
 
21
21
 
22
- def main_public_from_parser(method: Annotated[Literal["symlink", "s", "copy", "c"], typer.Option(..., help="Method to use for setting up the config file.")],
23
- on_conflict: Annotated[ON_CONFLICT_LOOSE, typer.Option(..., help="Action to take on conflict")],
24
- which: Annotated[Optional[str], typer.Option(..., help="Specific items to process")] = None,
25
- interactive: Annotated[bool, typer.Option(..., help="Run in interactive mode")] = False):
22
+ def main_public_from_parser(method: Annotated[Literal["symlink", "s", "copy", "c"], typer.Option(..., "--method", "-m", help="Method to use for setting up the config file.")],
23
+ on_conflict: Annotated[ON_CONFLICT_LOOSE, typer.Option(..., "--on-conflict", "-o", help="Action to take on conflict")] = "throw-error",
24
+ which: Annotated[Optional[str], typer.Option(..., "--which", "-w", help="Specific items to process (default: all)")] = None,
25
+ interactive: Annotated[bool, typer.Option(..., "--interactive", "-i", help="Run in interactive mode")] = False):
26
26
  """Terminology:
27
27
  SOURCE = Self-Managed-Config-File-Path
28
28
  TARGET = Config-File-Default-Path
@@ -40,7 +40,10 @@ def main_public_from_parser(method: Annotated[Literal["symlink", "s", "copy", "c
40
40
  else:
41
41
  items_chosen = which.split(",")
42
42
  items_objections: dict[str, list[ConfigMapper]] = {item: mapper_full[item] for item in items_chosen if item in mapper_full}
43
-
43
+ if len(items_objections) == 0:
44
+ typer.echo("[red]Error:[/] No valid items selected.")
45
+ typer.Exit(code=1)
46
+ return
44
47
  from machineconfig.profile.create_links import apply_mapper
45
48
  from machineconfig.profile.create_helper import copy_assets_to_machine
46
49
  copy_assets_to_machine(which="settings") # config files live here and will be linked to.
@@ -100,11 +100,15 @@ config = {this = '~/.config/rofi/config.rasi', to_this = 'CONFIG_ROOT/settings/r
100
100
  yazi = {this = '~/AppData/Roaming/yazi/config/yazi.toml', to_this = 'CONFIG_ROOT/settings/yazi/yazi.toml'}
101
101
  keymap = {this = '~/AppData/Roaming/yazi/config/keymap.toml', to_this = 'CONFIG_ROOT/settings/yazi/keymap.toml'}
102
102
  theme = {this = '~/AppData/Roaming/yazi/config/theme.toml', to_this = 'CONFIG_ROOT/settings/yazi/theme.toml'}
103
+ init = {this = '~/AppData/Roaming/yazi/config/init.lua', to_this = 'CONFIG_ROOT/settings/yazi/init.lua'}
104
+
105
+
103
106
 
104
107
  [yazi_linux]
105
108
  yazi = {this = '~/.config/yazi/yazi.toml', to_this = 'CONFIG_ROOT/settings/yazi/yazi.toml'}
106
109
  keymap = {this = '~/.config/yazi/keymap.toml', to_this = 'CONFIG_ROOT/settings/yazi/keymap.toml'}
107
110
  theme = {this = '~/.config/yazi/theme.toml', to_this = 'CONFIG_ROOT/settings/yazi/theme.toml'}
111
+ init = {this = '~/.config/yazi/init.lua', to_this = 'CONFIG_ROOT/settings/yazi/init.lua'}
108
112
 
109
113
  [lf_windows]
110
114
  config = {this = '~/AppData/Local/lf/lfrc', to_this = 'CONFIG_ROOT/settings/lf/windows/lfrc'}
@@ -225,6 +229,7 @@ config = { this = '~/AppData/Roaming/helix/config.toml', to_this = 'CONFIG_ROOT/
225
229
  [helix_linux]
226
230
  languages = { this = '~/.config/helix/languages.toml', to_this = 'CONFIG_ROOT/settings/helix/languages.toml' }
227
231
  config = { this = '~/.config/helix/config.toml', to_this = 'CONFIG_ROOT/settings/helix/config.toml' }
232
+ yazi_picker = { this = '~/.config/helix/yazi-picker.sh', to_this = 'CONFIG_ROOT/settings/helix/yazi-picker.sh' }
228
233
 
229
234
  [lvim_windows]
230
235
  config = { this = '~/AppData/Local/lvim/config.lua', to_this = 'CONFIG_ROOT/settings/lvim/windows/config.lua' }
@@ -130,7 +130,7 @@ def croshell(
130
130
  fire_line = f"uv run --python 3.14 --with visidata,pyarrow vd {str(file_obj)}"
131
131
  elif marimo:
132
132
  if Path.home().joinpath("code/machineconfig").exists(): requirements = f"""--with marimo --project "{str(Path.home().joinpath("code/machineconfig"))}" """
133
- else: requirements = """--python 3.14 --with "marimo,machineconfig[plot]>=7.39" """
133
+ else: requirements = """--python 3.14 --with "marimo,machineconfig[plot]>=7.46" """
134
134
  fire_line = f"""
135
135
  cd {str(pyfile.parent)}
136
136
  uv run --python 3.14 --with "marimo" marimo convert {pyfile.name} -o marimo_nb.py
@@ -138,14 +138,14 @@ uv run {requirements} marimo edit --host 0.0.0.0 marimo_nb.py
138
138
  """
139
139
  elif jupyter:
140
140
  if Path.home().joinpath("code/machineconfig").exists(): requirements = f"""--project "{str(Path.home().joinpath("code/machineconfig"))}" --with jupyterlab """
141
- else: requirements = """--with "machineconfig[plot]>=7.39" """
141
+ else: requirements = """--with "machineconfig[plot]>=7.46" """
142
142
  fire_line = f"uv run {requirements} jupyter-lab {str(nb_target)}"
143
143
  elif vscode:
144
144
  fire_line = f"""
145
145
  cd {str(pyfile.parent)}
146
146
  uv init --python 3.14
147
147
  uv venv
148
- uv add "machineconfig[plot]>=7.39"
148
+ uv add "machineconfig[plot]>=7.46"
149
149
  # code serve-web
150
150
  code --new-window {str(pyfile)}
151
151
  """
@@ -153,7 +153,7 @@ code --new-window {str(pyfile)}
153
153
  if interpreter == "ipython": profile = f" --profile {ipython_profile} --no-banner"
154
154
  else: profile = ""
155
155
  if Path.home().joinpath("code/machineconfig").exists(): ve_line = f"""--project "{str(Path.home().joinpath("code/machineconfig"))}" """
156
- else: ve_line = """--python 3.14 --with "machineconfig[plot]>=7.39" """
156
+ else: ve_line = """--python 3.14 --with "machineconfig[plot]>=7.46" """
157
157
  # ve_path_maybe, ipython_profile_maybe = get_ve_path_and_ipython_profile(Path.cwd())
158
158
  # --python 3.14
159
159
  fire_line = f"uv run {ve_line} {interpreter} {interactivity} {profile} {str(pyfile)}"
@@ -2,7 +2,7 @@
2
2
  # /// script
3
3
  # requires-python = ">=3.13"
4
4
  # dependencies = [
5
- # "machineconfig>=7.39",
5
+ # "machineconfig>=7.46",
6
6
  # "textual",
7
7
  # "pyperclip",
8
8
  # ]
@@ -0,0 +1,49 @@
1
+
2
+ import typer
3
+
4
+
5
+ def machineconfig_lf():
6
+ # from machineconfig.scripts.python.helpers_msearch import FZFG_LINUX_PATH, FZFG_WINDOWS_PATH
7
+ import platform
8
+ if platform.system() == "Linux":
9
+ script = """
10
+ tmp="$(mktemp)"
11
+ lf -last-dir-path="$tmp" "$@"
12
+ if [ -f "$tmp" ]; then
13
+ dir="$(cat "$tmp")"
14
+ rm -f "$tmp"
15
+ if [ -d "$dir" ]; then
16
+ if [ "$dir" != "$(pwd)" ]; then
17
+ cd "$dir"
18
+ fi
19
+ fi
20
+ fi
21
+ """
22
+ elif platform.system() == "Windows":
23
+ script = r"""
24
+ $tmp = [System.IO.Path]::GetTempFileName()
25
+ ~\AppData\Local\Microsoft\WindowsApps\lf.exe -last-dir-path="$tmp" $args
26
+ if (Test-Path -PathType Leaf "$tmp")
27
+ {
28
+ $dir = Get-Content "$tmp"
29
+ Remove-Item -Force "$tmp"
30
+ if (Test-Path -PathType Container "$dir")
31
+ {
32
+ if ("$dir" -ne "$pwd")
33
+ {
34
+ Set-Location "$dir"
35
+ }
36
+ }
37
+ }
38
+ """
39
+ else:
40
+ raise RuntimeError("Unsupported platform")
41
+
42
+ from machineconfig.utils.code import exit_then_run_shell_script
43
+ exit_then_run_shell_script(script=script, strict=False)
44
+
45
+
46
+ def main():
47
+ app = typer.Typer(add_completion=False, no_args_is_help=True)
48
+ app.command(name="lf", help="machineconfig lf wrapper.", no_args_is_help=False)(machineconfig_lf)
49
+ app()
@@ -6,6 +6,7 @@ import typer
6
6
  import machineconfig.scripts.python.helpers_devops.cli_config_dotfile as dotfile_module
7
7
  import machineconfig.profile.create_links_export as create_links_export
8
8
 
9
+
9
10
  def shell(which: Annotated[Literal["default", "d", "nushell", "n"], typer.Option(..., "--which", "-w", help="Which shell profile to create/configure")]="default"):
10
11
  """🔗 Configure your shell profile."""
11
12
  from machineconfig.profile.create_shell_profile import create_default_shell_profile, create_nu_shell_profile
@@ -28,7 +29,7 @@ def path():
28
29
  uv_with = ["textual"]
29
30
  uv_project_dir = None
30
31
  if not Path.home().joinpath("code/machineconfig").exists():
31
- uv_with.append("machineconfig>=7.39")
32
+ uv_with.append("machineconfig>=7.46")
32
33
  else:
33
34
  uv_project_dir = str(Path.home().joinpath("code/machineconfig"))
34
35
  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])
@@ -1,4 +1,5 @@
1
1
 
2
+ import machineconfig.scripts.python.helpers_devops.cli_share_file
2
3
  import machineconfig.scripts.python.helpers_devops.cli_terminal as cli_terminal
3
4
  import machineconfig.scripts.python.helpers_devops.cli_share_server as cli_share_server
4
5
  import typer
@@ -105,16 +106,16 @@ def get_app():
105
106
  nw_apps.command(name="share-terminal", help="📡 [t] Share terminal via web browser")(cli_terminal.main)
106
107
  nw_apps.command(name="t", help="Share terminal via web browser", hidden=True)(cli_terminal.main)
107
108
 
108
- 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.main)
109
- 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.main)
109
+ 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
+ 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)
110
111
 
111
112
  # app = cli_share_server.get_share_file_app()
112
113
  # nw_apps.add_typer(app, name="share-file", help="📁 [f] Share a file via relay server", no_args_is_help=True)
113
114
  # nw_apps.add_typer(app, name="f", help="Share a file via relay server", hidden=True, no_args_is_help=True)
114
- nw_apps.command(name="send", no_args_is_help=True, hidden=False, help="📁 [sx] send files from here.")(cli_share_server.share_file_send)
115
- nw_apps.command(name="sx", no_args_is_help=True, hidden=True, help="📁 [sx] send files from here.")(cli_share_server.share_file_send)
116
- nw_apps.command(name="receive", no_args_is_help=True, hidden=False, help="📁 [rx] receive files to here.")(cli_share_server.share_file_receive)
117
- nw_apps.command(name="rx", no_args_is_help=True, hidden=True, help="📁 [rx] receive files to here.")(cli_share_server.share_file_receive)
115
+ 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
+ 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
+ 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
+ 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)
118
119
 
119
120
  nw_apps.command(name="install-ssh-server", help="📡 [i] Install SSH server")(install_ssh_server)
120
121
  nw_apps.command(name="i", help="Install SSH server", hidden=True)(install_ssh_server)
@@ -79,7 +79,7 @@ def analyze(directory: DirectoryArgument = None) -> None:
79
79
 
80
80
 
81
81
  def viz(
82
- repo: Annotated[str, typer.Option(..., "--repo", "-r", help="Path to git repository to visualize")] = Path.cwd().__str__(),
82
+ repo: Annotated[str, typer.Option(..., "--repo", "-r", help="Path to git repository to visualize")] = ".",
83
83
  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
84
  resolution: Annotated[str, typer.Option(..., "--resolution", "-res", help="Video resolution (e.g., 1920x1080, 1280x720)")] = "1920x1080",
85
85
  seconds_per_day: Annotated[float, typer.Option(..., "--seconds-per-day", "-spd", help="Speed of simulation (lower = faster)")] = 0.1,
@@ -46,9 +46,9 @@ def install(no_copy_assets: Annotated[bool, typer.Option("--no-assets-copy", "-n
46
46
  else:
47
47
  import platform
48
48
  if platform.system() == "Windows":
49
- run_shell_script(r"""& "$HOME\.local\bin\uv.exe" tool install --upgrade "machineconfig>=7.39" """)
49
+ run_shell_script(r"""& "$HOME\.local\bin\uv.exe" tool install --upgrade "machineconfig>=7.46" """)
50
50
  else:
51
- run_shell_script("""$HOME/.local/bin/uv tool install --upgrade "machineconfig>=7.39" """)
51
+ run_shell_script("""$HOME/.local/bin/uv tool install --upgrade "machineconfig>=7.46" """)
52
52
  from machineconfig.profile.create_shell_profile import create_default_shell_profile
53
53
  if not no_copy_assets:
54
54
  create_default_shell_profile() # involves copying assets too
@@ -73,7 +73,7 @@ def navigate():
73
73
  path = Path(navigator.__file__).resolve().parent.joinpath("devops_navigator.py")
74
74
  from machineconfig.utils.code import run_shell_script
75
75
  if Path.home().joinpath("code/machineconfig").exists(): executable = f"""--project "{str(Path.home().joinpath("code/machineconfig"))}" --with textual"""
76
- else: executable = """--with "machineconfig>=7.39,textual" """
76
+ else: executable = """--with "machineconfig>=7.46,textual" """
77
77
  run_shell_script(f"""uv run {executable} {path}""")
78
78
 
79
79