Skip to content

Commit 334dd8f

Browse files
committed
♻️ Move services command under debug subcommand
adi services → adi debug services This is a developer/debugging tool, not needed for regular users.
1 parent 5cbf43c commit 334dd8f

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

src/main.rs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ enum Commands {
4444
query: String,
4545
},
4646

47-
/// List registered services from loaded plugins
48-
Services,
47+
/// Debug and diagnostic commands
48+
Debug {
49+
#[command(subcommand)]
50+
command: DebugCommands,
51+
},
4952

5053
/// Run a plugin's CLI interface
5154
Run {
@@ -116,6 +119,12 @@ enum PluginCommands {
116119
},
117120
}
118121

122+
#[derive(Subcommand)]
123+
enum DebugCommands {
124+
/// List registered services from loaded plugins
125+
Services,
126+
}
127+
119128
#[tokio::main]
120129
async fn main() -> anyhow::Result<()> {
121130
// Auto-initialize completions on first run
@@ -130,7 +139,7 @@ async fn main() -> anyhow::Result<()> {
130139
Commands::SelfUpdate { force } => adi_cli::self_update::self_update(force).await?,
131140
Commands::Plugin { command } => cmd_plugin(command).await?,
132141
Commands::Search { query } => cmd_search(&query).await?,
133-
Commands::Services => cmd_services().await?,
142+
Commands::Debug { command } => cmd_debug(command).await?,
134143
Commands::Run { plugin_id, args } => cmd_run(plugin_id, args).await?,
135144
Commands::Completions { shell } => cmd_completions(shell),
136145
Commands::Init { shell } => cmd_init(shell)?,
@@ -508,6 +517,13 @@ async fn cmd_search(query: &str) -> anyhow::Result<()> {
508517
Ok(())
509518
}
510519

520+
async fn cmd_debug(command: DebugCommands) -> anyhow::Result<()> {
521+
match command {
522+
DebugCommands::Services => cmd_services().await?,
523+
}
524+
Ok(())
525+
}
526+
511527
async fn cmd_services() -> anyhow::Result<()> {
512528
let runtime = PluginRuntime::new(RuntimeConfig::default()).await?;
513529
runtime.load_all_plugins().await?;

0 commit comments

Comments
 (0)