{"record":{"id":"9cfe954515e5aaec","repo":"nikivdev/code","slug":"no-flow-toml-found-run-f-setup-first","errorCode":null,"errorMessage":"No flow.toml found. Run `f setup` first.","messagePattern":"No flow\\.toml found\\. Run `f setup` first\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/deploy.rs","lineNumber":382,"sourceCode":"                        args: Vec::new(),\n                    });\n                }\n                bail!(\n                    \"No deployment config found in flow.toml and no 'deploy' task is defined.\\n\\n\\\n                    Add one of:\\n\\\n                    [host]\\n\\\n                    dest = \\\"/opt/myapp\\\"\\n\\\n                    run = \\\"./server\\\"\\n\\n\\\n                    [cloudflare]\\n\\\n                    path = \\\"worker\\\"\\n\\n\\\n                    [railway]\\n\\\n                    project = \\\"my-project\\\"\\n\\n\\\n                    Or run:\\n\\\n                    f deploy setup\"\n                );\n            }\n\n            bail!(\"No flow.toml found. Run `f setup` first.\")\n        }\n        Some(DeployAction::Host {\n            remote_build,\n            setup,\n        }) => deploy_host(&project_root, flow_config.as_ref(), remote_build, setup),\n        Some(DeployAction::Cloudflare { secrets, dev }) => {\n            deploy_cloudflare(&project_root, flow_config.as_ref(), secrets, dev)\n        }\n        Some(DeployAction::Web) => deploy_web(&project_root, flow_config.as_ref()),\n        Some(DeployAction::Setup) => setup_cloudflare(&project_root, flow_config.as_ref()),\n        Some(DeployAction::Railway) => deploy_railway(&project_root, flow_config.as_ref()),\n        Some(DeployAction::Status) => show_status(&project_root, flow_config.as_ref()),\n        Some(DeployAction::Logs {\n            follow,\n            since_deploy,\n            all,\n            lines,\n        }) => show_logs(","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/deploy.rs#L364-L400","documentation":"run_with_project_context reaches this bail when no flow.toml can be found in the current directory (or ancestors), for any deploy action other than the setup/host-setup paths. Deployment requires a project root containing flow.toml, so the library tells the user to run `f setup` first.","triggerScenarios":"Running `f deploy ...` (or `f deploy prod`) outside any directory containing flow.toml, e.g. home directory, a non-project subfolder, or before project initialization.","commonSituations":"Forgetting `f setup` after cloning a fresh repo; being in the wrong terminal directory; repo where flow.toml is gitignored and not committed; shallow checkout missing config files.","solutions":["cd into the project root that contains flow.toml (or run `f setup` there).","Run `f setup` to create flow.toml for a new project.","Restore/commit flow.toml if it was gitignored or deleted.","Verify with `ls flow.toml` before running deploy commands."],"exampleFix":"# before\n$ cd ~/ && f deploy\nNo flow.toml found. Run `f setup` first.\n# after\n$ cd ~/projects/myapp && f setup && f deploy","handlingStrategy":"validation","validationCode":"// Shell: run deploys only from a directory that has flow.toml\n[ -f flow.toml ] || { echo \"no flow.toml here — cd to project root or run 'f setup'\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `f setup` right after cloning a new repo.","Don't gitignore flow.toml (or commit a flow.toml.example and copy it in CI).","Script deploy commands with an explicit `cd <project_root> &&` prefix.","Check `ls flow.toml` when deploy commands fail mysteriously in nested dirs."],"tags":["config","flow-toml","project-root"],"backgroundTag":"missing-config-file","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}