---
id: installation
title: Installation
sidebar_label: 🚀 Installation
---

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

### 1. Setup your terminal

<Tabs
  groupId="operating-systems"
  defaultValue="windows"
  values={[
    { label: 'windows', value: 'windows', },
    { label: 'macos', value: 'macos', },
    { label: 'unix', value: 'unix', },
  ]
}>
<TabItem value="windows">

#### Terminal

While Oh my Posh works on the standard terminal, we advise using the [Windows Terminal][wt].

</TabItem>
<TabItem value="macos">

#### Terminal

As the standard terminal has issues displaying the ANSI characters correctly, we advise using
[iTerm2][iterm2] or any other modern day MacOS terminal that supports ANSI characters.

</TabItem>
<TabItem value="unix">

#### Terminal

Oh my Posh uses ANSI color codes under the hood, these should work in every terminal,
but you may have to set the environment variable `$TERM` to `xterm-256color` for it to work.

</TabItem>
</Tabs>

#### Font

To see the icons displayed in Oh my Posh, **install** and **configure** your terminal to use a powerline enabled font.
The fonts we use are patched by [Nerd Fonts][nerdfonts], which offer a maximum of icons you can use.

Oh my Posh was designed using [Meslo LGM NF][meslo], but any Nerd Font should be compatible with the standard [themes][themes].

:::caution Windows fonts
Make sure to install fonts system wide to avoid seeing rectangles in your terminal. See this [thread][font-thread] for more context.
:::

### 2. Download the latest binary

:::info PowerShell
There's a [PowerShell module][powershell] that contains all of the functionality below and makes installation a breeze.
If you're not looking to use Oh my Posh outside of PowerShell, have a look at the [module][powershell] rather than continue reading here.
:::

<Tabs
  groupId="operating-systems"
  defaultValue="windows"
  values={[
    { label: 'windows', value: 'windows', },
    { label: 'macos', value: 'macos', },
    { label: 'unix', value: 'unix', },
  ]
}>
<TabItem value="windows">

#### Scoop

A [Scoop][scoop] package is available to assist installs on Windows.

#### Manual

```powershell
mkdir C:\tools
Invoke-Webrequest https://github.com/JanDeDobbeleer/oh-my-posh3/releases/latest/download/posh-windows-amd64.exe -OutFile C:\tools\oh-my-posh.exe
```

</TabItem>
<TabItem value="macos">

#### Homebrew

A [Homebrew][brew] package is available to assist installs on MacOS.

#### Manual

```bash
wget https://github.com/JanDeDobbeleer/oh-my-posh3/releases/latest/download/posh-darwin-amd64 -O /usr/local/bin/oh-my-posh
chmod +x /usr/local/bin/oh-my-posh
```

</TabItem>
<TabItem value="unix">

#### Manual

```bash
wget https://github.com/JanDeDobbeleer/oh-my-posh3/releases/latest/download/posh-linux-amd64 -O /usr/local/bin/oh-my-posh
chmod +x /usr/local/bin/oh-my-posh
```

</TabItem>
</Tabs>


### 3. Download the themes

<Tabs
  groupId="operating-systems"
  defaultValue="windows"
  values={[
    { label: 'windows', value: 'windows', },
    { label: 'macos', value: 'macos', },
    { label: 'unix', value: 'unix', },
  ]
}>
<TabItem value="windows">

#### Scoop

When using [Scoop][scoop], all themes are downloaded as well.

#### Manual

```powershell
mkdir ~\.poshthemes
Invoke-Webrequest https://github.com/JanDeDobbeleer/oh-my-posh3/releases/latest/download/themes.zip -OutFile ~\.poshthemes\themes.zip
Expand-Archive ~\.poshthemes\themes.zip -DestinationPath ~\.poshthemes -Force
Remove-Item ~\.poshthemes\themes.zip
```

#### Preview the themes

When using Scoop, replace `"~\.poshthemes\*"` with `"$(scoop prefix oh-my-posh)/themes/*"`

```powershell
Get-ChildItem -Path "~\.poshthemes\*" -Include '*.omp.json' | Sort-Object Name | ForEach-Object -Process {
    $esc = [char]27
    Write-Host ""
    Write-Host "$esc[1m$($_.BaseName)$esc[0m"
    Write-Host ""
    & "C:\tools\oh-my-posh.exe" -config $($_.FullName) -pwd $PWD
    Write-Host ""
}
```

</TabItem>
<TabItem value="macos">

#### Homebrew

When using [Homebrew][brew], all themes are downloaded as well.

#### Manual

```bash
mkdir ~/.poshthemes
wget https://github.com/JanDeDobbeleer/oh-my-posh3/releases/latest/download/themes.zip -O ~/.poshthemes/themes.zip
unzip ~/.poshthemes/themes.zip -d ~/.poshthemes
chmod u+rw ~/.poshthemes/*.json
rm ~/.poshthemes/themes.zip
```

#### Preview the themes

When using Hombrew, replace `~/.poshthemes/*.omp.json` with `$(brew --prefix oh-my-posh)/themes/*.omp.json`

```bash
for file in ~/.poshthemes/*.omp.json; do echo "$file\n"; oh-my-posh --config $file --shell universal; echo "\n"; done;
```

</TabItem>
<TabItem value="unix">

#### Manual

```bash
mkdir ~/.poshthemes
wget https://github.com/JanDeDobbeleer/oh-my-posh3/releases/latest/download/themes.zip -O ~/.poshthemes/themes.zip
unzip ~/.poshthemes/themes.zip -d ~/.poshthemes
chmod u+rw ~/.poshthemes/*.json
rm ~/.poshthemes/themes.zip
```

#### Preview the themes

```bash
for file in ~/.poshthemes/*.omp.json; do echo "$file\n"; oh-my-posh --config $file --shell universal; echo "\n"; done;
```

</TabItem>
</Tabs>

### 4. Replace your existing prompt

If you have no idea which shell you're currently using, Oh my Posh has a utility switch that will you tell you.

```bash
oh-my-posh --print-shell
```

<Tabs
  defaultValue="zsh"
  values={[
    { label: 'zsh', value: 'zsh', },
    { label: 'powershell', value: 'powershell', },
    { label: 'bash', value: 'bash', },
    { label: 'nix', value: 'nix', },
    { label: 'fish', value: 'fish', },
    { label: 'nu', value: 'nu', },
  ]
}>
<TabItem value="powershell">

Edit `$PROFILE` in your preferred PowerShell version and add the following line.

```powershell
Invoke-Expression (oh-my-posh --init --shell pwsh --config ~/.poshthemes/jandedobbeleer.omp.json)
```

Once added, reload your profile for the changes to take effect.

```powershell
. $profile
```

</TabItem>
<TabItem value="zsh">

Add the following to `~/.zshrc`:

```bash
eval "$(oh-my-posh --init --shell zsh --config ~/.poshthemes/jandedobbeleer.omp.json)"
```

Once added, reload your profile for the changes to take effect.

```bash
source ~/.zshrc
```

</TabItem>
<TabItem value="bash">

Add the following to `~/.bashrc` (or `~/.profile` on MacOS):

```bash
eval "$(oh-my-posh --init --shell bash --config ~/.poshthemes/jandedobbeleer.omp.json)"
```

Once added, reload your profile for the changes to take effect.

```bash
. ~/.bashrc
```

Or, when using `~/.profile`.

```bash
. ~/.profile
```

</TabItem>
<TabItem value="fish">

Redefine `fish_prompt` in `~/.config/fish/config.fish`:

```bash
oh-my-posh --init --shell fish --config ~/.poshthemes/jandedobbeleer.omp.json | source
```

Once added, reload your config for the changes to take effect.

```bash
. ~/.config/fish/config.fish
```

</TabItem>
<TabItem value="nu">

Set the prompt and restart nu shell:

```bash
config set prompt  "= `{{$(oh-my-posh --config ~/.poshthemes/jandedobbeleer.omp.json | str collect)}}`"
```

Restart nu shell for the changes to take effect.

</TabItem>
</Tabs>

### 5. Next steps

At this point you're good to go. The `jandedobbeleer.omp.json` theme displays most common use-cases
in your prompt so 9/10 you'll be more than happy with it. However, if you want to explore additional
functionality, going through the additional steps below will help you get started.

#### Change the theme

We downloaded all the themes and set `jandedobbeleer.omp.json` as the one to use.
However, there are a lot more to be discovered and maybe there are some you like better.

Adjust your configuration to use any other theme from the folder we created (`~/.poshthemes`).

#### Override the theme settings

Maybe there's a theme you like, but you don't fancy the colors. Or, maybe there's a segment you
want to tweak/add, or replace some of the icons with a different one. Whatever the case, read through all
available options first, by starting with the [configuration guide][configuration].

Afterwards, the easiest way to go about this is to print the current config and store it elsewhere first (for example `~/.mytheme.omp.json`).

```bash
oh-my-posh --print-config
```

This will write the current configuration in your shell, allowing you to copy paste it in a new file
and store it somehwere. Once adjusted to your liking, [change the prompt setting][prompt] to use the newly created file.

```bash
oh-my-posh --config ~/.mytheme.omp.json
```

#### JSON Schema

There's an easy to use [JSON schema][schema] available to validate your theme and have auto completion when editing.
When using [Visual Studio Code][vscode], you can extend your settings file (F1 -> Preferences: Open Settings (JSON))
by adding the following lines:

```json
"json.schemas": [
  {
    "fileMatch": ["*.omp.json"],
    "url": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh3/main/themes/schema.json"
  }
]
```

🎉🎉🎉

[wt]: https://github.com/microsoft/terminal
[iterm2]: https://www.iterm2.com/
[nerdfonts]: https://www.nerdfonts.com/
[nf-cheat]: https://www.nerdfonts.com/cheat-sheet
[meslo]: https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Meslo.zip
[font-thread]: https://github.com/JanDeDobbeleer/oh-my-posh3/issues/145#issuecomment-730162622
[powershell]: /docs/powershell
[themes]: https://github.com/JanDeDobbeleer/oh-my-posh3/tree/main/themes
[scoop]: /docs/scoop
[brew]: /docs/homebrew
[prompt]: /docs/installation#4-replace-your-existing-prompt
[configuration]: /docs/configure
[schema]: https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh3/main/themes/schema.json
[vscode]: https://code.visualstudio.com/
