Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
- Add `--log-level <LEVEL>` global flag and initialize the `tracing` subscriber at startup. `LEVEL` is one of `off`, `error`, `warn` (default), `info`, `debug`, `trace`. Diagnostic logs go to stderr so `--json` output on stdout remains parseable. Honors the `RUST_LOG` environment variable when set, overriding the CLI-flag level for per-module filtering. Replaces the previous `println!("using keypair: ...")` stdout line with a `tracing::info!` event; the keypair confirmation now appears only at `--log-level info` or higher and no longer pollutes parseable stdout. (Named `--log-level` rather than the RFC-20 §Global-flags suggested `--verbose` / `-v` because the existing `doublezero connect` / `disconnect` subcommands already own a `--verbose` flag with `bool` type; the global flag deviation will be revisited when the daemon-control module crate is carved out.)
- Build a `CliContext` once at binary startup from `--env`, the per-field global overrides (`--url`, `--ws`, `--solana-url`, `--program-id`, `--geo-program-id`, `--keypair`, `--sock-file`), and the persisted `~/.config/doublezero/cli/config.yml` (overridable via `DOUBLEZERO_CONFIG_FILE`), per RFC-20 (§CliContext). Precedence (highest wins): CLI flag > persisted config > env-derived default. When `--env` is not set and the persisted config has a serviceability program ID, the environment is derived from that program ID via `Environment::from_program_id`; otherwise the binary falls back to `Environment::default()`. The legacy `DZClient` is now constructed from the fully resolved `CliContext` URL, WebSocket, and program-ID values directly, so verbs that migrate to read `CliContext` see the same backend as the legacy bridge. Keypair resolution is intentionally left to `DZClient::new`'s internal `load_keypair` precedence (CLI `--keypair` flag > `DOUBLEZERO_KEYPAIR` env var > stdin > persisted config) so the `DOUBLEZERO_KEYPAIR` env var continues to override the persisted keypair path, as relied on by the e2e contributor-auth negative-authz suite. File reads happen only in the binary; module crates remain forbidden from touching the filesystem (RFC-20 §67).
- Centralize top-level error rendering through `doublezero_cli_core::error::render_eyre`. Replaces three ad-hoc `eprintln!("Error: {e}")` sites in `client/doublezero/src/main.rs` (env-parse failure, env-config resolution failure, top-level command failure) with a single helper that prints `Error: <head>` followed by the full chain of causes on stderr.
- Rename the `smartcontract/cli/` crate from `doublezero_cli` to `doublezero-serviceability-cli` to satisfy RFC-20's module-crate naming contract (`doublezero-<module>-cli` in kebab-case). The crate stays at `smartcontract/cli/`; only the `[package].name` and `[lib].name` change (lib name is `doublezero_serviceability_cli` because Rust requires underscores in import paths). All in-tree consumers are updated: `client/doublezero`, `client/doublezero-geolocation-cli`, `controlplane/doublezero-admin`, and the workspace `Cargo.toml`. External operators who depend on the workspace crate by its old name (`doublezero_cli`) must update their `Cargo.toml` and `use` statements. No user-facing command, flag, or output change.

## [v0.24.0](https://github.com/malbeclabs/doublezero/compare/client/v0.23.0...client/v0.24.0) - 2026-05-22

Expand Down
50 changes: 25 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ tokio = { version = "1", default-features = false, features = [
doublezero-cli-core = { path = "crates/doublezero-cli-core" }
doublezero-config = { path = "config" }
doublezero-sentinel = { path = "crates/sentinel" }
doublezero_cli = { path = "smartcontract/cli" }
doublezero-serviceability-cli = { path = "smartcontract/cli" }
doublezero-program-common = { path = "smartcontract/programs/common" }
doublezero_sdk = { path = "smartcontract/sdk/rs" }

Expand Down
2 changes: 1 addition & 1 deletion client/doublezero-geolocation-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ solana-sdk.workspace = true
doublezero-config.workspace = true
doublezero-geolocation.workspace = true
doublezero-serviceability.workspace = true
doublezero_cli.workspace = true
doublezero-serviceability-cli.workspace = true
doublezero_sdk.workspace = true
2 changes: 1 addition & 1 deletion client/doublezero-geolocation-cli/src/cli/command.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::{config::ConfigCliCommand, probe::ProbeCliCommand, user::UserCliCommand};
use clap::Subcommand;
use doublezero_cli::geolocation::programconfig::init::InitProgramConfigCliCommand;
use doublezero_serviceability_cli::geolocation::programconfig::init::InitProgramConfigCliCommand;

#[derive(Subcommand, Debug)]
pub enum Command {
Expand Down
2 changes: 1 addition & 1 deletion client/doublezero-geolocation-cli/src/cli/config.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use clap::{Args, Subcommand};
use doublezero_cli::geolocation::config::{
use doublezero_serviceability_cli::geolocation::config::{
get::GetGeoConfigCliCommand, set::SetGeoConfigCliCommand,
};

Expand Down
2 changes: 1 addition & 1 deletion client/doublezero-geolocation-cli/src/cli/probe.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use clap::{Args, Subcommand};
use doublezero_cli::geolocation::probe::{
use doublezero_serviceability_cli::geolocation::probe::{
add_parent::AddParentGeoProbeCliCommand, create::CreateGeoProbeCliCommand,
delete::DeleteGeoProbeCliCommand, get::GetGeoProbeCliCommand, list::ListGeoProbeCliCommand,
remove_parent::RemoveParentGeoProbeCliCommand, update::UpdateGeoProbeCliCommand,
Expand Down
2 changes: 1 addition & 1 deletion client/doublezero-geolocation-cli/src/cli/user.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use clap::{Args, Subcommand};
use doublezero_cli::geolocation::user::{
use doublezero_serviceability_cli::geolocation::user::{
add_target::AddTargetCliCommand, create::CreateGeolocationUserCliCommand,
delete::DeleteGeolocationUserCliCommand, get::GetGeolocationUserCliCommand,
list::ListGeolocationUserCliCommand, remove_target::RemoveTargetCliCommand,
Expand Down
2 changes: 1 addition & 1 deletion client/doublezero-geolocation-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ use std::path::PathBuf;

mod cli;
use cli::{command::Command, config::ConfigCommands, probe::ProbeCommands, user::UserCommands};
use doublezero_cli::geoclicommand::GeoCliCommandImpl;
use doublezero_config::Environment;
use doublezero_sdk::{geolocation::client::GeoClient, DZClient};
use doublezero_serviceability::pda::get_globalstate_pda;
use doublezero_serviceability_cli::geoclicommand::GeoCliCommandImpl;

#[derive(Parser, Debug)]
#[command(term_width = 0)]
Expand Down
4 changes: 2 additions & 2 deletions client/doublezero/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ tokio.workspace = true

# Dependencies from this workspace
doublezero_sdk.workspace = true
doublezero_cli.workspace = true
doublezero-serviceability-cli.workspace = true
doublezero-cli-core.workspace = true
doublezero-config.workspace = true
doublezero-serviceability.workspace = true
doublezero-program-common.workspace = true
tracing.workspace = true

[features]
default-mainnet-beta = ["doublezero_sdk/default-mainnet-beta", "doublezero_cli/default-mainnet-beta"]
default-mainnet-beta = ["doublezero_sdk/default-mainnet-beta", "doublezero-serviceability-cli/default-mainnet-beta"]

[dev-dependencies]
assert_cmd.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion client/doublezero/src/cli/accesspass.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use clap::{Args, Subcommand};
use doublezero_cli::accesspass::{
use doublezero_serviceability_cli::accesspass::{
close::CloseAccessPassCliCommand, fund::FundAccessPassCliCommand, get::GetAccessPassCliCommand,
list::ListAccessPassCliCommand, set::SetAccessPassCliCommand,
user_balances::UserBalancesAccessPassCliCommand,
Expand Down
2 changes: 1 addition & 1 deletion client/doublezero/src/cli/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::{
};
use clap::{Args, Subcommand};
use clap_complete::Shell;
use doublezero_cli::{
use doublezero_serviceability_cli::{
account::GetAccountCliCommand, accounts::GetAccountsCliCommand, address::AddressCliCommand,
balance::BalanceCliCommand, export::ExportCliCommand,
geolocation::programconfig::init::InitProgramConfigCliCommand, init::InitCliCommand,
Expand Down
2 changes: 1 addition & 1 deletion client/doublezero/src/cli/config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use clap::{Args, Subcommand};

use doublezero_cli::config::{get::GetConfigCliCommand, set::SetConfigCliCommand};
use doublezero_serviceability_cli::config::{get::GetConfigCliCommand, set::SetConfigCliCommand};

#[derive(Args, Debug)]
pub struct ConfigCliCommand {
Expand Down
4 changes: 3 additions & 1 deletion client/doublezero/src/cli/contributor.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use clap::{Args, Subcommand};

use doublezero_cli::contributor::{create::*, delete::*, get::*, list::*, update::*};
use doublezero_serviceability_cli::contributor::{
create::*, delete::*, get::*, list::*, update::*,
};

#[derive(Args, Debug)]
pub struct ContributorCliCommand {
Expand Down
2 changes: 1 addition & 1 deletion client/doublezero/src/cli/device.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use clap::{Args, Subcommand};
use doublezero_cli::device::{
use doublezero_serviceability_cli::device::{
create::CreateDeviceCliCommand,
delete::DeleteDeviceCliCommand,
get::GetDeviceCliCommand,
Expand Down
2 changes: 1 addition & 1 deletion client/doublezero/src/cli/exchange.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use clap::{Args, Subcommand};

use doublezero_cli::exchange::{
use doublezero_serviceability_cli::exchange::{
create::*, delete::*, get::*, list::*, setdevice::SetDeviceExchangeCliCommand, update::*,
};

Expand Down
2 changes: 1 addition & 1 deletion client/doublezero/src/cli/geolocation/probe.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use clap::{Args, Subcommand};
use doublezero_cli::geolocation::probe::{
use doublezero_serviceability_cli::geolocation::probe::{
add_parent::AddParentGeoProbeCliCommand, create::CreateGeoProbeCliCommand,
delete::DeleteGeoProbeCliCommand, get::GetGeoProbeCliCommand, list::ListGeoProbeCliCommand,
remove_parent::RemoveParentGeoProbeCliCommand, update::UpdateGeoProbeCliCommand,
Expand Down
2 changes: 1 addition & 1 deletion client/doublezero/src/cli/geolocation/user.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use clap::{Args, Subcommand};
use doublezero_cli::geolocation::user::{
use doublezero_serviceability_cli::geolocation::user::{
add_target::AddTargetCliCommand, create::CreateGeolocationUserCliCommand,
delete::DeleteGeolocationUserCliCommand, get::GetGeolocationUserCliCommand,
list::ListGeolocationUserCliCommand, remove_target::RemoveTargetCliCommand,
Expand Down
2 changes: 1 addition & 1 deletion client/doublezero/src/cli/globalconfig.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use clap::{Args, Subcommand};
use doublezero_cli::{
use doublezero_serviceability_cli::{
allowlist::{
foundation::{
add::AddFoundationAllowlistCliCommand, list::ListFoundationAllowlistCliCommand,
Expand Down
2 changes: 1 addition & 1 deletion client/doublezero/src/cli/link.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use clap::{Args, Subcommand};
use doublezero_cli::{
use doublezero_serviceability_cli::{
link::{
accept::AcceptLinkCliCommand, delete::*, dzx_create::CreateDZXLinkCliCommand, get::*,
latency::LinkLatencyCliCommand, list::*, sethealth::SetLinkHealthCliCommand, update::*,
Expand Down
2 changes: 1 addition & 1 deletion client/doublezero/src/cli/location.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use clap::{Args, Subcommand};

use doublezero_cli::location::{create::*, delete::*, get::*, list::*, update::*};
use doublezero_serviceability_cli::location::{create::*, delete::*, get::*, list::*, update::*};

#[derive(Args, Debug)]
pub struct LocationCliCommand {
Expand Down
2 changes: 1 addition & 1 deletion client/doublezero/src/cli/multicastgroup.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use clap::{Args, Subcommand};

use doublezero_cli::multicastgroup::{
use doublezero_serviceability_cli::multicastgroup::{
allowlist::{
publisher::{
add::AddMulticastGroupPubAllowlistCliCommand,
Expand Down
4 changes: 3 additions & 1 deletion client/doublezero/src/cli/permission.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use clap::{Args, Subcommand};

use doublezero_cli::permission::{delete::*, get::*, list::*, resume::*, set::*, suspend::*};
use doublezero_serviceability_cli::permission::{
delete::*, get::*, list::*, resume::*, set::*, suspend::*,
};

#[derive(Args, Debug)]
pub struct PermissionCliCommand {
Expand Down
2 changes: 1 addition & 1 deletion client/doublezero/src/cli/resource.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use clap::{Args, Subcommand};
use doublezero_cli::resource::{
use doublezero_serviceability_cli::resource::{
allocate::AllocateResourceCliCommand, close::CloseResourceCliCommand,
create::CreateResourceCliCommand, deallocate::DeallocateResourceCliCommand,
get::GetResourceCliCommand, verify::VerifyResourceCliCommand,
Expand Down
2 changes: 1 addition & 1 deletion client/doublezero/src/cli/tenant.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use clap::{Args, Subcommand};

use doublezero_cli::tenant::{
use doublezero_serviceability_cli::tenant::{
add_administrator::*, create::*, delete::*, get::*, list::*, remove_administrator::*, update::*,
};

Expand Down
2 changes: 1 addition & 1 deletion client/doublezero/src/cli/user.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use clap::{Args, Subcommand};

use doublezero_cli::user::{
use doublezero_serviceability_cli::user::{
create::CreateUserCliCommand, create_subscribe::CreateSubscribeUserCliCommand,
delete::DeleteUserCliCommand, get::GetUserCliCommand, list::ListUserCliCommand,
request_ban::RequestBanUserCliCommand, subscribe::SubscribeUserCliCommand,
Expand Down
14 changes: 8 additions & 6 deletions client/doublezero/src/command/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ use crate::{
};
use backon::{BlockingRetryable, ExponentialBuilder};
use clap::{Args, Subcommand, ValueEnum};
use doublezero_cli::{
doublezerocommand::CliCommand,
helpers::init_command,
requirements::{check_accesspass, check_requirements, CHECK_BALANCE, CHECK_ID_JSON},
};
use doublezero_sdk::{
commands::{
accesspass::get::GetAccessPassCommand,
Expand All @@ -25,6 +20,11 @@ use doublezero_sdk::{
},
Device, User, UserCYOA, UserStatus, UserType,
};
use doublezero_serviceability_cli::{
doublezerocommand::CliCommand,
helpers::init_command,
requirements::{check_accesspass, check_requirements, CHECK_BALANCE, CHECK_ID_JSON},
};
use eyre;
use indicatif::ProgressBar;
use solana_sdk::pubkey::Pubkey;
Expand Down Expand Up @@ -936,7 +936,6 @@ mod tests {
DoubleZeroStatus, LatencyRecord, LatencyResponse, MockServiceController, StatusResponse,
V2StatusResponse,
};
use doublezero_cli::{doublezerocommand::MockCliCommand, tests::utils::create_test_client};
use doublezero_config::Environment;
use doublezero_sdk::{
commands::accesspass::get::GetAccessPassCommand, tests::utils::create_temp_config,
Expand All @@ -953,6 +952,9 @@ mod tests {
tenant::{Tenant, TenantBillingConfig, TenantPaymentStatus},
},
};
use doublezero_serviceability_cli::{
doublezerocommand::MockCliCommand, tests::utils::create_test_client,
};
use mockall::predicate;
use solana_sdk::signature::Signature;
use std::{
Expand Down
6 changes: 3 additions & 3 deletions client/doublezero/src/command/disable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{
servicecontroller::{ServiceController, ServiceControllerImpl},
};
use clap::Args;
use doublezero_cli::doublezerocommand::CliCommand;
use doublezero_serviceability_cli::doublezerocommand::CliCommand;

#[derive(Args, Debug)]
pub struct DisableCliCommand {}
Expand Down Expand Up @@ -44,8 +44,8 @@ impl DisableCliCommand {
mod tests {
use super::*;
use crate::servicecontroller::{MockServiceController, V2StatusResponse};
use doublezero_cli::tests::utils::create_test_client;
use doublezero_config::Environment;
use doublezero_serviceability_cli::tests::utils::create_test_client;

fn setup_mock() -> MockServiceController {
let mut mock = MockServiceController::new();
Expand All @@ -64,7 +64,7 @@ mod tests {
mock
}

fn setup_client() -> doublezero_cli::doublezerocommand::MockCliCommand {
fn setup_client() -> doublezero_serviceability_cli::doublezerocommand::MockCliCommand {
let mut client = create_test_client();
client
.expect_get_environment()
Expand Down
4 changes: 2 additions & 2 deletions client/doublezero/src/command/disconnect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::{
requirements::check_doublezero,
servicecontroller::{ServiceController, ServiceControllerImpl},
};
use doublezero_cli::{
use doublezero_serviceability_cli::{
doublezerocommand::CliCommand,
helpers::init_command,
requirements::{check_requirements, CHECK_BALANCE, CHECK_ID_JSON},
Expand Down Expand Up @@ -469,8 +469,8 @@ mod tests {

// --- delete_users tests ---

use doublezero_cli::tests::utils::create_test_client;
use doublezero_sdk::{AccountType, User, UserCYOA, UserStatus};
use doublezero_serviceability_cli::tests::utils::create_test_client;
use std::collections::HashMap;

fn make_test_user(client_ip: Ipv4Addr, owner: Pubkey, user_type: UserType) -> User {
Expand Down
Loading
Loading