spacr.qt.ai.pty_sign_in¶
Sign in to an AI command-line tool without leaving spaCR.
The goal is a tool installed, logged in and marked READY with no terminal used. The Claude, GPT and Gemini command-line tools sign in by conversation – a web page to confirm in, sometimes a code to paste back – and they only hold that conversation with a TERMINAL, which is why spaCR used to open one. A pseudo-terminal is a terminal as far as the tool can tell, so the sign-in is run on one here, inside a small window: the web page the tool prints is opened, what it asks is shown, and the answer is typed into a box and sent.
POSIX only (Linux, macOS), where a pseudo-terminal is part of the standard library. On Windows the caller falls back to opening a terminal, as before.
Classes¶
One command running on a pseudo-terminal, read off its own thread. |
|
A tool's sign-in, held inside spaCR. |
Functions¶
|
Every web address in |
|
Whether a sign-in can run on a pseudo-terminal here. |
|
|
Module Contents¶
- class spacr.qt.ai.pty_sign_in.PtySession(argv: Sequence[str], env: Dict[str, str] | None = None)[source]¶
One command running on a pseudo-terminal, read off its own thread.
- Parameters:
argv – the command.
env – its environment; the current one when None.
Start
argv; output collects inread().
- class spacr.qt.ai.pty_sign_in.SignInDialog(title: str, argv: Sequence[str], parent=None, *, session_factory=None, open_url=None)[source]¶
Bases:
PySide6.QtWidgets.QDialogA tool’s sign-in, held inside spaCR.
- Parameters:
title – what is being signed in to, e.g.
"Claude".argv – the tool’s own sign-in command.
parent – the window it belongs to.
session_factory –
fn(argv) -> PtySession, for tests.open_url –
fn(url); opens the system browser when None.
Start the sign-in and show what it says.
- spacr.qt.ai.pty_sign_in.find_urls(text: str) List[str][source]¶
Every web address in
text, in order, without trailing punctuation.- Parameters:
text – terminal output, escape sequences removed.
- Returns:
the addresses.