Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Improve CLI help and noninteractive input

Manav Rathi002553adb575
diff --git a/rust/apps/cli-next/src/args.rs b/rust/apps/cli-next/src/args.rs
index ccad86918b..ad04c57fb1 100644
--- a/rust/apps/cli-next/src/args.rs
+++ b/rust/apps/cli-next/src/args.rs
@@ -1,4 +1,4 @@
-use std::{num::NonZeroUsize, path::PathBuf};
+use std::{io::IsTerminal, num::NonZeroUsize, path::PathBuf};
use clap::{Args, Parser, Subcommand};
use serde::{Deserialize, Serialize};
@@ -7,7 +7,15 @@ use serde::{Deserialize, Serialize};
#[command(
version,
about = "Use Ente from the command line",
- after_help = "Start with: ente-cli-next photos login"
+ override_usage = "ente-cli-next [OPTIONS] <COMMAND>",
+ after_help = "Photos:
+ ente-cli-next photos login
+ ente-cli-next photos album list
+ ente-cli-next photos file list --album <ID>
+ ente-cli-next photos export <DIR>
+Auth backups:
+ ente-cli-next auth login
+ ente-cli-next auth export <DIR>"
)]
pub struct Cli {
#[command(flatten)]
@@ -22,6 +30,14 @@ pub struct Options {
pub json: bool,
#[arg(long, global = true, help = "Use local data without network access")]
pub offline: bool,
+ #[arg(long, global = true, help = "Disable interactive prompts")]
+ pub no_input: bool,
+}
+
+impl Options {
+ pub fn can_prompt(&self) -> bool {
+ !self.no_input && std::io::stdin().is_terminal() && std::io::stderr().is_terminal()
+ }
}
pub const DEFAULT_LIST_LIMIT: u32 = 100;
@@ -32,7 +48,7 @@ pub struct ListArgs {
long,
default_value_t = DEFAULT_LIST_LIMIT,
value_parser = clap::value_parser!(u32).range(1..),
- help = "Maximum number of results"
+ help = "Maximum number of results; does not limit metadata refresh"
)]
pub limit: u32,
#[arg(long, conflicts_with = "limit", help = "List every result")]
@@ -65,7 +81,7 @@ pub enum Command {
#[command(subcommand)]
command: PhotosCommand,
},
- #[command(about = "Manage Ente Locker")]
+ #[command(about = "Manage Locker sessions and make API requests")]
Locker {
#[command(flatten)]
selector: AccountSelector,
@@ -103,8 +119,18 @@ pub enum AuthCommand {
#[command(flatten)]
Session(SessionCommand),
#[command(about = "Export your Auth codes; encrypted by default")]
+ #[command(
+ after_long_help = "Refreshes Auth data first; --offline uses previously synced data.
+Set ENTE_CLI_EXPORT_PASSWORD for encrypted export with --no-input.
+DIR receives dated backups. --output writes a new file, or backup bytes to stdout with -.
+--json formats file/directory summaries; stdout backups contain only the artifact."
+ )]
Export(AuthExportArgs),
#[command(about = "Decrypt an Auth export without an account")]
+ #[command(
+ after_long_help = "Reads a backup without network access. Set ENTE_CLI_EXPORT_PASSWORD with --no-input.
+Writes readable URI lines to stdout, or a new --output file. --json only formats the file summary."
+ )]
Decrypt {
#[arg(value_name = "PATH", help = "Encrypted Auth backup to decrypt")]
input: PathBuf,
@@ -147,6 +173,10 @@ pub enum PhotosCommand {
#[derive(Subcommand)]
pub enum PhotosLibraryCommand {
#[command(about = "Maintain an independent copy of your Photos library")]
+ #[command(
+ after_long_help = "Refreshes metadata and downloads originals to DESTINATION; requires network access.
+Progress goes to stderr; the result goes to stdout. Use --json for a structured result."
+ )]
Export(ExportArgs),
#[command(about = "Manage albums")]
Album {
@@ -190,7 +220,7 @@ pub struct ExportArgs {
help = "Maximum number of files processed concurrently"
)]
pub jobs: NonZeroUsize,
- #[arg(value_name = "DESTINATION")]
+ #[arg(value_name = "DESTINATION", help = "Directory for the Photos export")]
pub destination: PathBuf,
}
@@ -201,7 +231,9 @@ pub enum SessionCommand {
after_help = "Non-interactive login reads JSON from --input:
{\"email\": \"...\", \"password\": \"...\", \"otp\": \"123456\", \"totp\": \"654321\"}
-otp is the email code. totp is the authenticator code. Include them only when required."
+All fields are strings. otp is the email code; totp is the authenticator code. Supply them when required.
+With --no-input, supply email and password through --input PATH or --input -.
+For unattended vault access, set ENTE_CLI_VAULT_KEY (see vault --help)."
)]
Login(LoginArgs),
#[command(about = "Log out")]
@@ -258,27 +290,46 @@ pub struct ApiArgs {
pub body: Option<PathBuf>,
}
+const ALBUM_HELP: &str = "Refreshes album metadata first; --offline reads previously synced data.
+With --json, list returns an array and view returns one object.
+Fields: id, name, type, visibility, ownerId (strings); updatedAt (RFC3339 timestamp string).";
+
#[derive(Subcommand)]
pub enum AlbumCommand {
#[command(about = "List your albums, including shared and hidden ones")]
+ #[command(after_long_help = ALBUM_HELP)]
List(ListArgs),
#[command(about = "Show an album")]
+ #[command(after_long_help = ALBUM_HELP)]
View {
#[arg(help = "Album ID or exact name")]
album: String,
},
}
+const FILE_HELP: &str = "Refreshes file metadata first; --offline reads previously synced data.
+Use --album to limit the albums read. With --json, list returns an array and view returns one object.
+Fields: id, name, type, ownerId (strings); albumIds (string array);
+createdAt, updatedAt (RFC3339 timestamp strings).
+Nullable fields: modifiedAt (RFC3339 string); location ({latitude, longitude}, numbers);
+caption, hash, dateTime, offsetTime, visibility (strings); durationSeconds, width, height (integers).
+dateTime and offsetTime retain the stored metadata strings.";
+
#[derive(Subcommand)]
pub enum FileCommand {
#[command(about = "List files, including shared and hidden ones")]
+ #[command(after_long_help = FILE_HELP)]
List(ListArgs),
#[command(about = "Show a file's metadata")]
+ #[command(after_long_help = FILE_HELP)]
View {
#[arg(help = "File ID or exact name")]
file: String,
},
#[command(about = "Download an original; Live Photos are saved as ZIP archives")]
+ #[command(
+ after_long_help = "Refreshes metadata and downloads to a new --output file; requires network access."
+ )]
Download {
#[arg(help = "File ID or exact name")]
file: String,
@@ -287,11 +338,17 @@ pub enum FileCommand {
},
}
+const ACCOUNT_HELP: &str = "Reads accounts stored on this device without network access.
+With --json, list returns an array and view returns one object.
+Fields: id, name, email, host (strings); products (string array); selected (boolean).";
+
#[derive(Subcommand)]
pub enum AccountCommand {
#[command(about = "List accounts on this device")]
+ #[command(after_long_help = ACCOUNT_HELP)]
List,
#[command(about = "Show an account")]
+ #[command(after_long_help = ACCOUNT_HELP)]
View {
#[arg(help = "Account name")]
name: String,
diff --git a/rust/apps/cli-next/src/auth/mod.rs b/rust/apps/cli-next/src/auth/mod.rs
index 885ea71a76..a31988ab83 100644
--- a/rust/apps/cli-next/src/auth/mod.rs
+++ b/rust/apps/cli-next/src/auth/mod.rs
@@ -1,11 +1,7 @@
mod output;
pub mod replica;
-use std::{
- env, fs,
- io::{self, IsTerminal},
- path::PathBuf,
-};
+use std::{env, fs, path::PathBuf};
use anyhow::{Context, Result, bail, ensure};
use dialoguer::{Password, console::Term};
@@ -31,8 +27,9 @@ pub async fn run(command: AuthCommand, selected: Option<&str>, options: &Options
destination.prepare()?;
let encrypted =
fs::read(&input).with_context(|| format!("cannot read {}", input.display()))?;
- let password = export_password(false)?;
- let plaintext = backup::decrypt(&encrypted, &password)?;
+ let password = export_password(false, options)?;
+ let plaintext = backup::decrypt(&encrypted, &password)
+ .with_context(|| format!("cannot decrypt {}", input.display()))?;
if let Some(path) = destination.publish(&plaintext)? {
crate::output::action(
options.json,
@@ -61,7 +58,7 @@ async fn export(args: AuthExportArgs, selected: Option<&str>, options: &Options)
let password = if args.plaintext {
None
} else {
- Some(export_password(true)?)
+ Some(export_password(true, options)?)
};
let payload = {
let (account, home) = home::open_account(selected, !options.offline)?;
@@ -109,13 +106,13 @@ async fn export(args: AuthExportArgs, selected: Option<&str>, options: &Options)
Ok(())
}
-fn export_password(confirm: bool) -> Result<Zeroizing<String>> {
+fn export_password(confirm: bool, options: &Options) -> Result<Zeroizing<String>> {
let password = match env::var("ENTE_CLI_EXPORT_PASSWORD") {
Ok(password) => Zeroizing::new(password),
Err(env::VarError::NotUnicode(_)) => bail!("ENTE_CLI_EXPORT_PASSWORD must be UTF-8"),
Err(env::VarError::NotPresent) => {
ensure!(
- io::stdin().is_terminal() && io::stderr().is_terminal(),
+ options.can_prompt(),
"set ENTE_CLI_EXPORT_PASSWORD for noninteractive encrypted export or decryption"
);
let mut prompt = Password::new().with_prompt("Export password");
diff --git a/rust/apps/cli-next/src/auth/output.rs b/rust/apps/cli-next/src/auth/output.rs
index bf6df2469a..4cb807e36c 100644
--- a/rust/apps/cli-next/src/auth/output.rs
+++ b/rust/apps/cli-next/src/auth/output.rs
@@ -32,7 +32,10 @@ impl Destination {
match fs::symlink_metadata(path) {
Ok(_) => anyhow::bail!("output already exists: {}", path.display()),
Err(error) if error.kind() == io::ErrorKind::NotFound => {}
- Err(error) => return Err(error.into()),
+ Err(error) => {
+ return Err(error)
+ .with_context(|| format!("cannot inspect output {}", path.display()));
+ }
}
ensure!(
parent(path).is_dir(),
@@ -45,7 +48,11 @@ impl Destination {
Self::Directory { path, .. } => {
let mut missing = Vec::new();
for directory in path.ancestors() {
- if directory.as_os_str().is_empty() || directory.try_exists()? {
+ if directory.as_os_str().is_empty()
+ || directory.try_exists().with_context(|| {
+ format!("cannot inspect export directory {}", directory.display())
+ })?
+ {
break;
}
missing.push(directory);
@@ -82,7 +89,8 @@ impl Destination {
Ok(None)
}
Self::File(path) => {
- stage(parent(path), bytes)?
+ stage(parent(path), bytes)
+ .with_context(|| format!("cannot prepare output {}", path.display()))?
.persist_noclobber(path)
.map_err(|error| error.error)
.with_context(|| format!("cannot publish {}", path.display()))?;
@@ -95,7 +103,9 @@ impl Destination {
Ok(Some(path.clone()))
}
Self::Directory { path, extension } => {
- publish_directory(path, extension, bytes, Local::now().date_naive()).map(Some)
+ publish_directory(path, extension, bytes, Local::now().date_naive())
+ .map(Some)
+ .with_context(|| format!("Auth backup directory {}", path.display()))
}
}
}
diff --git a/rust/apps/cli-next/src/export/mod.rs b/rust/apps/cli-next/src/export/mod.rs
index 832c6dbc69..974ecf3724 100644
--- a/rust/apps/cli-next/src/export/mod.rs
+++ b/rust/apps/cli-next/src/export/mod.rs
@@ -44,7 +44,8 @@ async fn run_locked(args: ExportArgs, selected: Option<&str>, as_json: bool) ->
adopt: args.adopt,
jobs: args.jobs,
},
- )?;
+ )
+ .with_context(|| format!("cannot open Photos export {}", args.destination.display()))?;
let account_home = home::lock_account(account.storage_id, true)?;
let account = State::load()?
.accounts
diff --git a/rust/apps/cli-next/src/login.rs b/rust/apps/cli-next/src/login.rs
index 8cd65cbbc8..b5a2d6184f 100644
--- a/rust/apps/cli-next/src/login.rs
+++ b/rust/apps/cli-next/src/login.rs
@@ -1,8 +1,4 @@
-use std::{
- collections::BTreeMap,
- io::{self, IsTerminal},
- path::Path,
-};
+use std::{collections::BTreeMap, path::Path};
use anyhow::{Context, Result, ensure};
use dialoguer::{Input, Password, Select, console::Term};
@@ -18,7 +14,7 @@ use zeroize::{ZeroizeOnDrop, Zeroizing};
use crate::{
api,
- args::{LoginArgs, Product},
+ args::{LoginArgs, Options, Product},
parse_json, read_input,
vault::{Account, AccountKeys, DbKey, State, StoredSession, Vault},
};
@@ -27,6 +23,7 @@ pub async fn login(
product: Product,
args: LoginArgs,
selected: Option<&str>,
+ options: &Options,
) -> Result<(State, usize)> {
enum Target<'a> {
Existing(&'a str),
@@ -40,6 +37,11 @@ pub async fn login(
)?),
};
let credentials = args.input.as_deref().map(Credentials::read).transpose()?;
+ let interactive = credentials.is_none() && options.can_prompt();
+ ensure!(
+ credentials.is_some() || interactive,
+ "login requires email and password; supply --input <file> or --input -"
+ );
let vault = Vault::open()?;
if let Some(name) = args.name.as_deref() {
vault.state.check_name(name)?;
@@ -58,7 +60,6 @@ pub async fn login(
.ping()
.await
.context("cannot reach the selected Ente server")?;
- let interactive = credentials.is_none();
let mut credentials = match credentials {
Some(credentials) => credentials,
None => Credentials::prompt()?,
@@ -88,7 +89,7 @@ pub async fn login(
if snapshot_existing.is_none() {
while let Err(error) = snapshot.check_name(&new_name) {
if !interactive {
- return Err(error);
+ return Err(error.context("supply a different local account name with --name"));
}
eprintln!("{error}");
new_name = Input::new()
@@ -228,10 +229,6 @@ impl Credentials {
}
fn prompt() -> Result<Self> {
- ensure!(
- io::stdin().is_terminal() && io::stderr().is_terminal(),
- "noninteractive login requires --input <file> or --input -"
- );
Ok(Self {
email: Input::new()
.with_prompt("Email")
@@ -292,7 +289,7 @@ async fn authenticate(
if use_passkey {
ensure!(
interactive,
- "passkey login requires an interactive terminal"
+ "passkey login requires an interactive terminal without --input or --no-input"
);
let url = flow.passkey_url(client, "ente-cli://passkey")?;
eprintln!("Open this URL to verify your passkey:\n{url}");
diff --git a/rust/apps/cli-next/src/main.rs b/rust/apps/cli-next/src/main.rs
index e8d77d5df6..8a4ec00c26 100644
--- a/rust/apps/cli-next/src/main.rs
+++ b/rust/apps/cli-next/src/main.rs
@@ -17,7 +17,7 @@ use std::{
};
use anyhow::{Context, Result, bail, ensure};
-use clap::Parser;
+use clap::{Arg, ArgAction, CommandFactory, FromArgMatches};
use ente_core::{b64, crypto::Key};
use serde::de::DeserializeOwned;
use serde_json::json;
@@ -32,12 +32,47 @@ use vault::{State, Vault};
#[tokio::main]
async fn main() {
- if let Err(error) = run(Cli::parse()).await {
+ let mut command = Cli::command().subcommand_required(false).arg(
+ Arg::new("help-all")
+ .long("help-all")
+ .action(ArgAction::SetTrue)
+ .help("Print help for all commands"),
+ );
+ let matches = command.get_matches_mut();
+ let result = if matches.get_flag("help-all") {
+ command.build();
+ print_all_help(&mut command, &mut std::io::stdout().lock())
+ } else {
+ let cli = Cli::from_arg_matches(&matches)
+ .unwrap_or_else(|error| error.format(&mut command).exit());
+ run(cli).await
+ };
+ if let Err(error) = result {
eprintln!("Error: {error:#}");
std::process::exit(1);
}
}
+fn print_all_help(command: &mut clap::Command, output: &mut impl Write) -> Result<()> {
+ writeln!(
+ output,
+ "=== {} ===",
+ command.get_bin_name().unwrap_or_else(|| command.get_name())
+ )?;
+ writeln!(output, "{}", command.render_long_help())?;
+ let mut children: Vec<_> = command
+ .get_subcommands_mut()
+ .filter(|child| !child.is_hide_set() && child.get_name() != "help")
+ .collect();
+ children.sort_by(|a, b| {
+ (a.get_display_order(), a.get_name()).cmp(&(b.get_display_order(), b.get_name()))
+ });
+ for child in children {
+ print_all_help(child, output)?;
+ }
+ Ok(())
+}
+
async fn run(cli: Cli) -> Result<()> {
let Cli { options, command } = cli;
match command {
@@ -102,7 +137,7 @@ async fn session(
api::raw(&state.accounts[index], product, args).await
}
SessionCommand::Login(args) => {
- let (state, index) = login::login(product, args, selected).await?;
+ let (state, index) = login::login(product, args, selected, options).await?;
let account = AccountView::new(&state.accounts[index], state.selected);
if options.json {
output::json(&json!({ "account": account, "product": product }))
@@ -282,11 +317,14 @@ fn output_account(state: State, index: usize, json_output: bool) -> Result<()> {
fn read_input(path: &Path) -> Result<Zeroizing<Vec<u8>>> {
let mut bytes = Zeroizing::new(Vec::new());
if path == Path::new("-") {
- std::io::stdin().read_to_end(&mut bytes)?;
+ std::io::stdin()
+ .read_to_end(&mut bytes)
+ .context("cannot read stdin")?;
} else {
std::fs::File::open(path)
.with_context(|| format!("cannot open {}", path.display()))?
- .read_to_end(&mut bytes)?;
+ .read_to_end(&mut bytes)
+ .with_context(|| format!("cannot read {}", path.display()))?;
}
Ok(bytes)
}
diff --git a/rust/apps/cli-next/src/photos.rs b/rust/apps/cli-next/src/photos.rs
index 2f8b7b64a9..e53c062daf 100644
--- a/rust/apps/cli-next/src/photos.rs
+++ b/rust/apps/cli-next/src/photos.rs
@@ -197,15 +197,20 @@ async fn file(
.parent()
.filter(|p| !p.as_os_str().is_empty())
.unwrap_or(Path::new("."));
- let mut temporary = tempfile::NamedTempFile::new_in(parent)?;
+ let mut temporary = tempfile::NamedTempFile::new_in(parent)
+ .with_context(|| format!("cannot prepare download to {}", output.display()))?;
files::download(session, file.id, &file.key, &file.header, || {
let file = temporary.as_file_mut();
file.set_len(0)?;
file.rewind()?;
file.try_clone()
})
- .await?;
- temporary.as_file().sync_all()?;
+ .await
+ .with_context(|| format!("cannot download file {}", file.id))?;
+ temporary
+ .as_file()
+ .sync_all()
+ .with_context(|| format!("cannot sync download to {}", output.display()))?;
let bytes = temporary.as_file().metadata()?.len();
temporary
.persist_noclobber(&output)
diff --git a/rust/apps/cli-next/tests/cli.rs b/rust/apps/cli-next/tests/cli.rs
index 00495d611f..0b28d1c564 100644
--- a/rust/apps/cli-next/tests/cli.rs
+++ b/rust/apps/cli-next/tests/cli.rs
@@ -21,6 +21,19 @@ fn reads_do_not_initialize_storage() {
if existing_home {
fs::create_dir(&path).unwrap();
}
+ let help = success(
+ home.command(&["--help-all"])
+ .env("ENTE_CLI_HOME", &path)
+ .env("ENTE_CLI_VAULT_KEY", "invalid")
+ .output()
+ .unwrap(),
+ );
+ assert!(help.stderr.is_empty());
+ let help = String::from_utf8(help.stdout).unwrap();
+ assert!(help.contains("=== ente-cli-next ==="));
+ assert!(help.contains("Usage: ente-cli-next [OPTIONS] <COMMAND>"));
+ assert!(help.contains("=== ente-cli-next photos file download ==="));
+ assert!(help.contains("=== ente-cli-next vault key generate ==="));
let output = home
.command(&["accounts", "list"])
.env("ENTE_CLI_HOME", &path)
@@ -89,6 +102,28 @@ fn invalid_login_host_does_not_initialize_storage() {
assert!(!path.exists());
}
+#[test]
+fn login_requires_input_before_storage_or_network() {
+ let home = TestHome::new();
+ let mut server = mockito::Server::new();
+ let ping = server
+ .mock("GET", "/ping")
+ .with_status(503)
+ .expect(1)
+ .create();
+ let origin = server.url();
+ let mut args = vec!["photos", "login", "--host", &origin, "--no-input"];
+ assert!(failure(&home.run(&args)).contains("supply --input"));
+ assert_eq!(fs::read_dir(home.dir.path()).unwrap().count(), 0);
+ args.extend(["--input", "-"]);
+ let output = home.with_input(
+ &args,
+ br#"{"email":"[email protected]","password":"secret"}"#,
+ );
+ assert!(failure(&output).contains("cannot reach the selected Ente server"));
+ ping.assert();
+}
+
#[test]
fn deleted_collections_are_filtered_before_decryption() {
let mut server = mockito::Server::new();
@@ -603,8 +638,15 @@ fn native_keyring_survives_separate_processes() {
assert_eq!(fs::read_dir(home.dir.path()).unwrap().count(), 0);
let mut server = mockito::Server::new();
let ping = server.mock("GET", "/ping").with_status(503).create();
+ let input = home.dir.path().join("login.json");
+ fs::write(
+ &input,
+ br#"{"email":"[email protected]","password":"secret"}"#,
+ )
+ .unwrap();
let output = home
.command(&["photos", "login", "--host", &server.url()])
+ .args(["--input", input.to_str().unwrap()])
.env_remove("ENTE_CLI_VAULT_KEY")
.output()
.unwrap();
diff --git a/rust/apps/cli-next/tests/support/auth.rs b/rust/apps/cli-next/tests/support/auth.rs
index c3672e6776..45e4bcecda 100644
--- a/rust/apps/cli-next/tests/support/auth.rs
+++ b/rust/apps/cli-next/tests/support/auth.rs
@@ -271,6 +271,7 @@ fn encrypted_export_and_independent_decrypt_keep_artifacts_separate_from_summari
let initial = page(&mut server, 0, vec![entity(1, 10, &json!(URI), &key)]);
let plain = success(
home.command(EXPORT)
+ .arg("--no-input")
.env("ENTE_CLI_EXPORT_PASSWORD", "")
.output()
.unwrap(),
@@ -319,6 +320,7 @@ fn encrypted_export_and_independent_decrypt_keep_artifacts_separate_from_summari
encrypted.to_str().unwrap(),
"--json",
])
+ .arg("--no-input")
.env("ENTE_CLI_EXPORT_PASSWORD", password)
.output()
.unwrap(),
@@ -343,6 +345,7 @@ fn encrypted_export_and_independent_decrypt_keep_artifacts_separate_from_summari
let mut command =
restore.command(&["auth", "decrypt", encrypted.to_str().unwrap(), "--json"]);
command
+ .arg("--no-input")
.env_remove("ENTE_CLI_VAULT_KEY")
.env("ENTE_CLI_HOME", &absent_home)
.env("ENTE_CLI_EXPORT_PASSWORD", password);
@@ -380,7 +383,7 @@ fn encrypted_export_and_independent_decrypt_keep_artifacts_separate_from_summari
.env("ENTE_CLI_EXPORT_PASSWORD", "wrong")
.output()
.unwrap();
- failure(&wrong);
+ assert!(failure(&wrong).contains(&format!("cannot decrypt {}: ", encrypted.display())));
assert!(wrong.stdout.is_empty());
let mut damaged: Value = serde_json::from_slice(&encoded).unwrap();
let mut ciphertext = b64::decode(damaged["encryptedData"].as_str().unwrap()).unwrap();
@@ -400,6 +403,7 @@ fn password_and_destination_errors_are_resolved_before_account_access() {
let path = directory.path().join("exact");
for value in [None, Some("")] {
let mut command = home.command(&["auth", "export", "--output", path.to_str().unwrap()]);
+ command.arg("--no-input");
if let Some(value) = value {
command.env("ENTE_CLI_EXPORT_PASSWORD", value);
}
diff --git a/rust/apps/cli-next/tests/support/export.rs b/rust/apps/cli-next/tests/support/export.rs
index 513007950c..6c7e286c18 100644
--- a/rust/apps/cli-next/tests/support/export.rs
+++ b/rust/apps/cli-next/tests/support/export.rs
@@ -1775,7 +1775,7 @@ fn export_adopts_go_and_desktop_fixtures_with_a_real_source_account() -> TestRes
let output = home.run(&["photos", "export", root.to_str().unwrap()]);
assert_eq!(
failure(&output),
- "Error: This folder contains an export from the old CLI or Ente Desktop. Use --adopt if you want to take it over.\n"
+ format!("Error: cannot open Photos export {}: This folder contains an export from the old CLI or Ente Desktop. Use --adopt if you want to take it over.\n", root.display())
);
let result = export(&home, &root, &["--adopt", "--album", "Family"]);
assert_eq!(result["copies"]["completed"], 1);
diff --git a/rust/apps/cli-next/tests/support/files.rs b/rust/apps/cli-next/tests/support/files.rs
index 2cd0f40e7d..1dbf0c11cc 100644
--- a/rust/apps/cli-next/tests/support/files.rs
+++ b/rust/apps/cli-next/tests/support/files.rs
@@ -114,7 +114,7 @@ fn downloads_publish_only_complete_authenticated_originals() {
] {
let object = server.mock("GET", "/original").with_body(bytes).create();
let output = home.run(&args);
- failure(&output);
+ assert!(failure(&output).contains("cannot download file 10: "));
assert!(output.stdout.is_empty());
assert!(!path.exists());
assert_eq!(fs::read_dir(output_dir.path()).unwrap().count(), 0);
diff --git a/rust/apps/cli-next/tests/support/museum.rs b/rust/apps/cli-next/tests/support/museum.rs
index 7fa735dbf2..f3d954a67b 100644
--- a/rust/apps/cli-next/tests/support/museum.rs
+++ b/rust/apps/cli-next/tests/support/museum.rs
@@ -21,7 +21,7 @@ fn auth_login_refresh_and_offline_export_across_processes() -> TestResult {
let email = format!("auth-export-{}@example.org", Uuid::new_v4());
let owner = create_account(&origin, &email).await;
let home = TestHome::new();
- login(&home, "auth", &email, &["--host", &origin]);
+ login(&home, "auth", &email, &["--host", &origin, "--no-input"]);
let export = ["auth", "export", "--output", "-", "--plaintext"];
assert!(success(home.run(&export)).stdout.is_empty());
let key = Key::generate();