Skip to content

"CLI-Anything: Making ALL Software Agent-Native" -- CLI-Hub: https://clianything.cc/

Python

fix(repl): use shlex.split for REPL input parsing across 9 harnesses

warren61868241f9c30e9
diff --git a/audacity/agent-harness/cli_anything/audacity/audacity_cli.py b/audacity/agent-harness/cli_anything/audacity/audacity_cli.py
index 4e5aac2b3..21ef8e28b 100644
--- a/audacity/agent-harness/cli_anything/audacity/audacity_cli.py
+++ b/audacity/agent-harness/cli_anything/audacity/audacity_cli.py
@@ -19,6 +19,7 @@ Usage:
import sys
import os
import json
+import shlex
import click
from typing import Optional
@@ -759,7 +760,10 @@ def repl(project_path):
_repl_help(skin)
continue
- args = line.split()
+ try:
+ args = shlex.split(line)
+ except ValueError:
+ args = line.split()
try:
cli.main(args, standalone_mode=False)
except SystemExit:
diff --git a/blender/agent-harness/cli_anything/blender/blender_cli.py b/blender/agent-harness/cli_anything/blender/blender_cli.py
index d9a4d114e..668e01f3e 100644
--- a/blender/agent-harness/cli_anything/blender/blender_cli.py
+++ b/blender/agent-harness/cli_anything/blender/blender_cli.py
@@ -17,6 +17,7 @@ Usage:
import sys
import os
import json
+import shlex
import click
from typing import Optional
@@ -896,8 +897,11 @@ def repl(project_path):
skin.help(_repl_commands)
continue
- # Parse and execute command
- args = line.split()
+ # Parse and execute command (shlex handles quoted strings with spaces)
+ try:
+ args = shlex.split(line)
+ except ValueError:
+ args = line.split()
try:
cli.main(args, standalone_mode=False)
except SystemExit:
diff --git a/comfyui/agent-harness/cli_anything/comfyui/comfyui_cli.py b/comfyui/agent-harness/cli_anything/comfyui/comfyui_cli.py
index ea86ac1a2..78b8799e1 100644
--- a/comfyui/agent-harness/cli_anything/comfyui/comfyui_cli.py
+++ b/comfyui/agent-harness/cli_anything/comfyui/comfyui_cli.py
@@ -27,6 +27,7 @@ Usage:
import sys
import os
import json
+import shlex
import click
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
@@ -385,7 +386,10 @@ def repl():
click.echo(f" {cmd:<12} {subs}")
continue
- args = line.split()
+ try:
+ args = shlex.split(line)
+ except ValueError:
+ args = line.split()
try:
cli.main(args, standalone_mode=False)
except SystemExit:
diff --git a/inkscape/agent-harness/cli_anything/inkscape/inkscape_cli.py b/inkscape/agent-harness/cli_anything/inkscape/inkscape_cli.py
index 6caf625a4..1a694f1d0 100644
--- a/inkscape/agent-harness/cli_anything/inkscape/inkscape_cli.py
+++ b/inkscape/agent-harness/cli_anything/inkscape/inkscape_cli.py
@@ -17,6 +17,7 @@ Usage:
import sys
import os
import json
+import shlex
import click
from typing import Optional
@@ -1006,7 +1007,10 @@ def repl(project_path):
_repl_help(skin)
continue
- args = line.split()
+ try:
+ args = shlex.split(line)
+ except ValueError:
+ args = line.split()
try:
cli.main(args, standalone_mode=False)
except SystemExit:
diff --git a/kdenlive/agent-harness/cli_anything/kdenlive/kdenlive_cli.py b/kdenlive/agent-harness/cli_anything/kdenlive/kdenlive_cli.py
index a8cbc6c04..7d63c2913 100644
--- a/kdenlive/agent-harness/cli_anything/kdenlive/kdenlive_cli.py
+++ b/kdenlive/agent-harness/cli_anything/kdenlive/kdenlive_cli.py
@@ -17,6 +17,7 @@ Usage:
import sys
import os
import json
+import shlex
import click
from typing import Optional
@@ -712,7 +713,10 @@ def repl(project_path):
skin.help(commands_dict)
continue
- args = line.split()
+ try:
+ args = shlex.split(line)
+ except ValueError:
+ args = line.split()
try:
cli.main(args, standalone_mode=False)
except SystemExit:
diff --git a/libreoffice/agent-harness/cli_anything/libreoffice/libreoffice_cli.py b/libreoffice/agent-harness/cli_anything/libreoffice/libreoffice_cli.py
index 8f9781d2d..3eaa71101 100644
--- a/libreoffice/agent-harness/cli_anything/libreoffice/libreoffice_cli.py
+++ b/libreoffice/agent-harness/cli_anything/libreoffice/libreoffice_cli.py
@@ -17,6 +17,7 @@ Usage:
import sys
import os
import json
+import shlex
import click
from typing import Optional
@@ -703,7 +704,10 @@ def repl(project_path):
_repl_help(skin)
continue
- args = line.split()
+ try:
+ args = shlex.split(line)
+ except ValueError:
+ args = line.split()
try:
cli.main(args, standalone_mode=False)
except SystemExit:
diff --git a/obs-studio/agent-harness/cli_anything/obs_studio/obs_studio_cli.py b/obs-studio/agent-harness/cli_anything/obs_studio/obs_studio_cli.py
index 727f32d5d..fef144c61 100644
--- a/obs-studio/agent-harness/cli_anything/obs_studio/obs_studio_cli.py
+++ b/obs-studio/agent-harness/cli_anything/obs_studio/obs_studio_cli.py
@@ -17,6 +17,7 @@ Usage:
import sys
import os
import json
+import shlex
import click
from typing import Optional
@@ -800,7 +801,10 @@ def repl(project_path):
_repl_help(skin)
continue
- args = line.split()
+ try:
+ args = shlex.split(line)
+ except ValueError:
+ args = line.split()
try:
cli.main(args, standalone_mode=False)
except SystemExit:
diff --git a/ollama/agent-harness/cli_anything/ollama/ollama_cli.py b/ollama/agent-harness/cli_anything/ollama/ollama_cli.py
index 3512dd683..f0a785591 100644
--- a/ollama/agent-harness/cli_anything/ollama/ollama_cli.py
+++ b/ollama/agent-harness/cli_anything/ollama/ollama_cli.py
@@ -17,6 +17,7 @@ Usage:
import sys
import os
import json
+import shlex
import click
from typing import Optional
@@ -467,8 +468,11 @@ def repl():
skin.help(_repl_commands)
continue
- # Parse and execute command
- args = line.split()
+ # Parse and execute command (shlex handles quoted strings with spaces)
+ try:
+ args = shlex.split(line)
+ except ValueError:
+ args = line.split()
try:
cli.main(args, standalone_mode=False)
except SystemExit:
diff --git a/zoom/agent-harness/cli_anything/zoom/zoom_cli.py b/zoom/agent-harness/cli_anything/zoom/zoom_cli.py
index 66ed558bb..c64d88a2a 100644
--- a/zoom/agent-harness/cli_anything/zoom/zoom_cli.py
+++ b/zoom/agent-harness/cli_anything/zoom/zoom_cli.py
@@ -25,6 +25,7 @@ Usage:
import sys
import os
import json
+import shlex
import webbrowser
import click
from typing import Optional
@@ -486,8 +487,11 @@ def repl():
skin.help(_repl_commands)
continue
- # Parse and execute command
- args = line.split()
+ # Parse and execute command (shlex handles quoted strings with spaces)
+ try:
+ args = shlex.split(line)
+ except ValueError:
+ args = line.split()
try:
cli.main(args, standalone_mode=False)
except SystemExit: