JanDeDobbeleer/oh-my-posh · warning
unknown pulumi spec file format
Error message
unknown pulumi spec file format
What it means
The oh-my-posh pulumi segment reads the Pulumi project spec file (Pulumi.yaml or Pulumi.json) in the current directory to extract the project name. It decides how to parse the file based on the file extension (yaml/json). This error is thrown in the default branch of that switch when the located spec file has an extension the segment does not recognize, so it cannot deserialize the project name.
Source
Thrown at src/segments/pulumi.go:131
}
}
if kind == "" {
return fmt.Errorf("no pulumi spec file found")
}
var pulumiFileSpec pulumiFileSpec
var err error
pulumiFile := p.env.FileContent(fileName)
switch kind {
case YAML:
err = yaml.Unmarshal([]byte(pulumiFile), &pulumiFileSpec)
case JSON:
err = json.Unmarshal([]byte(pulumiFile), &pulumiFileSpec)
default:
err = fmt.Errorf("unknown pulumi spec file format")
}
if err != nil {
log.Error(err)
return nil
}
p.Name = pulumiFileSpec.Name
p.workspaceSHA1 = p.sha1HexString(p.env.Pwd() + path.Separator() + fileName)
return nil
}
func (p *Pulumi) sha1HexString(s string) string {
h := sha1.New()
_, err := h.Write([]byte(s))View on GitHub (pinned to 0976794618)
Solutions
- Rename the spec file to Pulumi.yaml or Pulumi.json (exact lowercase extension)
- Verify only the standard Pulumi.yaml/Pulumi.json files exist in the project root
- Check the logged error in the prompt debug output (oh-my-posh debug) to confirm which file was matched
Example fix
// before: file named Pulumi.YAML on Linux $ mv Pulumi.YAML Pulumi.yaml // after: segment detects kind == "yaml" and parses the project name
Defensive patterns
Strategy: validation
Validate before calling
if !fileExists("Pulumi.yaml") && !fileExists("Pulumi.json") {
// segment will be disabled; don't rely on pulumi data in the template
} Prevention
- Keep the spec file named exactly Pulumi.yaml or Pulumi.json with a lowercase extension
- Avoid renaming project spec files to other extensions
- Use `oh-my-posh debug` to check segment errors when a segment silently disappears
When it happens
Trigger: A spec file matching the pulumi project layout but with an extension other than .yaml or .json exists in the working directory (the loop in getProjectName picks the last file from the [Pulumi.yaml, Pulumi.json] list present, so kind can only be 'yaml' or 'json'; in practice this branch fires only if a non-standard file is matched by HasFiles or the extension case differs, e.g. Pulumi.YAML on a case-sensitive filesystem).
Common situations: Case-mismatched filenames (Pulumi.YAML) on Linux, custom spec filenames picked up by the segment, or future Pulumi formats the segment does not support yet. The segment logs the error and returns nil from getProjectName, so Enabled returns false and the segment silently disappears.
Related errors
- pulumi workspace file decode error
- no pulumi spec file found
- pulumi stack name is empty, use `fetch_stack` property to en
- unable to get pulumi about output
- pulumi about output decode error
AI-assisted analysis of JanDeDobbeleer/oh-my-posh@0976794618 (2026-08-31).
Data as JSON: /api/errors/74c27af1c6603bc7.
Report an issue: GitHub.