Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

1.2 KB
Raw Blame
"""Sidecar entry: ``python -m dodaios.appshot.picker``.

Guards the PySide6 import so a host without the GUI stack exits with
``EXIT_NO_GUI`` and one English line on stderr instead of a traceback.
"""

from __future__ import annotations

import argparse
import sys

from dodaios.appshot.picker import EXIT_NO_GUI


def main(argv: list[str] | None = None) -> int:
    parser = argparse.ArgumentParser(prog="dodaios.appshot.picker")
    # Accepted and ignored: a main process started before the picker lost its
    # banner still passes it until the app restarts.
    parser.add_argument("--hint", default="")
    # The toolbar's tooltip language ([ui].language); English when absent.
    parser.add_argument("--lang", default="en")
    parser.add_argument("--resident", action="store_true")
    args = parser.parse_args(argv)
    try:
        from dodaios.appshot.picker.renderer import run  # noqa: PLC0415
    except ImportError as exc:
        sys.stderr.write(
            f"appshot-picker: PySide6 unavailable ({exc}). Install the [desktop] "
            "extra to select an area for an appshot.\n"
        )
        return EXIT_NO_GUI
    return run(args.lang, resident=args.resident)


if __name__ == "__main__":
    raise SystemExit(main())