Install Oh-My-Posh On Windows Command Prompt (cmd) Via Clink
Tags: cmd, windows, ohmyposh, clink
Published: 2024-03-14 11:39:31

If you are a fan of CMD and want the beauty of oh-my-posh but you do not want to switch to Windows PowerShell so you on the right place 

The problem is that CMD directly does not support oh-my-posh on it so that's why we need to do via Clink 


![plan old CMD](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ehkojnvdo5g2gesmgxk8.png)

#Let's Start 😺:
##Step : 1

First of all we need to install **oh-my-posh** 

```
winget install JanDeDobbeleer.OhMyPosh -s winget
```
this commdand will install these things

> oh-my-posh.exe - Windows executable
 themes - The latest Oh My Posh


after installing **oh-my-posh** you should restart your Terminal for the path to be set

if the path does not automatically set you can do manual by copying the **bin** path  of oh-my-posh and adding it as new path in **Edit the system environment variables**

##Step 2 :

Now Download & Install CLink from
[Clink](https://chrisant996.github.io/clink/)

after installing clink open new Terminal you see some Changes

As you know that cmd directly does not support oh-my-posh on it 
so Clink 👍

##Step 3 :
Now we need find the path to **Clink scripts directory** which we can do by running this command 

`clink info` 

after running this you will get path to a lot of Clink associated but you need to select the path script 


![Path to Clink scripts directory](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xwphae4eh3ujmcn404j7.png)

in the case of this image **C:\User\WS\AppDate\Local\Clink** is the path to scripts directory yours will be something similar

## Step 4 :

Opening or going to Clink scripts directory

there you need to create a file named **_oh-my-posh.lua_** 

![oh-my-posh lua file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xlu0aksawttr5wsjtp4m.png)

##Step 5 :
Open that file and and write or copy & past the following 

```
load(io.popen('oh-my-posh.exe --config="C:/Users/me/jandedobbeleer.omp.json" --init --shell cmd'):read("*a"))()
```

here you should replace this **C:/Users/me/jandedobbeleer.omp.json** config with your own configuration.

##Step 6 : 
Restart you terminal or cmd then your good to go

you might not have the best experiences with but it is something or you might do it better than me  

![omp with cmd](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/62qjy4diuenj09vhnnx3.png)


## Thank You ❤️
 Thank you for giving me the honor to let you know how to do the thing i am very grateful to you

## Reference 😊
And am thankful to all the people who worked on the product, documents and the problems & issues with it

[Oh-My-posh Windows install](https://ohmyposh.dev/docs/installation/windows)
[Clink downalond link](https://chrisant996.github.io/clink/)
[Change your prompt from PowerShell to CMD](https://ohmyposh.dev/docs/installation/prompt)
[config oh-my-posh with Clink](https://chrisant996.github.io/clink/clink.html#oh-my-posh)
[using git-posh or/and oh-my-posh with Command Prompt(cmd, not Powershell) inside windows terminal](https://stackoverflow.com/questions/71563215/using-git-posh-or-and-oh-my-posh-with-command-promptcmd-not-powershell-inside)
[oh-my-posh Support for CMD](https://github.com/JanDeDobbeleer/oh-my-posh/issues/21)