{"record":{"id":"bf8c8725aa0f4ef9","repo":"rtk-ai/rtk","slug":"dotnet-no-subcommand-specified","errorCode":null,"errorMessage":"dotnet: no subcommand specified","messagePattern":"dotnet: no subcommand specified","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmds/dotnet/dotnet_cmd.rs","lineNumber":81,"sourceCode":"    println!(\"{}\", shown);\n\n    timer.track(\n        &format!(\"dotnet format {}\", args.join(\" \")),\n        &format!(\"rtk dotnet format {}\", args.join(\" \")),\n        &raw,\n        shown,\n    );\n\n    if cleanup_report_path && let Some(path) = report_path.as_deref() {\n        cleanup_temp_file(path);\n    }\n\n    Ok(result.exit_code)\n}\n\npub fn run_passthrough(args: &[OsString], verbose: u8) -> Result<i32> {\n    if args.is_empty() {\n        anyhow::bail!(\"dotnet: no subcommand specified\");\n    }\n\n    let timer = tracking::TimedExecution::start();\n    let subcommand = args[0].to_string_lossy().to_string();\n\n    let mut cmd = resolved_command(\"dotnet\");\n    cmd.env(DOTNET_CLI_UI_LANGUAGE, DOTNET_CLI_UI_LANGUAGE_VALUE);\n    cmd.arg(&subcommand);\n    for arg in &args[1..] {\n        cmd.arg(arg);\n    }\n\n    if verbose > 0 {\n        eprintln!(\"Running: dotnet {} ...\", subcommand);\n    }\n\n    let result =\n        exec_capture(&mut cmd).with_context(|| format!(\"Failed to run dotnet {}\", subcommand))?;","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/rtk-ai/rtk/blob/0924356b4caba4989607227b7c8824d3d8098719/src/cmds/dotnet/dotnet_cmd.rs#L63-L99","documentation":"`run_passthrough` in the dotnet filter requires at least one argument (the subcommand, e.g. `build`, `test`) after `rtk dotnet`. When the args slice is empty there is nothing to proxy to `dotnet`, so the function bails with this error instead of spawning a command with no arguments.","triggerScenarios":"Invoking `rtk dotnet` with no subcommand and no arguments — the internal dispatch reaches `run_passthrough(&[], ...)`.","commonSituations":"A wrapper script or hook that strips arguments before calling rtk; a shell alias dropping args; a user typing `rtk dotnet` expecting interactive `dotnet` behavior; misconfigured MCP/tooling integration that forwards an empty argv.","solutions":["Pass a subcommand: e.g. `rtk dotnet build` or `rtk dotnet test`.","If you need unfiltered behavior with arguments, use `rtk proxy dotnet <subcommand> [args...]`.","Fix the calling wrapper/hook so it forwards its arguments to rtk instead of invoking `rtk dotnet` bare.","Update the dispatcher so an empty args case prints usage (`rtk dotnet <command> [args...]`) instead of surfacing this error."],"exampleFix":"// before\nrtk dotnet\n\n// after\nrtk dotnet build -bl","handlingStrategy":"validation","validationCode":"// guard before invoking the dotnet filter\nconst args: string[] = process.argv.slice(2);\nif (args[0] !== \"dotnet\" || args.length < 2) {\n  throw new Error(\"usage: rtk dotnet <subcommand> [args...]\");\n}","typeGuard":null,"tryCatchPattern":"match rtk_dotnet(&args) {\n    Ok(code) => std::process::exit(code),\n    Err(e) if e.to_string().contains(\"no subcommand specified\") => {\n        eprintln!(\"usage: rtk dotnet <build|test|run|...> [args...]\");\n        std::process::exit(2);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Always pass at least one subcommand after `rtk dotnet`.","Audit wrapper scripts and aliases to ensure argv is forwarded, not dropped.","Prefer `rtk proxy dotnet ...` when you need raw passthrough with arguments.","Use `rtk dotnet --help` to discover valid subcommands before invoking."],"tags":["dotnet","cli","missing-argument"],"backgroundTag":"missing-cli-argument","analyzedSha":"0924356b4caba4989607227b7c8824d3d8098719","analyzedAt":"2026-09-19T19:25:29.612Z","contentChangedAt":"2026-09-19T19:25:29.612Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}