{"record":{"id":"3caa762869ef5902","repo":"JanDeDobbeleer/oh-my-posh","slug":"no-pulumi-spec-file-found","errorCode":null,"errorMessage":"no pulumi spec file found","messagePattern":"no pulumi spec file found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/segments/pulumi.go","lineNumber":117,"sourceCode":"\t\tlog.Error(fmt.Errorf(\"pulumi workspace file decode error\"))\n\t\treturn\n\t}\n\n\tlog.Debugf(\"pulumi stack name: %s\", pulumiWorkspaceSpec.Stack)\n\tp.Stack = pulumiWorkspaceSpec.Stack\n}\n\nfunc (p *Pulumi) getProjectName() error {\n\tvar kind, fileName string\n\tfor _, file := range []string{pulumiYAML, pulumiJSON} {\n\t\tif p.env.HasFiles(file) {\n\t\t\tfileName = file\n\t\t\tkind = filepath.Ext(file)[1:]\n\t\t}\n\t}\n\n\tif kind == \"\" {\n\t\treturn fmt.Errorf(\"no pulumi spec file found\")\n\t}\n\n\tvar pulumiFileSpec pulumiFileSpec\n\tvar err error\n\n\tpulumiFile := p.env.FileContent(fileName)\n\n\tswitch kind {\n\tcase YAML:\n\t\terr = yaml.Unmarshal([]byte(pulumiFile), &pulumiFileSpec)\n\tcase JSON:\n\t\terr = json.Unmarshal([]byte(pulumiFile), &pulumiFileSpec)\n\tdefault:\n\t\terr = fmt.Errorf(\"unknown pulumi spec file format\")\n\t}\n\n\tif err != nil {\n\t\tlog.Error(err)","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/blob/0976794618c5ed95de0985dded50de1b4dc914cb/src/segments/pulumi.go#L99-L135","documentation":"The pulumi segment searches the current directory for a Pulumi spec file (Pulumi.yaml / Pulumi.yml / Pulumi.json by extension). If none is found (no recognized extension), getProjectName returns 'no pulumi spec file found', disabling the project-name display.","triggerScenarios":"Rendering the pulumi segment outside any pulumi project directory, inside a project whose spec file was renamed/deleted, or when only Pulumi.yaml.example or nested (subdirectory) spec files exist in a monorepo.","commonSituations":"Prompt rendered in a non-pulumi directory with the segment always enabled; monorepo where Pulumi.yaml sits in a subfolder; pulumi project not yet initialized (`pulumi new` not run).","solutions":["cd into the directory containing Pulumi.yaml (or create it with `pulumi new`)","Keep the pulumi segment disabled unless the cwd contains a Pulumi.yaml (the segment's Enabled check should return false outside projects)","If your spec uses a non-standard name/extension, rename it to Pulumi.yaml/yml/json","In monorepos, run shells from the pulumi project subdirectory"],"exampleFix":"// before\n$ cd ~/repos/api   # no Pulumi.yaml here\n// error: no pulumi spec file found\n// after\n$ cd ~/repos/api/infra   # contains Pulumi.yaml","handlingStrategy":"validation","validationCode":"// only enable the segment when a spec file exists\nfiles := []string{\"Pulumi.yaml\", \"Pulumi.yml\", \"Pulumi.json\"}\nfor _, f := range files {\n    if _, err := os.Stat(f); err == nil { return true }\n}\nreturn false","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run pulumi new to initialize projects properly","Scope the pulumi segment to pulumi project directories","Keep the spec named Pulumi.yaml/yml/json","In monorepos, work from the subdirectory containing the spec"],"tags":["go","pulumi","filesystem","missing-file","segment"],"backgroundTag":"missing-project-file","analyzedSha":"0976794618c5ed95de0985dded50de1b4dc914cb","analyzedAt":"2026-08-31T23:41:19.708Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}