MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / handle_debug_command

Function handle_debug_command

crates/opencode-cli/src/main.rs:3391–3656  ·  view source on GitHub ↗
(action: DebugCommands)

Source from the content-addressed store, hash-verified

3389}
3390
3391async fn handle_debug_command(action: DebugCommands) -> anyhow::Result<()> {
3392 match action {
3393 DebugCommands::Paths => {
3394 println!("Global paths:");
3395 println!(" {:<12} {}", "cwd", std::env::current_dir()?.display());
3396 println!(
3397 " {:<12} {}",
3398 "home",
3399 dirs::home_dir()
3400 .map(|p| p.display().to_string())
3401 .unwrap_or_else(|| "<none>".to_string())
3402 );
3403 println!(
3404 " {:<12} {}",
3405 "config",
3406 dirs::config_dir()
3407 .map(|p| p.display().to_string())
3408 .unwrap_or_else(|| "<none>".to_string())
3409 );
3410 println!(
3411 " {:<12} {}",
3412 "data",
3413 dirs::data_dir()
3414 .map(|p| p.display().to_string())
3415 .unwrap_or_else(|| "<none>".to_string())
3416 );
3417 println!(
3418 " {:<12} {}",
3419 "cache",
3420 dirs::cache_dir()
3421 .map(|p| p.display().to_string())
3422 .unwrap_or_else(|| "<none>".to_string())
3423 );
3424 }
3425 DebugCommands::Config => {
3426 let cwd = std::env::current_dir()?;
3427 let config = load_config(&cwd)?;
3428 println!("{}", serde_json::to_string_pretty(&config)?);
3429 }
3430 DebugCommands::Skill => {
3431 let skills = list_available_skills();
3432 let list: Vec<_> = skills
3433 .into_iter()
3434 .map(|(name, description)| {
3435 serde_json::json!({
3436 "name": name,
3437 "description": description
3438 })
3439 })
3440 .collect();
3441 println!("{}", serde_json::to_string_pretty(&list)?);
3442 }
3443 DebugCommands::Scrap => {
3444 let db = Database::new().await?;
3445 let session_repo = SessionRepository::new(db.pool().clone());
3446 let sessions = session_repo.list(None, 10_000).await?;
3447 let mut grouped: BTreeMap<String, Vec<String>> = BTreeMap::new();
3448 for session in sessions {

Callers 1

mainFunction · 0.85

Calls 15

load_configFunction · 0.85
list_available_skillsFunction · 0.85
newFunction · 0.85
sleepFunction · 0.85
create_lsp_clientFunction · 0.85
infer_language_idFunction · 0.85
from_configFunction · 0.85
poolMethod · 0.80
outputMethod · 0.80
containsMethod · 0.80
is_emptyMethod · 0.80

Tested by

no test coverage detected