diff --git a/CHANGELOG.md b/CHANGELOG.md index 42c4e52e05..8fd61cb921 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file. - Add `--log-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: ` 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--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 diff --git a/Cargo.lock b/Cargo.lock index 4f86e2d2ec..81c37b74e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1484,7 +1484,7 @@ dependencies = [ "doublezero-config", "doublezero-program-common", "doublezero-serviceability", - "doublezero_cli", + "doublezero-serviceability-cli", "doublezero_sdk", "eyre", "futures", @@ -1524,7 +1524,7 @@ dependencies = [ "doublezero-program-common", "doublezero-sentinel", "doublezero-serviceability", - "doublezero_cli", + "doublezero-serviceability-cli", "doublezero_sdk", "eyre", "futures", @@ -1605,7 +1605,7 @@ dependencies = [ "doublezero-config", "doublezero-geolocation", "doublezero-serviceability", - "doublezero_cli", + "doublezero-serviceability-cli", "doublezero_sdk", "eyre", "libc", @@ -1696,28 +1696,7 @@ dependencies = [ ] [[package]] -name = "doublezero-telemetry" -version = "0.24.0" -dependencies = [ - "bincode 2.0.1", - "borsh 1.5.7", - "borsh-incremental", - "ctor", - "doublezero-config", - "doublezero-program-common", - "doublezero-serviceability", - "env_logger", - "log", - "serde", - "serde_bytes", - "solana-program", - "solana-program-test", - "solana-sdk", - "solana-system-interface", -] - -[[package]] -name = "doublezero_cli" +name = "doublezero-serviceability-cli" version = "0.24.0" dependencies = [ "anyhow", @@ -1752,6 +1731,27 @@ dependencies = [ "tokio", ] +[[package]] +name = "doublezero-telemetry" +version = "0.24.0" +dependencies = [ + "bincode 2.0.1", + "borsh 1.5.7", + "borsh-incremental", + "ctor", + "doublezero-config", + "doublezero-program-common", + "doublezero-serviceability", + "env_logger", + "log", + "serde", + "serde_bytes", + "solana-program", + "solana-program-test", + "solana-sdk", + "solana-system-interface", +] + [[package]] name = "doublezero_sdk" version = "0.24.0" diff --git a/Cargo.toml b/Cargo.toml index 88d25ef721..fe8086e441 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" } diff --git a/client/doublezero-geolocation-cli/Cargo.toml b/client/doublezero-geolocation-cli/Cargo.toml index c2fc9ffafd..653e57fe80 100644 --- a/client/doublezero-geolocation-cli/Cargo.toml +++ b/client/doublezero-geolocation-cli/Cargo.toml @@ -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 diff --git a/client/doublezero-geolocation-cli/src/cli/command.rs b/client/doublezero-geolocation-cli/src/cli/command.rs index 1f8179ff60..b3ce23b1ac 100644 --- a/client/doublezero-geolocation-cli/src/cli/command.rs +++ b/client/doublezero-geolocation-cli/src/cli/command.rs @@ -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 { diff --git a/client/doublezero-geolocation-cli/src/cli/config.rs b/client/doublezero-geolocation-cli/src/cli/config.rs index 886971e7ba..9e49f4c6d8 100644 --- a/client/doublezero-geolocation-cli/src/cli/config.rs +++ b/client/doublezero-geolocation-cli/src/cli/config.rs @@ -1,5 +1,5 @@ use clap::{Args, Subcommand}; -use doublezero_cli::geolocation::config::{ +use doublezero_serviceability_cli::geolocation::config::{ get::GetGeoConfigCliCommand, set::SetGeoConfigCliCommand, }; diff --git a/client/doublezero-geolocation-cli/src/cli/probe.rs b/client/doublezero-geolocation-cli/src/cli/probe.rs index f94c51f47e..353b001982 100644 --- a/client/doublezero-geolocation-cli/src/cli/probe.rs +++ b/client/doublezero-geolocation-cli/src/cli/probe.rs @@ -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, diff --git a/client/doublezero-geolocation-cli/src/cli/user.rs b/client/doublezero-geolocation-cli/src/cli/user.rs index 751e075f1d..d4010a2bfd 100644 --- a/client/doublezero-geolocation-cli/src/cli/user.rs +++ b/client/doublezero-geolocation-cli/src/cli/user.rs @@ -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, diff --git a/client/doublezero-geolocation-cli/src/main.rs b/client/doublezero-geolocation-cli/src/main.rs index c6a7134050..527ba779ba 100644 --- a/client/doublezero-geolocation-cli/src/main.rs +++ b/client/doublezero-geolocation-cli/src/main.rs @@ -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)] diff --git a/client/doublezero/Cargo.toml b/client/doublezero/Cargo.toml index 8e669cf5e3..b5bdc24e2f 100644 --- a/client/doublezero/Cargo.toml +++ b/client/doublezero/Cargo.toml @@ -41,7 +41,7 @@ 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 @@ -49,7 +49,7 @@ 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 diff --git a/client/doublezero/src/cli/accesspass.rs b/client/doublezero/src/cli/accesspass.rs index ed03a8ce0b..8dc90b753e 100644 --- a/client/doublezero/src/cli/accesspass.rs +++ b/client/doublezero/src/cli/accesspass.rs @@ -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, diff --git a/client/doublezero/src/cli/command.rs b/client/doublezero/src/cli/command.rs index 55adc07f04..d0ae55cd01 100644 --- a/client/doublezero/src/cli/command.rs +++ b/client/doublezero/src/cli/command.rs @@ -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, diff --git a/client/doublezero/src/cli/config.rs b/client/doublezero/src/cli/config.rs index 95736111ea..47021ded09 100644 --- a/client/doublezero/src/cli/config.rs +++ b/client/doublezero/src/cli/config.rs @@ -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 { diff --git a/client/doublezero/src/cli/contributor.rs b/client/doublezero/src/cli/contributor.rs index 032c86feae..5254911278 100644 --- a/client/doublezero/src/cli/contributor.rs +++ b/client/doublezero/src/cli/contributor.rs @@ -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 { diff --git a/client/doublezero/src/cli/device.rs b/client/doublezero/src/cli/device.rs index 046ebc20d3..08921a8cc8 100644 --- a/client/doublezero/src/cli/device.rs +++ b/client/doublezero/src/cli/device.rs @@ -1,5 +1,5 @@ use clap::{Args, Subcommand}; -use doublezero_cli::device::{ +use doublezero_serviceability_cli::device::{ create::CreateDeviceCliCommand, delete::DeleteDeviceCliCommand, get::GetDeviceCliCommand, diff --git a/client/doublezero/src/cli/exchange.rs b/client/doublezero/src/cli/exchange.rs index c450003947..a468a4b526 100644 --- a/client/doublezero/src/cli/exchange.rs +++ b/client/doublezero/src/cli/exchange.rs @@ -1,6 +1,6 @@ use clap::{Args, Subcommand}; -use doublezero_cli::exchange::{ +use doublezero_serviceability_cli::exchange::{ create::*, delete::*, get::*, list::*, setdevice::SetDeviceExchangeCliCommand, update::*, }; diff --git a/client/doublezero/src/cli/geolocation/probe.rs b/client/doublezero/src/cli/geolocation/probe.rs index f94c51f47e..353b001982 100644 --- a/client/doublezero/src/cli/geolocation/probe.rs +++ b/client/doublezero/src/cli/geolocation/probe.rs @@ -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, diff --git a/client/doublezero/src/cli/geolocation/user.rs b/client/doublezero/src/cli/geolocation/user.rs index 751e075f1d..d4010a2bfd 100644 --- a/client/doublezero/src/cli/geolocation/user.rs +++ b/client/doublezero/src/cli/geolocation/user.rs @@ -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, diff --git a/client/doublezero/src/cli/globalconfig.rs b/client/doublezero/src/cli/globalconfig.rs index 73933c7c28..2dfb4b6aaa 100644 --- a/client/doublezero/src/cli/globalconfig.rs +++ b/client/doublezero/src/cli/globalconfig.rs @@ -1,5 +1,5 @@ use clap::{Args, Subcommand}; -use doublezero_cli::{ +use doublezero_serviceability_cli::{ allowlist::{ foundation::{ add::AddFoundationAllowlistCliCommand, list::ListFoundationAllowlistCliCommand, diff --git a/client/doublezero/src/cli/link.rs b/client/doublezero/src/cli/link.rs index 58f86086af..d67ba4f9d2 100644 --- a/client/doublezero/src/cli/link.rs +++ b/client/doublezero/src/cli/link.rs @@ -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::*, diff --git a/client/doublezero/src/cli/location.rs b/client/doublezero/src/cli/location.rs index c497e27fa3..d14c7dd1a2 100644 --- a/client/doublezero/src/cli/location.rs +++ b/client/doublezero/src/cli/location.rs @@ -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 { diff --git a/client/doublezero/src/cli/multicastgroup.rs b/client/doublezero/src/cli/multicastgroup.rs index f216c3e997..ba135239b2 100644 --- a/client/doublezero/src/cli/multicastgroup.rs +++ b/client/doublezero/src/cli/multicastgroup.rs @@ -1,6 +1,6 @@ use clap::{Args, Subcommand}; -use doublezero_cli::multicastgroup::{ +use doublezero_serviceability_cli::multicastgroup::{ allowlist::{ publisher::{ add::AddMulticastGroupPubAllowlistCliCommand, diff --git a/client/doublezero/src/cli/permission.rs b/client/doublezero/src/cli/permission.rs index e31073ca67..f773ce4580 100644 --- a/client/doublezero/src/cli/permission.rs +++ b/client/doublezero/src/cli/permission.rs @@ -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 { diff --git a/client/doublezero/src/cli/resource.rs b/client/doublezero/src/cli/resource.rs index cff1289f04..7fc8f679fb 100644 --- a/client/doublezero/src/cli/resource.rs +++ b/client/doublezero/src/cli/resource.rs @@ -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, diff --git a/client/doublezero/src/cli/tenant.rs b/client/doublezero/src/cli/tenant.rs index eca42d768c..627b937618 100644 --- a/client/doublezero/src/cli/tenant.rs +++ b/client/doublezero/src/cli/tenant.rs @@ -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::*, }; diff --git a/client/doublezero/src/cli/user.rs b/client/doublezero/src/cli/user.rs index ba04bcf0bd..84394874d3 100644 --- a/client/doublezero/src/cli/user.rs +++ b/client/doublezero/src/cli/user.rs @@ -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, diff --git a/client/doublezero/src/command/connect.rs b/client/doublezero/src/command/connect.rs index 0ba609b95e..754eb9b05b 100644 --- a/client/doublezero/src/command/connect.rs +++ b/client/doublezero/src/command/connect.rs @@ -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, @@ -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; @@ -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, @@ -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::{ diff --git a/client/doublezero/src/command/disable.rs b/client/doublezero/src/command/disable.rs index 551f0f210b..6c7b130a50 100644 --- a/client/doublezero/src/command/disable.rs +++ b/client/doublezero/src/command/disable.rs @@ -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 {} @@ -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(); @@ -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() diff --git a/client/doublezero/src/command/disconnect.rs b/client/doublezero/src/command/disconnect.rs index ac3edadee1..c05c733bf8 100644 --- a/client/doublezero/src/command/disconnect.rs +++ b/client/doublezero/src/command/disconnect.rs @@ -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}, @@ -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 { diff --git a/client/doublezero/src/command/enable.rs b/client/doublezero/src/command/enable.rs index 3ac4b5eccc..845ec3af3c 100644 --- a/client/doublezero/src/command/enable.rs +++ b/client/doublezero/src/command/enable.rs @@ -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 EnableCliCommand {} @@ -37,8 +37,8 @@ impl EnableCliCommand { 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(); @@ -57,7 +57,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() diff --git a/client/doublezero/src/command/latency.rs b/client/doublezero/src/command/latency.rs index 87303cd833..07e82865be 100644 --- a/client/doublezero/src/command/latency.rs +++ b/client/doublezero/src/command/latency.rs @@ -1,7 +1,7 @@ use crate::command::util; use clap::Args; -use doublezero_cli::doublezerocommand::CliCommand; use doublezero_sdk::commands::device::list::ListDeviceCommand; +use doublezero_serviceability_cli::doublezerocommand::CliCommand; use indicatif::{ProgressBar, ProgressStyle}; use std::time::Duration; diff --git a/client/doublezero/src/command/multicast.rs b/client/doublezero/src/command/multicast.rs index c6bba18813..7750e38b3b 100644 --- a/client/doublezero/src/command/multicast.rs +++ b/client/doublezero/src/command/multicast.rs @@ -1,6 +1,5 @@ use std::net::Ipv4Addr; -use doublezero_cli::{doublezerocommand::CliCommand, helpers::init_command}; use doublezero_sdk::{ commands::{ multicastgroup::{ @@ -10,6 +9,7 @@ use doublezero_sdk::{ }, User, UserType, }; +use doublezero_serviceability_cli::{doublezerocommand::CliCommand, helpers::init_command}; use indicatif::ProgressBar; use solana_sdk::pubkey::Pubkey; @@ -324,11 +324,11 @@ mod tests { MulticastPublishCliCommand, MulticastSubscribeCliCommand, MulticastUnpublishCliCommand, MulticastUnsubscribeCliCommand, }; - use doublezero_cli::tests::utils::create_test_client; use doublezero_sdk::{ commands::multicastgroup::subscribe::UpdateMulticastGroupRolesCommand, AccountType, MulticastGroup, MulticastGroupStatus, User, UserCYOA, UserStatus, }; + use doublezero_serviceability_cli::tests::utils::create_test_client; use std::collections::HashMap; fn make_user(client_ip: Ipv4Addr, user_type: UserType) -> User { diff --git a/client/doublezero/src/command/routes.rs b/client/doublezero/src/command/routes.rs index 2d7a73e1aa..5ae38dbade 100644 --- a/client/doublezero/src/command/routes.rs +++ b/client/doublezero/src/command/routes.rs @@ -1,7 +1,7 @@ use crate::command::util; use clap::Args; -use doublezero_cli::doublezerocommand::CliCommand; +use doublezero_serviceability_cli::doublezerocommand::CliCommand; use crate::{ requirements::check_doublezero, routes::retrieve_routes, diff --git a/client/doublezero/src/command/status.rs b/client/doublezero/src/command/status.rs index 3e0c3b891b..c8d4980d93 100644 --- a/client/doublezero/src/command/status.rs +++ b/client/doublezero/src/command/status.rs @@ -7,7 +7,7 @@ use crate::{ }; use backon::{ExponentialBuilder, Retryable}; use clap::Args; -use doublezero_cli::{doublezerocommand::CliCommand, helpers::print_error}; +use doublezero_serviceability_cli::{doublezerocommand::CliCommand, helpers::print_error}; use serde::{Deserialize, Serialize}; use std::time::Duration; use tabled::Tabled; @@ -159,7 +159,7 @@ mod tests { use crate::servicecontroller::{ DoubleZeroStatus, MockServiceController, MulticastGroups, V2ServiceStatus, V2StatusResponse, }; - use doublezero_cli::doublezerocommand::MockCliCommand; + use doublezero_serviceability_cli::doublezerocommand::MockCliCommand; use std::sync::{ atomic::{AtomicUsize, Ordering}, Arc, diff --git a/client/doublezero/src/main.rs b/client/doublezero/src/main.rs index d0c1234434..0b6586ebfd 100644 --- a/client/doublezero/src/main.rs +++ b/client/doublezero/src/main.rs @@ -24,13 +24,13 @@ use crate::cli::{ location::LocationCommands, user::UserCommands, }; -use doublezero_cli::{ - checkversion::check_version, doublezerocommand::CliCommandImpl, - geoclicommand::GeoCliCommandImpl, version::VersionCliCommand, -}; use doublezero_cli_core::LogLevel; use doublezero_sdk::{geolocation::client::GeoClient, DZClient, ProgramVersion}; use doublezero_serviceability::pda::get_globalstate_pda; +use doublezero_serviceability_cli::{ + checkversion::check_version, doublezerocommand::CliCommandImpl, + geoclicommand::GeoCliCommandImpl, version::VersionCliCommand, +}; use servicecontroller::ServiceControllerImpl; #[derive(Parser, Debug)] diff --git a/client/doublezero/src/requirements.rs b/client/doublezero/src/requirements.rs index 2257030979..cfe5a5b2c0 100644 --- a/client/doublezero/src/requirements.rs +++ b/client/doublezero/src/requirements.rs @@ -1,5 +1,5 @@ use crate::servicecontroller::ServiceController; -use doublezero_cli::doublezerocommand::CliCommand; +use doublezero_serviceability_cli::doublezerocommand::CliCommand; use indicatif::ProgressBar; pub async fn check_doublezero( diff --git a/controlplane/doublezero-admin/Cargo.toml b/controlplane/doublezero-admin/Cargo.toml index 961af009ad..47fe2cd9e5 100644 --- a/controlplane/doublezero-admin/Cargo.toml +++ b/controlplane/doublezero-admin/Cargo.toml @@ -40,7 +40,7 @@ tokio.workspace = true # Dependencies from this workspace doublezero_sdk.workspace = true -doublezero_cli.workspace = true +doublezero-serviceability-cli.workspace = true doublezero-config.workspace = true doublezero-serviceability.workspace = true doublezero-program-common.workspace = true diff --git a/controlplane/doublezero-admin/src/cli/accesspass.rs b/controlplane/doublezero-admin/src/cli/accesspass.rs index dddee1fab5..b18ce64afb 100644 --- a/controlplane/doublezero-admin/src/cli/accesspass.rs +++ b/controlplane/doublezero-admin/src/cli/accesspass.rs @@ -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, diff --git a/controlplane/doublezero-admin/src/cli/command.rs b/controlplane/doublezero-admin/src/cli/command.rs index aa84e6f51d..2fe1b6a0c5 100644 --- a/controlplane/doublezero-admin/src/cli/command.rs +++ b/controlplane/doublezero-admin/src/cli/command.rs @@ -7,7 +7,7 @@ use crate::cli::{ }; 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, init::InitCliCommand, keygen::KeyGenCliCommand, logcommand::LogCliCommand, diff --git a/controlplane/doublezero-admin/src/cli/config.rs b/controlplane/doublezero-admin/src/cli/config.rs index 95736111ea..47021ded09 100644 --- a/controlplane/doublezero-admin/src/cli/config.rs +++ b/controlplane/doublezero-admin/src/cli/config.rs @@ -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 { diff --git a/controlplane/doublezero-admin/src/cli/contributor.rs b/controlplane/doublezero-admin/src/cli/contributor.rs index 032c86feae..5254911278 100644 --- a/controlplane/doublezero-admin/src/cli/contributor.rs +++ b/controlplane/doublezero-admin/src/cli/contributor.rs @@ -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 { diff --git a/controlplane/doublezero-admin/src/cli/device.rs b/controlplane/doublezero-admin/src/cli/device.rs index 570210bc3b..2902e18b13 100644 --- a/controlplane/doublezero-admin/src/cli/device.rs +++ b/controlplane/doublezero-admin/src/cli/device.rs @@ -1,5 +1,12 @@ use clap::{Args, Subcommand}; -use doublezero_cli::{ +use doublezero_sdk::{ + commands::{ + device::{list::ListDeviceCommand, update::UpdateDeviceCommand}, + user::list::ListUserCommand, + }, + UserStatus, UserType, +}; +use doublezero_serviceability_cli::{ device::{ create::CreateDeviceCliCommand, delete::DeleteDeviceCliCommand, @@ -14,13 +21,6 @@ use doublezero_cli::{ }, doublezerocommand::CliCommand, }; -use doublezero_sdk::{ - commands::{ - device::{list::ListDeviceCommand, update::UpdateDeviceCommand}, - user::list::ListUserCommand, - }, - UserStatus, UserType, -}; use solana_sdk::pubkey::Pubkey; use std::{collections::HashMap, io::Write}; @@ -280,9 +280,9 @@ impl MigrateUnicastCountsCommand { #[cfg(test)] mod tests { use super::*; - use doublezero_cli::tests::utils::create_test_client; use doublezero_sdk::{Device, DeviceStatus, DeviceType, User, UserCYOA, UserStatus, UserType}; use doublezero_serviceability::state::device::{DeviceDesiredStatus, DeviceHealth}; + use doublezero_serviceability_cli::tests::utils::create_test_client; use solana_sdk::{pubkey::Pubkey, signature::Signature}; use std::collections::HashMap; diff --git a/controlplane/doublezero-admin/src/cli/exchange.rs b/controlplane/doublezero-admin/src/cli/exchange.rs index c450003947..a468a4b526 100644 --- a/controlplane/doublezero-admin/src/cli/exchange.rs +++ b/controlplane/doublezero-admin/src/cli/exchange.rs @@ -1,6 +1,6 @@ use clap::{Args, Subcommand}; -use doublezero_cli::exchange::{ +use doublezero_serviceability_cli::exchange::{ create::*, delete::*, get::*, list::*, setdevice::SetDeviceExchangeCliCommand, update::*, }; diff --git a/controlplane/doublezero-admin/src/cli/globalconfig.rs b/controlplane/doublezero-admin/src/cli/globalconfig.rs index e55d2c8e08..e97e1fbaf7 100644 --- a/controlplane/doublezero-admin/src/cli/globalconfig.rs +++ b/controlplane/doublezero-admin/src/cli/globalconfig.rs @@ -1,5 +1,5 @@ use clap::{Args, Subcommand}; -use doublezero_cli::{ +use doublezero_serviceability_cli::{ allowlist::foundation::{ add::AddFoundationAllowlistCliCommand, list::ListFoundationAllowlistCliCommand, remove::RemoveFoundationAllowlistCliCommand, diff --git a/controlplane/doublezero-admin/src/cli/link.rs b/controlplane/doublezero-admin/src/cli/link.rs index cf0808e079..f38dd27f0b 100644 --- a/controlplane/doublezero-admin/src/cli/link.rs +++ b/controlplane/doublezero-admin/src/cli/link.rs @@ -1,6 +1,6 @@ use clap::{Args, Subcommand}; -use doublezero_cli::link::{ +use doublezero_serviceability_cli::link::{ accept::AcceptLinkCliCommand, delete::*, dzx_create::CreateDZXLinkCliCommand, get::*, list::*, update::*, wan_create::*, }; diff --git a/controlplane/doublezero-admin/src/cli/location.rs b/controlplane/doublezero-admin/src/cli/location.rs index c497e27fa3..d14c7dd1a2 100644 --- a/controlplane/doublezero-admin/src/cli/location.rs +++ b/controlplane/doublezero-admin/src/cli/location.rs @@ -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 { diff --git a/controlplane/doublezero-admin/src/cli/migrate.rs b/controlplane/doublezero-admin/src/cli/migrate.rs index b8f5e993b9..8404139d28 100644 --- a/controlplane/doublezero-admin/src/cli/migrate.rs +++ b/controlplane/doublezero-admin/src/cli/migrate.rs @@ -1,5 +1,4 @@ use clap::{Args, Subcommand}; -use doublezero_cli::doublezerocommand::CliCommand; use doublezero_sdk::commands::{ device::list::ListDeviceCommand, link::{list::ListLinkCommand, update::UpdateLinkCommand}, @@ -8,6 +7,7 @@ use doublezero_sdk::commands::{ }, }; use doublezero_serviceability::{pda::get_topology_pda, state::interface::LoopbackType}; +use doublezero_serviceability_cli::doublezerocommand::CliCommand; use solana_sdk::pubkey::Pubkey; use std::io::Write; diff --git a/controlplane/doublezero-admin/src/cli/multicastgroup.rs b/controlplane/doublezero-admin/src/cli/multicastgroup.rs index f216c3e997..ba135239b2 100644 --- a/controlplane/doublezero-admin/src/cli/multicastgroup.rs +++ b/controlplane/doublezero-admin/src/cli/multicastgroup.rs @@ -1,6 +1,6 @@ use clap::{Args, Subcommand}; -use doublezero_cli::multicastgroup::{ +use doublezero_serviceability_cli::multicastgroup::{ allowlist::{ publisher::{ add::AddMulticastGroupPubAllowlistCliCommand, diff --git a/controlplane/doublezero-admin/src/cli/permission.rs b/controlplane/doublezero-admin/src/cli/permission.rs index e31073ca67..f773ce4580 100644 --- a/controlplane/doublezero-admin/src/cli/permission.rs +++ b/controlplane/doublezero-admin/src/cli/permission.rs @@ -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 { diff --git a/controlplane/doublezero-admin/src/cli/tenant.rs b/controlplane/doublezero-admin/src/cli/tenant.rs index 1d9e6441e9..056d61c6f5 100644 --- a/controlplane/doublezero-admin/src/cli/tenant.rs +++ b/controlplane/doublezero-admin/src/cli/tenant.rs @@ -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::*, }; diff --git a/controlplane/doublezero-admin/src/cli/user.rs b/controlplane/doublezero-admin/src/cli/user.rs index ba04bcf0bd..84394874d3 100644 --- a/controlplane/doublezero-admin/src/cli/user.rs +++ b/controlplane/doublezero-admin/src/cli/user.rs @@ -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, diff --git a/controlplane/doublezero-admin/src/main.rs b/controlplane/doublezero-admin/src/main.rs index 253ee4b0ce..661f1feda0 100644 --- a/controlplane/doublezero-admin/src/main.rs +++ b/controlplane/doublezero-admin/src/main.rs @@ -17,8 +17,8 @@ use crate::cli::{ tenant::TenantCommands, user::UserCommands, }; -use doublezero_cli::doublezerocommand::CliCommandImpl; use doublezero_sdk::DZClient; +use doublezero_serviceability_cli::doublezerocommand::CliCommandImpl; #[derive(Parser, Debug)] #[command(term_width = 0)] diff --git a/smartcontract/cli/Cargo.toml b/smartcontract/cli/Cargo.toml index ce8265b4ad..ffd97e4316 100644 --- a/smartcontract/cli/Cargo.toml +++ b/smartcontract/cli/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "doublezero_cli" +name = "doublezero-serviceability-cli" # Workspace inherited keys version.workspace = true @@ -10,7 +10,7 @@ license.workspace = true repository.workspace = true [lib] -name = "doublezero_cli" +name = "doublezero_serviceability_cli" [dependencies] anyhow.workspace = true