JanDeDobbeleer/oh-my-posh · info

no pulumi spec file found

Error message

no pulumi spec file found

What it means

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.

Source

Thrown at src/segments/pulumi.go:117

		log.Error(fmt.Errorf("pulumi workspace file decode error"))
		return
	}

	log.Debugf("pulumi stack name: %s", pulumiWorkspaceSpec.Stack)
	p.Stack = pulumiWorkspaceSpec.Stack
}

func (p *Pulumi) getProjectName() error {
	var kind, fileName string
	for _, file := range []string{pulumiYAML, pulumiJSON} {
		if p.env.HasFiles(file) {
			fileName = file
			kind = filepath.Ext(file)[1:]
		}
	}

	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)

View on GitHub (pinned to 0976794618)

Solutions

  1. cd into the directory containing Pulumi.yaml (or create it with `pulumi new`)
  2. Keep the pulumi segment disabled unless the cwd contains a Pulumi.yaml (the segment's Enabled check should return false outside projects)
  3. If your spec uses a non-standard name/extension, rename it to Pulumi.yaml/yml/json
  4. In monorepos, run shells from the pulumi project subdirectory

Example fix

// before
$ cd ~/repos/api   # no Pulumi.yaml here
// error: no pulumi spec file found
// after
$ cd ~/repos/api/infra   # contains Pulumi.yaml
Defensive patterns

Strategy: validation

Validate before calling

// only enable the segment when a spec file exists
files := []string{"Pulumi.yaml", "Pulumi.yml", "Pulumi.json"}
for _, f := range files {
    if _, err := os.Stat(f); err == nil { return true }
}
return false

Prevention

When it happens

Trigger: 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.

Common situations: 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).

Related errors


AI-assisted analysis of JanDeDobbeleer/oh-my-posh@0976794618 (2026-08-31). Data as JSON: /api/errors/3caa762869ef5902. Report an issue: GitHub.