Skip to content

armgit / ente

Public Imported from GitHub
0

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

Rename Rust CLI binary to ente-cli

Manav Rathi0b02be82c275
diff --git a/rust/README.md b/rust/README.md
index 638182fed7..283f6471ab 100644
--- a/rust/README.md
+++ b/rust/README.md
@@ -121,7 +121,7 @@ mobile/apps/photos/rust/ # Photos app-specific FRB bindings
- `ente-core` - shared business logic (pure Rust, no FFI)
- Docs: `rust/core/docs/crypto.md`, `rust/core/docs/auth.md`
- `ente_photos` - shared Photos Rust logic
-- `ente-rs` - CLI binary
+- `ente-rs` - Rust CLI package (`ente-cli` binary)
- `ente-e2e` - ignored Rust integration tests that run against a live Museum
- `ente-wasm` - wasm-bindgen wrappers for web
- `ente_rust` - shared FRB wrappers for mobile (Dart class: `EnteRust`)
@@ -176,7 +176,7 @@ cargo fmt # format
cargo clippy # lint
cargo build # build
cargo test # test
-cargo run -- --help
+cargo run --bin ente-cli -- --help
```
**ente-e2e (rust/e2e/):**
diff --git a/rust/apps/cli/Cargo.toml b/rust/apps/cli/Cargo.toml
index dedb8c7ed5..d1ee646c1b 100644
--- a/rust/apps/cli/Cargo.toml
+++ b/rust/apps/cli/Cargo.toml
@@ -7,6 +7,10 @@ homepage = "https://ente.com"
repository = "https://github.com/ente-io/ente"
license = "AGPL-3.0-only"
+[[bin]]
+name = "ente-cli"
+path = "src/main.rs"
+
[dependencies]
# CLI
clap = { version = "4.5", features = ["derive", "env"] }
diff --git a/rust/apps/cli/README.md b/rust/apps/cli/README.md
index 2515b16493..064369288f 100644
--- a/rust/apps/cli/README.md
+++ b/rust/apps/cli/README.md
@@ -7,4 +7,5 @@ cargo fmt # format
cargo clippy # lint
cargo build # build
cargo test # test
+cargo run --bin ente-cli -- --help
```
diff --git a/rust/apps/cli/src/api/auth.rs b/rust/apps/cli/src/api/auth.rs
index 7ed119b8ac..4441570fff 100644
--- a/rust/apps/cli/src/api/auth.rs
+++ b/rust/apps/cli/src/api/auth.rs
@@ -18,7 +18,7 @@ where
fn shared_client(api: &ApiClient, account_id: Option<&str>) -> Result<AccountsClient> {
let mut config = AccountsClientConfig::new(api.client_package())
.with_base_url(api.base_url().to_string())
- .with_user_agent(format!("ente-rs/{}", env!("CARGO_PKG_VERSION")));
+ .with_user_agent(format!("ente-cli-rust/{}", env!("CARGO_PKG_VERSION")));
if let Some(token) = account_id.and_then(|id| api.get_token(id)) {
config = config.with_auth_token(token);
}
diff --git a/rust/apps/cli/src/auth_flow.rs b/rust/apps/cli/src/auth_flow.rs
index 285b0c2138..2ab2cc0dfe 100644
--- a/rust/apps/cli/src/auth_flow.rs
+++ b/rust/apps/cli/src/auth_flow.rs
@@ -27,7 +27,7 @@ fn shared_client(
) -> Result<shared::AccountsClient> {
let mut config = shared::AccountsClientConfig::new(app.client_package())
.with_base_url(api_client.base_url().to_string())
- .with_user_agent(format!("ente-rs/{}", env!("CARGO_PKG_VERSION")));
+ .with_user_agent(format!("ente-cli-rust/{}", env!("CARGO_PKG_VERSION")));
if let Some(token) = account_id.and_then(|id| api_client.get_token(id)) {
config = config.with_auth_token(token);
}
diff --git a/rust/apps/cli/src/commands/account.rs b/rust/apps/cli/src/commands/account.rs
index 5e43ed68da..d40e44aea3 100644
--- a/rust/apps/cli/src/commands/account.rs
+++ b/rust/apps/cli/src/commands/account.rs
@@ -575,7 +575,7 @@ fn new_accounts_client(endpoint: &str, app: App) -> Result<AccountsClient> {
AccountsClient::new(
AccountsClientConfig::new(app.client_package())
.with_base_url(endpoint.to_string())
- .with_user_agent("ente-rs"),
+ .with_user_agent("ente-cli-rust"),
)
.map_err(Error::from)
}
diff --git a/rust/apps/cli/src/commands/export.rs b/rust/apps/cli/src/commands/export.rs
index 1c80243501..3f5f7b38be 100644
--- a/rust/apps/cli/src/commands/export.rs
+++ b/rust/apps/cli/src/commands/export.rs
@@ -128,7 +128,7 @@ pub async fn run_export(account_email: Option<String>, filter: ExportFilter) ->
};
if accounts.is_empty() {
- println!("No accounts configured. Use 'ente-rs account add' first.");
+ println!("No accounts configured. Use 'ente-cli account add' first.");
return Ok(());
}
diff --git a/rust/apps/cli/src/commands/sync.rs b/rust/apps/cli/src/commands/sync.rs
index deede83c17..6f0d90ec8c 100644
--- a/rust/apps/cli/src/commands/sync.rs
+++ b/rust/apps/cli/src/commands/sync.rs
@@ -43,7 +43,7 @@ pub async fn run_sync(
};
if accounts.is_empty() {
- println!("No accounts configured. Use 'ente-rs account add' first.");
+ println!("No accounts configured. Use 'ente-cli account add' first.");
return Ok(());
}
diff --git a/rust/apps/cli/src/main.rs b/rust/apps/cli/src/main.rs
index 5e3a0d9cd6..fd803990d7 100644
--- a/rust/apps/cli/src/main.rs
+++ b/rust/apps/cli/src/main.rs
@@ -27,7 +27,7 @@ async fn run() -> Result<()> {
match cli.command {
Commands::Version => {
- println!("ente-rs version {}", ente_rs::cli::version::VERSION);
+ println!("ente-cli version {}", ente_rs::cli::version::VERSION);
}
Commands::Account(account_cmd) => {
commands::account::handle_account_command(account_cmd, &storage).await?;