{"record":{"id":"445ad27b000f25d2","repo":"rtk-ai/rtk","slug":"gt-no-subcommand-specified","errorCode":null,"errorMessage":"gt: no subcommand specified","messagePattern":"gt: no subcommand specified","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmds/git/gt_cmd.rs","lineNumber":127,"sourceCode":"pub fn run_sync(args: &[String], verbose: u8) -> Result<i32> {\n    run_gt_filtered(&[\"sync\"], args, verbose, \"gt_sync\", filter_gt_sync)\n}\n\npub fn run_restack(args: &[String], verbose: u8) -> Result<i32> {\n    run_gt_filtered(&[\"restack\"], args, verbose, \"gt_restack\", filter_gt_restack)\n}\n\npub fn run_create(args: &[String], verbose: u8) -> Result<i32> {\n    run_gt_filtered(&[\"create\"], args, verbose, \"gt_create\", filter_gt_create)\n}\n\npub fn run_branch(args: &[String], verbose: u8) -> Result<i32> {\n    run_gt_filtered(&[\"branch\"], args, verbose, \"gt_branch\", filter_identity)\n}\n\npub fn run_other(args: &[OsString], verbose: u8) -> Result<i32> {\n    if args.is_empty() {\n        anyhow::bail!(\"gt: no subcommand specified\");\n    }\n\n    let subcommand = args[0].to_string_lossy();\n    let rest: Vec<String> = args[1..]\n        .iter()\n        .map(|a| a.to_string_lossy().into())\n        .collect();\n\n    // gt passes unknown subcommands to git, so \"gt status\" = \"git status\".\n    // Route known git commands to RTK's git filters for token savings.\n    match subcommand.as_ref() {\n        \"status\" => crate::git_cmd::run(\n            crate::git_cmd::GitCommand::Status,\n            &rest,\n            None,\n            verbose,\n            &[],\n        ),","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/rtk-ai/rtk/blob/0924356b4caba4989607227b7c8824d3d8098719/src/cmds/git/gt_cmd.rs#L109-L145","documentation":"`run_other` in the gt (Graphite) filter handles `gt` subcommands that have no dedicated filtered path. It requires the first argument to name the subcommand; with an empty args slice there is nothing to forward to `gt`, so it bails with this error.","triggerScenarios":"Calling `rtk gt` (or the dispatcher routing to `run_other`) with an empty argument list — no subcommand such as `sync`, `submit`, or `checkout` is present.","commonSituations":"Typing `rtk gt` alone expecting gt's interactive TUI; a wrapper or alias that swallows arguments; automation passing an empty argv array; shell history expansion issues dropping the subcommand.","solutions":["Provide the subcommand explicitly: e.g. `rtk gt sync`, `rtk gt submit`, `rtk gt branch`.","For dedicated flows use the filtered entry points (`run_branch` etc.) or plain `gt` outside rtk if you need the interactive UI.","Repair the calling wrapper/alias so arguments are forwarded verbatim to rtk.","Make the dispatcher show gt usage/help on empty args rather than raising this error."],"exampleFix":"// before\nrtk gt\n\n// after\nrtk gt sync","handlingStrategy":"validation","validationCode":"// guard before invoking the gt filter\nconst args: string[] = process.argv.slice(2);\nif (args[0] !== \"gt\" || args.length < 2) {\n  throw new Error(\"usage: rtk gt <subcommand> [args...]\");\n}","typeGuard":null,"tryCatchPattern":"match rtk_gt(&args) {\n    Ok(code) => std::process::exit(code),\n    Err(e) if e.to_string().contains(\"no subcommand specified\") => {\n        eprintln!(\"usage: rtk gt <sync|submit|branch|...> [args...]\");\n        std::process::exit(2);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Always specify a subcommand after `rtk gt`; rtk does not launch gt's interactive UI.","Check shell aliases/wrappers for argument-dropping when automating gt invocations.","Use the dedicated filtered paths (`rtk gt branch ...`) where available for better output reduction.","Run `rtk gt --help` to list supported subcommands before scripting against them."],"tags":["gt","graphite","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"}