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

@@ -0,0 +1,20 @@
1
+ """
2
+ Helper modules for the devops navigator TUI application.
3
+ """
4
+
5
+ from machineconfig.scripts.python.helper_navigator.data_models import CommandInfo, ArgumentInfo
6
+ from machineconfig.scripts.python.helper_navigator.command_builder import CommandBuilderScreen
7
+ from machineconfig.scripts.python.helper_navigator.command_tree import CommandTree
8
+ from machineconfig.scripts.python.helper_navigator.command_detail import CommandDetail
9
+ from machineconfig.scripts.python.helper_navigator.search_bar import SearchBar
10
+ from machineconfig.scripts.python.helper_navigator.main_app import CommandNavigatorApp
11
+
12
+ __all__ = [
13
+ "CommandInfo",
14
+ "ArgumentInfo",
15
+ "CommandBuilderScreen",
16
+ "CommandTree",
17
+ "CommandDetail",
18
+ "SearchBar",
19
+ "CommandNavigatorApp",
20
+ ]
@@ -0,0 +1,111 @@
1
+ """
2
+ Command builder screen for building commands with arguments.
3
+ """
4
+
5
+ import re
6
+ from textual.app import ComposeResult
7
+ from textual.containers import Horizontal, VerticalScroll
8
+ from textual.widgets import Static, Input, Label, Button
9
+ from textual.screen import ModalScreen
10
+ from machineconfig.scripts.python.helper_navigator.data_models import CommandInfo, ArgumentInfo
11
+
12
+
13
+ class CommandBuilderScreen(ModalScreen[str]):
14
+ """Modal screen for building command with arguments."""
15
+
16
+ def __init__(self, command_info: CommandInfo) -> None:
17
+ super().__init__()
18
+ self.command_info = command_info
19
+ self.arguments = self._parse_arguments()
20
+ self.input_widgets: dict[str, Input] = {}
21
+
22
+ def _parse_arguments(self) -> list[ArgumentInfo]:
23
+ """Parse arguments from help_text."""
24
+ args: list[ArgumentInfo] = []
25
+ seen_names: set[str] = set()
26
+
27
+ if not self.command_info.help_text:
28
+ return args
29
+
30
+ help_text = self.command_info.help_text
31
+
32
+ optional_pattern = re.compile(r'--(\w+(?:-\w+)*)\s+<([^>]+)>')
33
+ for match in optional_pattern.finditer(help_text):
34
+ arg_name = match.group(1)
35
+ placeholder = match.group(2)
36
+ if arg_name not in seen_names:
37
+ args.append(ArgumentInfo(name=arg_name, is_required=False, is_flag=False, placeholder=placeholder))
38
+ seen_names.add(arg_name)
39
+
40
+ flag_pattern = re.compile(r'--(\w+(?:-\w+)*)(?:\s|$)')
41
+ for match in flag_pattern.finditer(help_text):
42
+ arg_name = match.group(1)
43
+ if arg_name not in seen_names:
44
+ args.append(ArgumentInfo(name=arg_name, is_required=False, is_flag=True))
45
+ seen_names.add(arg_name)
46
+
47
+ positional_pattern = re.compile(r'<(\w+)>(?!\s*>)')
48
+ for match in positional_pattern.finditer(help_text):
49
+ arg_name = match.group(1)
50
+ if arg_name not in seen_names and not re.search(rf'--\w+\s+<{arg_name}>', help_text):
51
+ args.append(ArgumentInfo(name=arg_name, is_required=True, is_flag=False, placeholder=arg_name))
52
+ seen_names.add(arg_name)
53
+
54
+ return args
55
+
56
+ def compose(self) -> ComposeResult:
57
+ """Compose the modal screen."""
58
+ with VerticalScroll():
59
+ yield Static(f"[bold cyan]Build Command: {self.command_info.command}[/bold cyan]\n", classes="title")
60
+
61
+ if not self.arguments:
62
+ yield Static("[yellow]No arguments needed for this command[/yellow]\n")
63
+ else:
64
+ for arg in self.arguments:
65
+ if arg.is_flag:
66
+ label_text = f"--{arg.name} (flag, leave empty to skip)"
67
+ yield Label(label_text)
68
+ input_widget = Input(placeholder="yes/no or leave empty", id=f"arg_{arg.name}")
69
+ else:
70
+ required_marker = "[red]*[/red]" if arg.is_required else "[dim](optional)[/dim]"
71
+ label_text = f"--{arg.name} {required_marker}"
72
+ yield Label(label_text)
73
+ input_widget = Input(placeholder=arg.placeholder or arg.name, id=f"arg_{arg.name}")
74
+
75
+ self.input_widgets[arg.name] = input_widget
76
+ yield input_widget
77
+
78
+ with Horizontal(classes="buttons"):
79
+ yield Button("Execute", variant="primary", id="execute")
80
+ yield Button("Copy", variant="success", id="copy")
81
+ yield Button("Cancel", variant="error", id="cancel")
82
+
83
+ def on_button_pressed(self, event: Button.Pressed) -> None:
84
+ """Handle button presses."""
85
+ if event.button.id == "cancel":
86
+ self.dismiss("")
87
+ return
88
+
89
+ built_command = self._build_command()
90
+
91
+ if event.button.id == "execute":
92
+ self.dismiss(f"EXECUTE:{built_command}")
93
+ elif event.button.id == "copy":
94
+ self.dismiss(f"COPY:{built_command}")
95
+
96
+ def _build_command(self) -> str:
97
+ """Build the complete command with arguments."""
98
+ parts = [self.command_info.command]
99
+
100
+ for arg in self.arguments:
101
+ input_widget = self.input_widgets.get(arg.name)
102
+ if input_widget:
103
+ value = input_widget.value.strip()
104
+ if value:
105
+ if arg.is_flag:
106
+ if value.lower() in ('yes', 'y', 'true', '1'):
107
+ parts.append(f"--{arg.name}")
108
+ else:
109
+ parts.append(f"--{arg.name} {value}")
110
+
111
+ return " ".join(parts)
@@ -0,0 +1,44 @@
1
+ """
2
+ Command detail widget for displaying command information.
3
+ """
4
+
5
+ from typing import Optional
6
+ from textual.widgets import Static
7
+ from rich.panel import Panel
8
+ from rich.text import Text
9
+ from machineconfig.scripts.python.helper_navigator.data_models import CommandInfo
10
+
11
+
12
+ class CommandDetail(Static):
13
+ """Widget for displaying command details."""
14
+
15
+ def __init__(self, *, id: str) -> None: # type: ignore
16
+ super().__init__(id=id)
17
+ self.command_info: Optional[CommandInfo] = None
18
+
19
+ def update_command(self, command_info: Optional[CommandInfo]) -> None:
20
+ """Update displayed command information."""
21
+ self.command_info = command_info
22
+ if command_info is None:
23
+ self.update("Select a command to view details")
24
+ return
25
+
26
+ content = Text()
27
+ content.append(f"{'🗂️ Group' if command_info.is_group else '⚡ Command'}: ", style="bold cyan")
28
+ content.append(f"{command_info.name}\n\n", style="bold yellow")
29
+
30
+ content.append("Description: ", style="bold green")
31
+ content.append(f"{command_info.description}\n\n", style="white")
32
+
33
+ content.append("Command: ", style="bold blue")
34
+ content.append(f"{command_info.command}\n\n", style="bold white")
35
+
36
+ if command_info.help_text:
37
+ content.append("Usage: ", style="bold magenta")
38
+ content.append(f"{command_info.help_text}\n\n", style="white")
39
+
40
+ if command_info.module_path:
41
+ content.append("Module: ", style="bold red")
42
+ content.append(f"{command_info.module_path}\n", style="white")
43
+
44
+ self.update(Panel(content, title=f"[bold]{command_info.name}[/bold]", border_style="blue"))
@@ -0,0 +1,470 @@
1
+ """
2
+ Command tree widget for displaying command hierarchy.
3
+ """
4
+
5
+ from textual.widgets import Tree
6
+ from machineconfig.scripts.python.helper_navigator.data_models import CommandInfo
7
+
8
+
9
+ class CommandTree(Tree[CommandInfo]):
10
+ """Tree widget for displaying command hierarchy."""
11
+
12
+ def on_mount(self) -> None:
13
+ """Build the command tree when mounted."""
14
+ self.show_root = False
15
+ self.guide_depth = 2
16
+ self._build_command_tree()
17
+
18
+ def _build_command_tree(self) -> None:
19
+ """Build the hierarchical command structure."""
20
+
21
+ # Main entry points
22
+ devops_node = self.root.add("🛠️ devops - DevOps operations", data=CommandInfo(
23
+ name="devops",
24
+ description="DevOps operations",
25
+ command="devops",
26
+ is_group=True,
27
+ module_path="machineconfig.scripts.python.devops"
28
+ ))
29
+
30
+ # devops subcommands
31
+ devops_node.add("📦 install - Install essential packages", data=CommandInfo(
32
+ name="install",
33
+ description="Install essential packages",
34
+ command="devops install",
35
+ parent="devops",
36
+ help_text="devops install --which <packages> --group <group> --interactive"
37
+ ))
38
+
39
+ repos_node = devops_node.add("📁 repos - Manage git repositories", data=CommandInfo(
40
+ name="repos",
41
+ description="Manage git repositories",
42
+ command="devops repos",
43
+ parent="devops",
44
+ is_group=True,
45
+ module_path="machineconfig.scripts.python.devops_helpers.cli_repos"
46
+ ))
47
+
48
+ # repos subcommands
49
+ repos_node.add("🚀 push - Push changes across repositories", data=CommandInfo(
50
+ name="push",
51
+ description="Push changes across repositories",
52
+ command="devops repos push",
53
+ parent="repos",
54
+ help_text="devops repos push --directory <dir> --recursive --no-sync"
55
+ ))
56
+
57
+ repos_node.add("⬇️ pull - Pull changes across repositories", data=CommandInfo(
58
+ name="pull",
59
+ description="Pull changes across repositories",
60
+ command="devops repos pull",
61
+ parent="repos",
62
+ help_text="devops repos pull --directory <dir> --recursive --no-sync"
63
+ ))
64
+
65
+ repos_node.add("💾 commit - Commit changes across repositories", data=CommandInfo(
66
+ name="commit",
67
+ description="Commit changes across repositories",
68
+ command="devops repos commit",
69
+ parent="repos",
70
+ help_text="devops repos commit --directory <dir> --recursive --no-sync"
71
+ ))
72
+
73
+ repos_node.add("🔄 sync - Sync changes across repositories", data=CommandInfo(
74
+ name="sync",
75
+ description="Pull, commit, and push changes across repositories",
76
+ command="devops repos sync",
77
+ parent="repos",
78
+ help_text="devops repos sync --directory <dir> --recursive --no-sync"
79
+ ))
80
+
81
+ mirror_node = repos_node.add("🔄 mirror - Manage repository specifications", data=CommandInfo(
82
+ name="mirror",
83
+ description="Manage repository specifications and syncing",
84
+ command="devops repos mirror",
85
+ parent="repos",
86
+ is_group=True
87
+ ))
88
+
89
+ mirror_node.add("📝 capture - Record repositories into repos.json", data=CommandInfo(
90
+ name="capture",
91
+ description="Record repositories into a repos.json specification",
92
+ command="devops repos mirror capture",
93
+ parent="mirror",
94
+ help_text="devops repos mirror capture --directory <dir> --cloud <cloud>"
95
+ ))
96
+
97
+ mirror_node.add("📥 clone - Clone repositories from repos.json", data=CommandInfo(
98
+ name="clone",
99
+ description="Clone repositories described by repos.json",
100
+ command="devops repos mirror clone",
101
+ parent="mirror",
102
+ help_text="devops repos mirror clone --directory <dir> --cloud <cloud>"
103
+ ))
104
+
105
+ mirror_node.add("🔀 checkout-to-commit - Check out specific commits", data=CommandInfo(
106
+ name="checkout-to-commit",
107
+ description="Check out specific commits listed in specification",
108
+ command="devops repos mirror checkout-to-commit",
109
+ parent="mirror",
110
+ help_text="devops repos mirror checkout-to-commit --directory <dir> --cloud <cloud>"
111
+ ))
112
+
113
+ mirror_node.add("🔀 checkout-to-branch - Check out to main branch", data=CommandInfo(
114
+ name="checkout-to-branch",
115
+ description="Check out to the main branch defined in specification",
116
+ command="devops repos mirror checkout-to-branch",
117
+ parent="mirror",
118
+ help_text="devops repos mirror checkout-to-branch --directory <dir> --cloud <cloud>"
119
+ ))
120
+
121
+ repos_node.add("🔍 analyze - Analyze repositories", data=CommandInfo(
122
+ name="analyze",
123
+ description="Analyze repositories in directory",
124
+ command="devops repos analyze",
125
+ parent="repos",
126
+ help_text="devops repos analyze --directory <dir>"
127
+ ))
128
+
129
+ repos_node.add("🔐 secure - Securely sync git repository", data=CommandInfo(
130
+ name="secure",
131
+ description="Securely sync git repository to/from cloud with encryption",
132
+ command="devops repos secure",
133
+ parent="repos",
134
+ help_text="devops repos secure <path> --cloud <cloud> --encrypt --decrypt"
135
+ ))
136
+
137
+ repos_node.add("🎬 viz - Visualize repository activity", data=CommandInfo(
138
+ name="viz",
139
+ description="Visualize repository activity using Gource",
140
+ command="devops repos viz",
141
+ parent="repos",
142
+ help_text="devops repos viz --repo <path> --output <file> --resolution <res> --seconds-per-day <spd>"
143
+ ))
144
+
145
+ repos_node.add("🧹 cleanup - Clean repository directories", data=CommandInfo(
146
+ name="cleanup",
147
+ description="Clean repository directories from cache files",
148
+ command="devops repos cleanup",
149
+ parent="repos",
150
+ help_text="devops repos cleanup --repo <path> --recursive"
151
+ ))
152
+
153
+ # config subcommands
154
+ config_node = devops_node.add("⚙️ config - Configuration management", data=CommandInfo(
155
+ name="config",
156
+ description="Configuration subcommands",
157
+ command="devops config",
158
+ parent="devops",
159
+ is_group=True
160
+ ))
161
+
162
+ config_node.add("🔗 private - Manage private configuration files", data=CommandInfo(
163
+ name="private",
164
+ description="Manage private configuration files",
165
+ command="devops config private",
166
+ parent="config",
167
+ help_text="devops config private --method <symlink|copy> --on-conflict <action> --which <items> --interactive"
168
+ ))
169
+
170
+ config_node.add("🔗 public - Manage public configuration files", data=CommandInfo(
171
+ name="public",
172
+ description="Manage public configuration files",
173
+ command="devops config public",
174
+ parent="config",
175
+ help_text="devops config public --method <symlink|copy> --on-conflict <action> --which <items> --interactive"
176
+ ))
177
+
178
+ config_node.add("🔗 dotfile - Manage dotfiles", data=CommandInfo(
179
+ name="dotfile",
180
+ description="Manage dotfiles",
181
+ command="devops config dotfile",
182
+ parent="config",
183
+ help_text="devops config dotfile <file> --overwrite --dest <destination>"
184
+ ))
185
+
186
+ config_node.add("🔗 shell - Configure shell profile", data=CommandInfo(
187
+ name="shell",
188
+ description="Configure your shell profile",
189
+ command="devops config shell",
190
+ parent="config",
191
+ help_text="devops config shell <copy|reference>"
192
+ ))
193
+
194
+ config_node.add("🔗 pwsh_theme - Configure PowerShell theme", data=CommandInfo(
195
+ name="pwsh_theme",
196
+ description="Configure your PowerShell theme",
197
+ command="devops config pwsh_theme",
198
+ parent="config",
199
+ help_text="devops config pwsh_theme"
200
+ ))
201
+
202
+ # data subcommands
203
+ data_node = devops_node.add("💾 data - Data operations", data=CommandInfo(
204
+ name="data",
205
+ description="Data subcommands",
206
+ command="devops data",
207
+ parent="devops",
208
+ is_group=True
209
+ ))
210
+
211
+ data_node.add("💾 backup - Backup data", data=CommandInfo(
212
+ name="backup",
213
+ description="Backup data",
214
+ command="devops data backup",
215
+ parent="data",
216
+ help_text="devops data backup"
217
+ ))
218
+
219
+ data_node.add("📥 retrieve - Retrieve data", data=CommandInfo(
220
+ name="retrieve",
221
+ description="Retrieve data from backup",
222
+ command="devops data retrieve",
223
+ parent="data",
224
+ help_text="devops data retrieve"
225
+ ))
226
+
227
+ # network subcommands
228
+ network_node = devops_node.add("🔐 network - Network operations", data=CommandInfo(
229
+ name="network",
230
+ description="Network subcommands",
231
+ command="devops network",
232
+ parent="devops",
233
+ is_group=True
234
+ ))
235
+
236
+ network_node.add("📡 share-terminal - Share terminal via web", data=CommandInfo(
237
+ name="share-terminal",
238
+ description="Share terminal via web browser",
239
+ command="devops network share-terminal",
240
+ parent="network",
241
+ help_text="devops network share-terminal"
242
+ ))
243
+
244
+ network_node.add("� install_ssh_server - Install SSH server", data=CommandInfo(
245
+ name="install_ssh_server",
246
+ description="Install SSH server",
247
+ command="devops network install_ssh_server",
248
+ parent="network",
249
+ help_text="devops network install_ssh_server"
250
+ ))
251
+
252
+ network_node.add("� add_ssh_key - Add SSH public key", data=CommandInfo(
253
+ name="add_ssh_key",
254
+ description="Add SSH public key to this machine",
255
+ command="devops network add_ssh_key",
256
+ parent="network",
257
+ help_text="devops network add_ssh_key --path <file> --choose --value --github <username>"
258
+ ))
259
+
260
+ network_node.add("�️ add_ssh_identity - Add SSH identity", data=CommandInfo(
261
+ name="add_ssh_identity",
262
+ description="Add SSH identity (private key) to this machine",
263
+ command="devops network add_ssh_identity",
264
+ parent="network",
265
+ help_text="devops network add_ssh_identity"
266
+ ))
267
+
268
+ # self subcommands
269
+ self_node = devops_node.add("🔄 self - SELF operations", data=CommandInfo(
270
+ name="self",
271
+ description="SELF operations subcommands",
272
+ command="devops self",
273
+ parent="devops",
274
+ is_group=True
275
+ ))
276
+
277
+ self_node.add("🔄 update - Update essential repos", data=CommandInfo(
278
+ name="update",
279
+ description="Update essential repos",
280
+ command="devops self update",
281
+ parent="self",
282
+ help_text="devops self update"
283
+ ))
284
+
285
+ self_node.add("🤖 interactive - Interactive configuration", data=CommandInfo(
286
+ name="interactive",
287
+ description="Interactive configuration of machine",
288
+ command="devops self interactive",
289
+ parent="self",
290
+ help_text="devops self interactive"
291
+ ))
292
+
293
+ self_node.add("📊 status - Machine status", data=CommandInfo(
294
+ name="status",
295
+ description="Status of machine, shell profile, apps, symlinks, dotfiles, etc.",
296
+ command="devops self status",
297
+ parent="self",
298
+ help_text="devops self status"
299
+ ))
300
+
301
+ self_node.add("📋 clone - Clone machineconfig", data=CommandInfo(
302
+ name="clone",
303
+ description="Clone machineconfig locally and incorporate to shell profile",
304
+ command="devops self clone",
305
+ parent="self",
306
+ help_text="devops self clone"
307
+ ))
308
+
309
+ self_node.add("📚 navigate - Navigate command structure", data=CommandInfo(
310
+ name="navigate",
311
+ description="Navigate command structure with TUI",
312
+ command="devops self navigate",
313
+ parent="self",
314
+ help_text="devops self navigate"
315
+ ))
316
+
317
+ # fire command
318
+ self.root.add("🔥 fire - Fire jobs execution", data=CommandInfo(
319
+ name="fire",
320
+ description="Execute Python scripts with Fire",
321
+ command="fire",
322
+ is_group=False,
323
+ module_path="machineconfig.scripts.python.fire_jobs",
324
+ help_text="fire <path> [function] --ve <env> --interactive --jupyter --streamlit --debug --loop --remote --zellij_tab <name>"
325
+ ))
326
+
327
+ # agents command
328
+ agents_node = self.root.add("🤖 agents - AI Agents management", data=CommandInfo(
329
+ name="agents",
330
+ description="AI Agents management subcommands",
331
+ command="agents",
332
+ is_group=True,
333
+ module_path="machineconfig.scripts.python.agents"
334
+ ))
335
+
336
+ agents_node.add("✨ create - Create AI agent", data=CommandInfo(
337
+ name="create",
338
+ description="Create a new AI agent",
339
+ command="agents create",
340
+ parent="agents",
341
+ help_text="agents create --context-path <file> --keyword-search <term> --filename-pattern <pattern> --agent <type> --machine <target> --model <model> --provider <provider> --prompt <text> --prompt-path <file> --job-name <name> --tasks-per-prompt <num> --separate-prompt-from-context --output-path <file> --agents-dir <dir>"
342
+ ))
343
+
344
+ agents_node.add("📦 collect - Collect agent data", data=CommandInfo(
345
+ name="collect",
346
+ description="Collect agent data",
347
+ command="agents collect",
348
+ parent="agents",
349
+ help_text="agents collect --agent-dir <dir> --output-path <file> --separator <sep>"
350
+ ))
351
+
352
+ agents_node.add("📝 make-template - Create agent template", data=CommandInfo(
353
+ name="make-template",
354
+ description="Create a template for fire agents",
355
+ command="agents make-template",
356
+ parent="agents",
357
+ help_text="agents make-template"
358
+ ))
359
+
360
+ agents_node.add("⚙️ make-config - Initialize AI configurations", data=CommandInfo(
361
+ name="make-config",
362
+ description="Initialize AI configurations in the current repository",
363
+ command="agents make-config",
364
+ parent="agents",
365
+ help_text="agents make-config"
366
+ ))
367
+
368
+ agents_node.add("📝 make-todo - Generate todo markdown", data=CommandInfo(
369
+ name="make-todo",
370
+ description="Generate a markdown file listing all Python files in the repo",
371
+ command="agents make-todo",
372
+ parent="agents",
373
+ help_text="agents make-todo"
374
+ ))
375
+
376
+ # sessions command
377
+ sessions_node = self.root.add("🖥️ sessions - Session layouts management", data=CommandInfo(
378
+ name="sessions",
379
+ description="Layouts management subcommands",
380
+ command="sessions",
381
+ is_group=True,
382
+ module_path="machineconfig.scripts.python.sessions"
383
+ ))
384
+
385
+ sessions_node.add("✨ create-from-function - Create layout from function", data=CommandInfo(
386
+ name="create-from-function",
387
+ description="Create layout from function",
388
+ command="sessions create-from-function",
389
+ parent="sessions",
390
+ help_text="sessions create-from-function"
391
+ ))
392
+
393
+ sessions_node.add("▶️ run - Run session layout", data=CommandInfo(
394
+ name="run",
395
+ description="Run session layout",
396
+ command="sessions run",
397
+ parent="sessions",
398
+ help_text="sessions run --layout-path <file> --max-tabs <num> --max-layouts <num> --sleep-inbetween <sec> --monitor --parallel --kill-upon-completion --choose <names> --choose-interactively"
399
+ ))
400
+
401
+ sessions_node.add("⚖️ balance-load - Balance load", data=CommandInfo(
402
+ name="balance-load",
403
+ description="Balance load across sessions",
404
+ command="sessions balance-load",
405
+ parent="sessions",
406
+ help_text="sessions balance-load --layout-path <file> --max-thresh <num> --thresh-type <number|weight> --breaking-method <moreLayouts|combineTabs> --output-path <file>"
407
+ ))
408
+
409
+ # cloud command
410
+ cloud_node = self.root.add("☁️ cloud - Cloud storage operations", data=CommandInfo(
411
+ name="cloud",
412
+ description="Cloud storage operations",
413
+ command="cloud",
414
+ is_group=True,
415
+ module_path="machineconfig.scripts.python.cloud"
416
+ ))
417
+
418
+ cloud_node.add("🔄 sync - Synchronize with cloud", data=CommandInfo(
419
+ name="sync",
420
+ description="Synchronize files/folders between local and cloud storage",
421
+ command="cloud sync",
422
+ parent="cloud",
423
+ help_text="cloud sync <source> <target> --cloud <provider> --recursive --exclude <patterns>"
424
+ ))
425
+
426
+ cloud_node.add("📤 copy - Copy to/from cloud", data=CommandInfo(
427
+ name="copy",
428
+ description="Copy files/folders to/from cloud storage",
429
+ command="cloud copy",
430
+ parent="cloud",
431
+ help_text="cloud copy <source> <target> --cloud <provider> --recursive --exclude <patterns>"
432
+ ))
433
+
434
+ cloud_node.add("🔗 mount - Mount cloud storage", data=CommandInfo(
435
+ name="mount",
436
+ description="Mount cloud storage as local drive",
437
+ command="cloud mount",
438
+ parent="cloud",
439
+ help_text="cloud mount <remote> <mount_point> --cloud <provider> --daemon --allow-other"
440
+ ))
441
+
442
+ # croshell command
443
+ self.root.add("� croshell - Interactive shell", data=CommandInfo(
444
+ name="croshell",
445
+ description="Interactive shell with various options",
446
+ command="croshell",
447
+ is_group=False,
448
+ module_path="machineconfig.scripts.python.croshell",
449
+ help_text="croshell --python --fzf --ve <env> --profile <profile> --read <file> --jupyter --streamlit --visidata"
450
+ ))
451
+
452
+ # ftpx command
453
+ self.root.add("📡 ftpx - File transfer", data=CommandInfo(
454
+ name="ftpx",
455
+ description="File transfer between machines",
456
+ command="ftpx",
457
+ is_group=False,
458
+ module_path="machineconfig.scripts.python.ftpx",
459
+ help_text="ftpx <source> <target> --recursive --zipFirst --cloud"
460
+ ))
461
+
462
+ # kill_process command
463
+ self.root.add("💀 kill_process - Kill processes", data=CommandInfo(
464
+ name="kill_process",
465
+ description="Kill running processes",
466
+ command="kill_process",
467
+ is_group=False,
468
+ module_path="machineconfig.utils.procs",
469
+ help_text="kill_process"
470
+ ))
@@ -0,0 +1,28 @@
1
+ """
2
+ Data models for the command navigator.
3
+ """
4
+
5
+ from typing import Optional
6
+ from dataclasses import dataclass
7
+
8
+
9
+ @dataclass
10
+ class CommandInfo:
11
+ """Information about a CLI command."""
12
+ name: str
13
+ description: str
14
+ command: str
15
+ parent: Optional[str] = None
16
+ is_group: bool = False
17
+ help_text: str = ""
18
+ module_path: str = ""
19
+
20
+
21
+ @dataclass
22
+ class ArgumentInfo:
23
+ """Information about a command argument."""
24
+ name: str
25
+ is_required: bool
26
+ is_flag: bool
27
+ placeholder: str = ""
28
+ description: str = ""