INNER CODE UNIT · Python
run
renezander030/capcut-cli · python/capcut/__init__.py:207
def run(cmd: str, *args: Any, **kwargs: Any) -> Any:
"""Run one command; return its parsed JSON (or the ``-H`` text). Raise :class:`CommandError` on a non-zero exit."""
result = run_raw(cmd, *args, **kwargs)
if not result.ok:
raise CommandError(result)
return result.data if result.data is not None else result.stdout
def version() -> str:
"""The installed capcut-cli version, e.g. ``"0.25.0"``."""
result = run_raw("--version")
if not result.ok:
raise CommandError(result)
return result.stdout.strip()
def describe() -> Any:
"""The full command surface as JSON (``capcut describe``): names, usage, options, exit codes."""