Test quak login and backup-metadata --exif (closes #110)
check / check (push) Successful in 42s

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
This commit was merged in pull request #125.
This commit is contained in:
2026-09-23 09:27:40 +02:00
parent ae76eb3f74
commit 7740ebfd4d
4 changed files with 174 additions and 16 deletions
+5
View File
@@ -1,6 +1,7 @@
#!/usr/bin/env node
import { stdout, stderr } from "node:process";
import { input, password } from "@inquirer/prompts";
import { Command } from "commander";
import envPaths from "env-paths";
import { init } from "../src/crypto/index.js";
@@ -20,6 +21,7 @@ import {
} from "../src/cli-commands.js";
import { run as runCommand } from "../src/cli-run.js";
import { loadSession } from "../src/cli-session.js";
import { Client } from "../src/client.js";
import { VERSION } from "../src/index.js";
const paths = envPaths("quak", { suffix: "" });
@@ -42,6 +44,9 @@ const context = (): CliContext => ({
sessionDir: paths.data,
cacheDir: program.opts<{ cacheDir?: string }>().cacheDir,
loadSession,
login: (opts) => Client.login(opts),
prompt: (message) => input({ message }),
promptSecret: (message) => password({ message, mask: true }),
});
const run = (command: Promise<number>): Promise<void> =>