{"record":{"id":"38f7aaacb6f93748","repo":"plandex-ai/plandex","slug":"run-command-requires-exactly-one-file-path-argumen","errorCode":null,"errorMessage":"run command requires exactly one file path argument","messagePattern":"run command requires exactly one file path argument","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/cmd/repl.go","lineNumber":1064,"sourceCode":"\t\treturn false\n\t}\n\n\t// Check if file is within any project path\n\tfor path := range projectPaths.ActivePaths {\n\t\tprojectAbs, err := filepath.Abs(path)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tif strings.HasPrefix(absPath, projectAbs) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc handleRunCommand(args []string) error {\n\tif len(args) != 1 {\n\t\treturn fmt.Errorf(\"run command requires exactly one file path argument\")\n\t}\n\n\tfilePath := args[0]\n\n\t// Check if file exists\n\tif _, err := os.Stat(filePath); os.IsNotExist(err) {\n\t\treturn fmt.Errorf(\"file does not exist: %s\", filePath)\n\t}\n\n\t// Build command based on current mode\n\tvar cmdArgs []string\n\tif lib.CurrentReplState.Mode == lib.ReplModeTell {\n\t\tcmdArgs = []string{\"tell\", \"-f\", filePath}\n\t} else {\n\t\tcmdArgs = []string{\"chat\", \"-f\", filePath}\n\t}\n\n\t// Execute the command","sourceCodeStart":1046,"sourceCodeEnd":1082,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/cmd/repl.go#L1046-L1082","documentation":"Argument-count validation in handleRunCommand (REPL): the user typed `run` with zero or more than one argument. The run command accepts exactly one file path, so the input is rejected before any command is built.","triggerScenarios":"Invoking 'run' with zero arguments, or with two or more space-separated arguments (e.g. unquoted paths containing spaces).","commonSituations":"Forgetting the path entirely, pasting a path with spaces without quotes, attempting to pass extra flags to run.","solutions":["Provide exactly one file path: run plan.md","Quote paths containing spaces: run \"my plan.md\"","Escape or rename files whose names contain spaces"],"exampleFix":"// before\nrun my plan.md\n// after\nrun \"my plan.md\"","handlingStrategy":"validation","validationCode":"if len(args) != 1 {\n    return fmt.Errorf(\"run command requires exactly one file path argument\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always supply exactly one path to 'run'","Quote paths containing spaces","Don't pass flags to 'run' — edit the file instead","Check REPL help ('help run') for expected syntax"],"tags":["cli","repl","validation","arguments"],"backgroundTag":"missing-required-argument","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}