INNER CODE UNIT · Python

argv

renezander030/capcut-cli · python/capcut/__init__.py:199

    argv = cli_command() + [cmd] + argv_args
    proc = _spawn(argv, input=input, timeout=timeout, cwd=cwd)
    data = None if human else _parse(proc.stdout)
    if data is None and proc.returncode != 0:
        data = _parse(proc.stderr)  # the CLI prints {"error": ...} on stderr
    return Result(cmd=cmd, args=argv_args, status=proc.returncode, stdout=proc.stdout, stderr=proc.stderr, data=data)


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"``."""

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…