loginCommand now gets its login function and its prompts from CliContext (login, prompt, promptSecret). bin/quak.ts passes Client.login and the terminal prompts, so the command behaves as before. The terminal prompt import moved from src/cli-commands.ts to bin/quak.ts with them.
New tests in test/cli/commands.test.ts:
login with QUAK_EMAIL and QUAK_PASSWORD set shows no prompt and prints the usual lines
the session saved by login has mode 0600 in a 0700 directory
an account that needs TOTP gets the TOTP code: prompt
a failed login exits 1, prints Login failed: ..., and writes no session file
--exif and --all each turn on EXIF extraction, and it is off without either flag. The tests check this by the command's Extracting EXIF... progress line.
The shared test context gets login and prompt functions that throw, so any other command that tried to log in or prompt would fail its test.
Also rewrapped the header comment of src/cli-commands.ts, which broke mid-sentence.
Judgement call: the environment variables are set in the tests with vi.stubEnv, not passed through the context. The issue only asked for the login function and the prompts to be passed in.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/quak/issues/110.
`loginCommand` now gets its login function and its prompts from `CliContext` (`login`, `prompt`, `promptSecret`). `bin/quak.ts` passes `Client.login` and the terminal prompts, so the command behaves as before. The terminal prompt import moved from `src/cli-commands.ts` to `bin/quak.ts` with them.
New tests in `test/cli/commands.test.ts`:
- login with `QUAK_EMAIL` and `QUAK_PASSWORD` set shows no prompt and prints the usual lines
- the session saved by login has mode `0600` in a `0700` directory
- an account that needs TOTP gets the `TOTP code: ` prompt
- a failed login exits 1, prints `Login failed: ...`, and writes no session file
- `--exif` and `--all` each turn on EXIF extraction, and it is off without either flag. The tests check this by the command's `Extracting EXIF...` progress line.
The shared test context gets `login` and prompt functions that throw, so any other command that tried to log in or prompt would fail its test.
Also rewrapped the header comment of `src/cli-commands.ts`, which broke mid-sentence.
Judgement call: the environment variables are set in the tests with `vi.stubEnv`, not passed through the context. The issue only asked for the login function and the prompts to be passed in.
Model: opus-5-5
clawbot
self-assigned this 2026-09-23 08:58:25 +02:00
loginCommand now takes its login function and prompts from CliContext;
bin/quak.ts passes Client.login and the terminal prompts, so behaviour is
unchanged. Tests cover a login from QUAK_EMAIL/QUAK_PASSWORD with no
prompt, the TOTP prompt, a failed login, and the saved session's modes,
and show that --exif and --all each turn on EXIF extraction. Also rewraps
the header comment of src/cli-commands.ts.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #110.
loginCommandnow gets its login function and its prompts fromCliContext(login,prompt,promptSecret).bin/quak.tspassesClient.loginand the terminal prompts, so the command behaves as before. The terminal prompt import moved fromsrc/cli-commands.tstobin/quak.tswith them.New tests in
test/cli/commands.test.ts:QUAK_EMAILandQUAK_PASSWORDset shows no prompt and prints the usual lines0600in a0700directoryTOTP code:promptLogin failed: ..., and writes no session file--exifand--alleach turn on EXIF extraction, and it is off without either flag. The tests check this by the command'sExtracting EXIF...progress line.The shared test context gets
loginand prompt functions that throw, so any other command that tried to log in or prompt would fail its test.Also rewrapped the header comment of
src/cli-commands.ts, which broke mid-sentence.Judgement call: the environment variables are set in the tests with
vi.stubEnv, not passed through the context. The issue only asked for the login function and the prompts to be passed in.Model: opus-5-5
PASS on
f440caarebased ontonext2ae76eb3.Model: opus-5-5