agent-cli 0.65.1__py3-none-any.whl → 0.66.1__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.
@@ -0,0 +1,119 @@
1
+ """Install optional extras at runtime with pinned versions."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import shutil
6
+ import subprocess
7
+ import sys
8
+ from pathlib import Path
9
+ from typing import Annotated
10
+
11
+ import typer
12
+
13
+ from agent_cli.cli import app
14
+ from agent_cli.core.utils import console, print_error_message
15
+
16
+ # Extra name -> description mapping (used for docs generation)
17
+ EXTRAS: dict[str, str] = {
18
+ "rag": "RAG proxy (ChromaDB, embeddings)",
19
+ "memory": "Long-term memory proxy",
20
+ "vad": "Voice Activity Detection (silero-vad)",
21
+ "whisper": "Local Whisper ASR (faster-whisper)",
22
+ "whisper-mlx": "MLX Whisper for Apple Silicon",
23
+ "tts": "Local Piper TTS",
24
+ "tts-kokoro": "Kokoro neural TTS",
25
+ "server": "FastAPI server components",
26
+ "speed": "Audio speed adjustment (audiostretchy)",
27
+ }
28
+
29
+
30
+ def _requirements_dir() -> Path:
31
+ return Path(__file__).parent.parent / "_requirements"
32
+
33
+
34
+ def _available_extras() -> list[str]:
35
+ """List available extras based on requirements files."""
36
+ req_dir = _requirements_dir()
37
+ if not req_dir.exists():
38
+ return []
39
+ return sorted(p.stem for p in req_dir.glob("*.txt"))
40
+
41
+
42
+ def _requirements_path(extra: str) -> Path:
43
+ return _requirements_dir() / f"{extra}.txt"
44
+
45
+
46
+ def _in_virtualenv() -> bool:
47
+ """Check if running inside a virtual environment."""
48
+ return sys.prefix != sys.base_prefix
49
+
50
+
51
+ def _install_cmd() -> list[str]:
52
+ """Build the install command with appropriate flags."""
53
+ in_venv = _in_virtualenv()
54
+ if shutil.which("uv"):
55
+ cmd = ["uv", "pip", "install", "--python", sys.executable]
56
+ if not in_venv:
57
+ # Allow installing to system Python when not in a venv
58
+ cmd.append("--system")
59
+ return cmd
60
+ cmd = [sys.executable, "-m", "pip", "install"]
61
+ if not in_venv:
62
+ # Install to user site-packages when not in a venv
63
+ cmd.append("--user")
64
+ return cmd
65
+
66
+
67
+ @app.command("install-extras", rich_help_panel="Installation")
68
+ def install_extras(
69
+ extras: Annotated[list[str] | None, typer.Argument(help="Extras to install")] = None,
70
+ list_extras: Annotated[
71
+ bool,
72
+ typer.Option("--list", "-l", help="List available extras"),
73
+ ] = False,
74
+ all_extras: Annotated[
75
+ bool,
76
+ typer.Option("--all", "-a", help="Install all available extras"),
77
+ ] = False,
78
+ ) -> None:
79
+ """Install optional extras (rag, memory, vad, etc.) with pinned versions.
80
+
81
+ Examples:
82
+ agent-cli install-extras rag # Install RAG dependencies
83
+ agent-cli install-extras memory vad # Install multiple extras
84
+ agent-cli install-extras --list # Show available extras
85
+ agent-cli install-extras --all # Install all extras
86
+
87
+ """
88
+ available = _available_extras()
89
+
90
+ if list_extras:
91
+ console.print("[bold]Available extras:[/]")
92
+ for name in available:
93
+ desc = EXTRAS.get(name, "")
94
+ console.print(f" [cyan]{name}[/]: {desc}")
95
+ return
96
+
97
+ if all_extras:
98
+ extras = available
99
+
100
+ if not extras:
101
+ print_error_message("No extras specified. Use --list to see available, or --all.")
102
+ raise typer.Exit(1)
103
+
104
+ invalid = [e for e in extras if e not in available]
105
+ if invalid:
106
+ print_error_message(f"Unknown extras: {invalid}. Use --list to see available.")
107
+ raise typer.Exit(1)
108
+
109
+ cmd = _install_cmd()
110
+
111
+ for extra in extras:
112
+ req_file = _requirements_path(extra)
113
+ console.print(f"Installing [cyan]{extra}[/]...")
114
+ result = subprocess.run([*cmd, "-r", str(req_file)], check=False)
115
+ if result.returncode != 0:
116
+ print_error_message(f"Failed to install '{extra}'")
117
+ raise typer.Exit(1)
118
+
119
+ console.print("[green]Done![/]")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agent-cli
3
- Version: 0.65.1
3
+ Version: 0.66.1
4
4
  Summary: A suite of AI-powered command-line tools for text correction, audio transcription, and voice assistance.
5
5
  Project-URL: Homepage, https://github.com/basnijholt/agent-cli
6
6
  Author-email: Bas Nijholt <bas@nijho.lt>
@@ -231,6 +231,7 @@ The setup scripts automatically install:
231
231
  - [Alternative Local LLM Servers](#alternative-local-llm-servers)
232
232
  - [Usage](#usage)
233
233
  - [Installation Commands](#installation-commands)
234
+ - [Installing Optional Extras](#installing-optional-extras)
234
235
  - [Configuration](#configuration)
235
236
  - [Managing Configuration](#managing-configuration)
236
237
  - [Provider Defaults](#provider-defaults)
@@ -446,10 +447,62 @@ These commands help you set up `agent-cli` and its required services:
446
447
 
447
448
  - **`install-services`**: Install all required AI services (Ollama, Whisper, Piper, OpenWakeWord)
448
449
  - **`install-hotkeys`**: Set up system-wide hotkeys for quick access to agent-cli features
450
+ - **`install-extras`**: Install optional Python dependencies (rag, memory, vad, etc.) with pinned versions
449
451
  - **`start-services`**: Start all services in a Zellij terminal session
450
452
 
451
453
  All necessary scripts are bundled with the package, so you can run these commands immediately after installing `agent-cli`.
452
454
 
455
+ #### Installing Optional Extras
456
+
457
+ Some features require additional Python dependencies. Use `install-extras` to install them with pinned versions:
458
+
459
+ ```bash
460
+ # List available extras
461
+ agent-cli install-extras --list
462
+
463
+ # Install specific extras
464
+ agent-cli install-extras rag memory vad
465
+ ```
466
+
467
+ <details>
468
+ <summary>See the output of <code>agent-cli install-extras --help</code></summary>
469
+
470
+ <!-- CODE:BASH:START -->
471
+ <!-- echo '```yaml' -->
472
+ <!-- export NO_COLOR=1 -->
473
+ <!-- export TERM=dumb -->
474
+ <!-- export COLUMNS=90 -->
475
+ <!-- export TERMINAL_WIDTH=90 -->
476
+ <!-- agent-cli install-extras --help -->
477
+ <!-- echo '```' -->
478
+ <!-- CODE:END -->
479
+ <!-- OUTPUT:START -->
480
+ <!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->
481
+ ```yaml
482
+
483
+ Usage: agent-cli install-extras [OPTIONS] [EXTRAS]...
484
+
485
+ Install optional extras (rag, memory, vad, etc.) with pinned versions.
486
+
487
+ Examples: agent-cli install-extras rag # Install RAG dependencies agent-cli
488
+ install-extras memory vad # Install multiple extras agent-cli install-extras --list
489
+ # Show available extras agent-cli install-extras --all # Install all extras
490
+
491
+ ╭─ Arguments ────────────────────────────────────────────────────────────────────────────╮
492
+ │ extras [EXTRAS]... Extras to install │
493
+ ╰────────────────────────────────────────────────────────────────────────────────────────╯
494
+ ╭─ Options ──────────────────────────────────────────────────────────────────────────────╮
495
+ │ --list -l List available extras │
496
+ │ --all -a Install all available extras │
497
+ │ --help -h Show this message and exit. │
498
+ ╰────────────────────────────────────────────────────────────────────────────────────────╯
499
+
500
+ ```
501
+
502
+ <!-- OUTPUT:END -->
503
+
504
+ </details>
505
+
453
506
  ### Configuration
454
507
 
455
508
  All `agent-cli` commands can be configured using a TOML file. The configuration file is searched for in the following locations, in order:
@@ -2,14 +2,24 @@ agent_cli/__init__.py,sha256=-bo57j_5TsCug2tGHh7wClAGDhzN239639K40pgVh4g,187
2
2
  agent_cli/__main__.py,sha256=2wx_SxA8KRdejM-hBFLN8JTR2rIgtwnDH03MPAbJH5U,106
3
3
  agent_cli/_tools.py,sha256=u9Ww-k-sbwFnMTW8sreFGd71nJP6o5hKcM0Zd_D9GZk,12136
4
4
  agent_cli/api.py,sha256=FQ_HATc7DaedbEFQ275Z18wV90tkDByD_9x_K0wdSLQ,456
5
- agent_cli/cli.py,sha256=OsjgqoWkxafbNbugzULv1dJLyAZcxPZ_9wnZ22BdIN8,2731
5
+ agent_cli/cli.py,sha256=zCk7sVVZstTU3GHFXAavcXd8Kactav4x0PyVY_rX4SI,2739
6
6
  agent_cli/config.py,sha256=dgwDV6chrQzGnVZIJ0OOg26jFKLCGIInC4Q9oXcj3rM,15413
7
7
  agent_cli/config_cmd.py,sha256=Fb-KBjtveft3x3_xjqlqobBwZqtI6Umrd8YzlwTAnZ4,9554
8
8
  agent_cli/constants.py,sha256=-Q17N6qKIGqPDsu3FxpIKP33G0Cs0RUJlHwYNHxVxek,843
9
- agent_cli/docs_gen.py,sha256=24NDnKcxdz0EarpuoIVtd0AeLIT8CTku5GLeAJRUyg8,14444
9
+ agent_cli/docs_gen.py,sha256=n6QMPFZK0prpz2cGgo2yXX_I29p-l0jPGEbHZDZ-NUc,14809
10
10
  agent_cli/example-config.toml,sha256=xd9BXeOqdYx4xFJt58VBs2I49ESy6dF4-mWF_g8sM9o,7552
11
11
  agent_cli/opts.py,sha256=qMK_mLxzGAbX7C2IYuCFvOkLgaxCCMO66I9ps8AdrYo,12114
12
12
  agent_cli/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
+ agent_cli/_requirements/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ agent_cli/_requirements/memory.txt,sha256=LmX0uKxnKuLTcZg5TESJ4n7AWrar7iMspONskvyiDTY,8860
15
+ agent_cli/_requirements/rag.txt,sha256=e45zy2Xn6csCd0qJuuHYkMgNQXPgNHk6SElz8LtezC0,9656
16
+ agent_cli/_requirements/server.txt,sha256=DbgthcQ2CufWaaFu-spq9Ow14rqdT5XO05licQNoeMA,5127
17
+ agent_cli/_requirements/speed.txt,sha256=U1sdmglUJxhg_ZmxPc-iaJ38dpt5xP6sLG8CVnSDeyY,3642
18
+ agent_cli/_requirements/tts-kokoro.txt,sha256=3BooGvCXgub0y2olZuoeOkoL-xyvU9WzYw9CaWRmZGE,10848
19
+ agent_cli/_requirements/tts.txt,sha256=wqefgl9Amh3xsVLJHJPbtgJUpPZqf6lr9zuC6jjTEU8,5569
20
+ agent_cli/_requirements/vad.txt,sha256=-nyWylzzLYyC0fBONsZf6HUhqkXxb2WsKpZlueFmwyg,6195
21
+ agent_cli/_requirements/whisper-mlx.txt,sha256=sE229FmA91RACIEMG2cMNiWcsawbXvbglit8I395f_Q,7096
22
+ agent_cli/_requirements/whisper.txt,sha256=CKgk5iOjB4MMKor4eCcrhTDkDJbYMbQXU-TfZHeVWKA,6283
13
23
  agent_cli/agents/__init__.py,sha256=c1rnncDW5pBvP6BiLzFVpLWDNZzFRaUA7-a97avFVAs,321
14
24
  agent_cli/agents/_voice_agent_common.py,sha256=PUAztW84Xf9U7d0C_K5cL7I8OANIE1H6M8dFD_cRqps,4360
15
25
  agent_cli/agents/assistant.py,sha256=BMF693kUZxM7u7mcI0nVua0EpqFcGlby2cMMZeLT7hY,13965
@@ -76,8 +86,9 @@ agent_cli/dev/terminals/registry.py,sha256=B27XjELpinLLf2PmwWxpAmnXf6KEXan4d2FDw
76
86
  agent_cli/dev/terminals/tmux.py,sha256=IciviwSoIb_KfKgS1q8iq_cK5iRgoz8vZuoNLAvcKJg,1498
77
87
  agent_cli/dev/terminals/warp.py,sha256=j-Jvz_BbWYC3QfLrvl4CbDh03c9OGRFmuCzjyB2udyo,4294
78
88
  agent_cli/dev/terminals/zellij.py,sha256=GnQnopimb9XH67CZGHjnbVWpVSWhaLCATGJizCT5TkY,2321
79
- agent_cli/install/__init__.py,sha256=wWv8GkkCy-WyI9QqctwwIE82J9kbMjSk3OWuxu_r2L0,114
89
+ agent_cli/install/__init__.py,sha256=JQPrOrtdNd1Y1NmQDkb3Nmm1qdyn3kPjhQwy9D8ryjI,124
80
90
  agent_cli/install/common.py,sha256=WvnmcjnFTW0d1HZrKVGzj5Tg3q8Txk_ZOdc4a1MBFWI,3121
91
+ agent_cli/install/extras.py,sha256=qdj3NjdzJrgA5gE0MzQUEdxBve0L1I5dxTmC2-527YI,3755
81
92
  agent_cli/install/hotkeys.py,sha256=bwGoPeEKK6VI-IrKU8Q0RLMW9smkDNU7CdqD3Nbsd-w,1626
82
93
  agent_cli/install/services.py,sha256=2s_7ThxaElKCuomBYTn4Z36TF_o_arNeyJ4f8Wh4jEI,2912
83
94
  agent_cli/memory/__init__.py,sha256=Q9lomqabThXFx-j_Yu3xKDyKLN4Odck92J6WDP53yUI,610
@@ -173,8 +184,8 @@ agent_cli/services/asr.py,sha256=V6SV-USnMhK-0aE-pneiktU4HpmLqenmMb-jZ-_74zU,169
173
184
  agent_cli/services/llm.py,sha256=Kwdo6pbMYI9oykF-RBe1iaL3KsYrNWTLdRSioewmsGQ,7199
174
185
  agent_cli/services/tts.py,sha256=exKo-55_670mx8dQOzVSZkv6aWYLv04SVmBcjOlD458,14772
175
186
  agent_cli/services/wake_word.py,sha256=j6Z8rsGq_vAdRevy9fkXIgLZd9UWfrIsefmTreNmM0c,4575
176
- agent_cli-0.65.1.dist-info/METADATA,sha256=ykG3jy2UI4XUvEk0VMnRJvbDXeJRnow_pXetASZ7hrg,152627
177
- agent_cli-0.65.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
178
- agent_cli-0.65.1.dist-info/entry_points.txt,sha256=FUv-fB2atLsPUk_RT4zqnZl1coz4_XHFwRALOKOF38s,97
179
- agent_cli-0.65.1.dist-info/licenses/LICENSE,sha256=majJU6S9kC8R8bW39NVBHyv32Dq50FL6TDxECG2WVts,1068
180
- agent_cli-0.65.1.dist-info/RECORD,,
187
+ agent_cli-0.66.1.dist-info/METADATA,sha256=WvTItFU9nOIQicSgJ_t2HbbCOuYfb6tJ3ONIk3l7VHg,155374
188
+ agent_cli-0.66.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
189
+ agent_cli-0.66.1.dist-info/entry_points.txt,sha256=FUv-fB2atLsPUk_RT4zqnZl1coz4_XHFwRALOKOF38s,97
190
+ agent_cli-0.66.1.dist-info/licenses/LICENSE,sha256=majJU6S9kC8R8bW39NVBHyv32Dq50FL6TDxECG2WVts,1068
191
+ agent_cli-0.66.1.dist-info/RECORD,,