{"record":{"id":"ecfbc2c91fb3aa1d","repo":"nikivdev/code","slug":"no-flow-toml-in-current-directory-and-no-active-pr","errorCode":null,"errorMessage":"No flow.toml in current directory and no active project set.\nRun a task in a project first, or use: f logs -p <project>","messagePattern":"No flow\\.toml in current directory and no active project set\\.\nRun a task in a project first, or use: f logs -p <project>","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/processes.rs","lineNumber":327,"sourceCode":"        let root = cfg_path\n            .parent()\n            .unwrap_or(Path::new(\".\"))\n            .canonicalize()\n            .unwrap_or_else(|_| cfg_path.parent().unwrap_or(Path::new(\".\")).to_path_buf());\n        (root, canonical, cfg.project_name)\n    } else if let Some(active) = projects::get_active_project() {\n        // Fall back to active project\n        match projects::resolve_project(&active)? {\n            Some(entry) => (entry.project_root, entry.config_path, Some(entry.name)),\n            None => {\n                bail!(\n                    \"Active project '{}' not found. Use `f projects` to see registered projects.\",\n                    active\n                );\n            }\n        }\n    } else {\n        bail!(\n            \"No flow.toml in current directory and no active project set.\\nRun a task in a project first, or use: f logs -p <project>\"\n        );\n    };\n\n    // If no task specified, try to find available logs - prefer running tasks\n    let task_name = match opts.task {\n        Some(name) => name,\n        None => {\n            let logs = get_project_log_files(&project_root, project_name.as_deref());\n\n            if logs.is_empty() {\n                println!(\"No logs found for this project.\");\n                return Ok(());\n            }\n\n            // Check for running tasks\n            let running = running::get_project_processes(&config_path).unwrap_or_default();\n            let running_tasks: Vec<_> = running.iter().map(|p| p.task_name.clone()).collect();","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/processes.rs#L309-L345","documentation":"This is the terminal fallback of show_task_logs' project resolution: no --project flag, no flow.toml in the current directory, and no active project set. Since there is no way to determine which project's logs to show, the tool bails with instructions on how to provide one.","triggerScenarios":"Running `f logs` (no -p, no task targeting context) from a directory without flow.toml on a fresh setup where projects::get_active_project() returns None.","commonSituations":"First-time use before any task has been run, running from $HOME or a random directory, a wiped config/registry file, or expecting logs to resolve globally instead of per project.","solutions":["cd into the project directory containing flow.toml and re-run `f logs`.","Pass a project explicitly: `f logs -p <project>`.","Run any task in your project first so it registers and becomes the active project."],"exampleFix":"// before\nf logs\n// after\ncd /path/to/project  # contains flow.toml\nf logs\n# or explicitly:\nf logs -p my-project","handlingStrategy":"validation","validationCode":"if !std::path::Path::new(\"flow.toml\").exists()\n    && std::env::var(\"F_PROJECT\").is_err()\n{\n    eprintln!(\"run from a project dir or set F_PROJECT / pass -p\");\n    std::process::exit(2);\n}","typeGuard":null,"tryCatchPattern":"match show_task_logs(opts) {\n    Ok(()) => (),\n    Err(e) if e.to_string().contains(\"No flow.toml\") => {\n        eprintln!(\"{e}\");\n        std::process::exit(2);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Always cd into the project (flow.toml) directory before `f logs`.","Use -p explicitly in scripts so cwd does not matter.","Run a task at least once per project so it registers as active.","Avoid wiping the tool's config directory without re-registering projects."],"tags":["cli","project-resolution","missing-config"],"backgroundTag":"missing-config-file","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}