website/docs/contributing/started.mdx
import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem";
The source is hosted on GitHub. When you want to contribute, create a fork so you can make changes in your repository and create a pull request in the official Oh My Posh repository.
To clone your fork of Oh My Posh locally, open the terminal and replace <user> with your GitHub username.
git clone [email protected]:<user>/oh-my-posh.git
<Tabs defaultValue="manual" groupId="git" values={[ { label: 'Manual', value: 'manual', }, { label: 'Winget', value: 'winget', }, ] }> <TabItem value="manual">
The codebase is in go, meaning we need a working go setup before we can do anything else. Have a look at the go guide to get up and running with go in no time!
:::caution Oh My Posh needs at least go 1.26.0 :::
To make sure we keep on writing quality code, golang-ci lint is used to validate the changes. Have a look at the local installation guide to make sure you can validate this yourself as well.
The documentation is written in markdown and uses Docusaurus to generate the website. To validate your changes, you'll need to have nodejs installed so you can run the website locally.
If you're not using Visual Studio Code yet, it's a great editor to work with go and the project has the configuration built-in. You can download it here. </TabItem> <TabItem value="winget">
The project has a winget configuration file available to install the dependencies. Navigate to the cloned repository and use winget to install the dependencies:
winget configure .config/configuration.winget
Done! Restart the terminal and you're ready to continue below.
</TabItem> </Tabs>This project uses APM (Agent Package Manager) to manage shared AI agent skills.
After cloning the repository, install APM and run apm install to pull in the shared skills:
# Install APM
pip install apm-cli
# Install shared skills
apm install
This pulls in shared coding conventions (Go, PowerShell, Markdown, and conventional commits)
from the agentic repository. Project-specific skills (segment-create and segment-docs)
are already included in the repository under .github/skills/.
A default config (.vscode folder) for Visual Studio Code is available in the repo:
golangci-lint is configured as the default linter.Once the extensions are installed:
The go source code can be found in the src/ directory, make sure to navigate to that one before continuing.
go test -v ./...
golangci-lint run
The easiest way to validate your changes is to write tests. Unfortunately, as it's a visual tool, you'll want to validate the changes by running the prompt in your shell as well.
If you already have Oh My Posh in your PATH, you'll need to either use that one as an output parameter, or make sure
that the $GOPATH/bin/ folder precedes the Oh My Posh binary in your PATH.
go build -o (Get-Command oh-my-posh.exe).Source
Alternatively:
$env:PATH = "$env:GOPATH\bin;$env:PATH"
go build -o $GOPATH/bin/oh-my-posh
Open your terminal and navigate to the website folder in the repository. Install the dependencies and start the website:
npm install
npm start
This will start a local server on http://localhost:3000 where you can see your changes.
Delve config is restrictive by default(string limit especially). You can expand some limits in VS Code(settings.json or directly in launch.json):
"go.delveConfig": {
"dlvLoadConfig": {
"followPointers": true,
"maxVariableRecurse": 3,
"maxStringLen": 400,
"maxArrayValues": 400,
"maxStructFields": -1
},
"apiVersion": 2,
"showGlobalVariables": false
}
With everything set up, you're ready to start making changes and create your first PR!