Life's random bits By b1thunt3r (aka Ishan Jain)…
Supercharge Windows Command Prompt with Starship and Clink

Supercharge Windows Command Prompt with Starship and Clink

Ishan jain
Get some of the bash and zsh magic in Windows

For a while I have been using Oh My Posh forever in PowerShell. But I wanted to have same sort of info in Command Prompt (CMD). Yes I am traditional that way...

Starship allows me to have same configuration in Windows CMD, PowerShell on Windows and Linux, bash in WSL or Linux shell.

Unlike PowerShell and bash, CMD doesn't really have concept of profile, i.e. .bashrc or .bash_profile.
In past this could be archived with Autoexec.bat under DOS or DOS based Windows (Windows 95/98/ME). On modern Windows you can still have C:\AutoExec,bat, but it can only set variables and ignore anything else.
Under modern Windows you can execute programs when you start CMD, but Starship need to have more control over CMD. But somehow CLink can create a hook in CMD and introduces concept of profiles and other nifty things to CMD.

  1. Install Clink

    winget install chrisant996.Clink
    
  2. Install Starship

    winget install Starship.Starship
    
  3. Install Nerd Fonts

  4. Configure CLink to inject Starship

    • Create new %LocalAppData%\clink\starship.lua file

    • Add following to the starship.lua file

      load(io.popen('starship init cmd'):read("*a"))()
      
  5. Create %userprofile%\.config\starship.toml file

  6. Configure Starship

Note: Starship is best used with Windows Terminal.

Resources