Back to Oh My Posh

Project

website/docs/segments/system/project.mdx

29.12.03.7 KB
Original Source

What

Display the current version of your project defined in the package file.

Supports:

  • Node.js project (package.json)
  • Deno project (deno.json, deno.jsonc)
  • JSR project (jsr.json, jsr.jsonc)
  • Cargo project (Cargo.toml)
  • Python project (pyproject.toml, supports metadata defined according to PEP 621 or Poetry)
  • Mojo project (mojoproject.toml)
  • PHP project (composer.json)
  • Dart project (pubspec.yaml)
  • Any nuspec based project (*.nuspec, first file match info is displayed)
  • .NET project (*.sln, *.slnf, *.slnx, *.csproj, *.vbproj or *.fsproj, first file match info is displayed)
  • Julia project (JuliaProject.toml, Project.toml)
  • PowerShell project (*.psd1, first file match info is displayed)

Sample Configuration

import Config from "@site/src/components/Config.js";

<Config data={{ type: "project", style: "powerline", powerline_symbol: "\uE0B0", foreground: "#193549", background: "#ffeb3b", template: " {{ if .Error }}{{ .Error }}{{ else }}{{ if .Version }}\uf487 {{.Version}}{{ end }} {{ if .Name }}{{ .Name }}{{ end }}{{ end }} ", }} />

Options

NameTypeDefaultDescription
always_enabledbooleanfalsealways show the segment
<type>_filesarray[]override the project's files to validate for. Use the .Type values listed below to override (e.g. dotnet_files)

Template (info)

:::note default template

template
 {{ if .Error }}{{ .Error }}{{ else }}{{ if .Version }}\uf487 {{.Version}}{{ end }} {{ if .Name }}{{ .Name }}{{ end }}{{ end }}

:::

Properties

NameTypeDescription
.TypestringThe type of project:<ul><li>node</li><li>deno</li><li>jsr</li><li>cargo</li><li>python</li><li>mojo</li><li>php</li><li>dart</li><li>nuspec</li><li>dotnet</li><li>julia</li><li>powershell</li></ul>
.VersionstringThe version of your project
.TargetstringThe target framework/language version of your project
.NamestringThe name of your project
.ErrorstringThe error context when we can't fetch the project info