Manage PATH on Windows, Mac, and Linux with various Shells
Go to file
AJ ONeal ff57c6cc53
chore: go mod vendor
2023-11-04 22:55:01 -06:00
envpath bugfixes for windows and git bash 2019-07-28 05:03:44 -06:00
npm bugfix console.error 2019-08-10 01:17:32 -06:00
tools v0.5.0: initial publishable version 2019-07-28 04:04:53 -06:00
vendor chore: go mod vendor 2023-11-04 22:55:01 -06:00
winpath bugfixes for windows and git bash 2019-07-28 05:03:44 -06:00
.gitignore go generate version 2019-07-28 04:08:45 -06:00
LICENSE Initial commit 2019-07-22 04:21:08 +00:00
README.md remove old download urls 2021-02-25 17:37:41 -07:00
build-all.sh remove debug version references 2019-07-28 05:11:15 -06:00
go.mod chore: update deps 2023-11-04 22:55:00 -06:00
go.sum chore: update deps 2023-11-04 22:55:00 -06:00
pathman.go bugfixes for windows and git bash 2019-07-28 05:03:44 -06:00
pathman_unixes.go bugfixes for windows and git bash 2019-07-28 05:03:44 -06:00
pathman_windows.go bugfixes for windows and git bash 2019-07-28 05:03:44 -06:00

README.md

pathman

Manage PATH on Windows 10, Mac, and Linux with various Shells

pathman list
pathman add ~/.local/bin
pathman remove ~/.local/bin
pathman version
pathman help

Where is the PATH managed?

  • Windows 10: stores PATH in the registry.
  • Mac & Linux: stores PATH in ~/.config/envman/PATH.env

Note for Windows 10 users: due to differences in how cmd.exe, PowerShell, and pathman use and interpret strings, spaces, paths, and variables, you'll get more consistent results if you:

  • Use ~ rather than %USERPROFILE% or $Env:USERPROFILE
  • Use / rather than \ for delimiting paths

Install

Mac, Linux:

curl -s https://webinstall.dev/pathman | bash

Windows 10:

This can be run from cmd.exe or PowerShell (curl.exe is a native part of Windows 10).

curl.exe -sA "MS" https://webinstall.dev/pathman | powershell

Manual Install

  1. Download
  2. Add to PATH

Or install via npm:

npm install -g pathman

Windows

mkdir %userprofile%\bin
move pathman.exe %userprofile%\bin\pathman.exe
%userprofile%\bin\pathman.exe add ~/bin

Mac, Linux, etc

mkdir -p ~/.local/bin
mv ./pathman ~/.local/bin
pathman add ~/.local/bin

Downloads

Webi (https://webinstall.dev/pathman) is the preferred install method, but you can also download from Git Releases: https://git.rootprojects.org/root/pathman/releases.

MacOS (including Apple Silicon M1), Linux, Raspberry Pi:

tar xvf pathman-v*.tar.gz
chmod a+x ./pathman
./pathman --help

Windows 10:

tar.exe xvf pathman-v*.zip
.\pathman.exe --help

Supported Platforms

  • MacOS
    • Apple Silicon M1
    • Intel x86_64
  • Windows 10, 8, 7
  • Linux
    • amd64 / x86_64
    • 386
  • Raspberry Pi (Linux ARM)
    • RPi 4 (64-bit armv8)
    • RPi 3 (armv7)
    • ARMv6
    • RPi Zero (armv5)

CLI Help (API)

add

pathman add ~/.local/bin
Saved PATH changes. To set the PATH immediately, update the current session:

	export PATH="/Users/me/.local/bin:$PATH"

remove

pathman remove ~/.local/bin
Saved PATH changes. To set the PATH immediately, update the current session:

	export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

list

pathman list
pathman-managed PATH entries:

	$HOME/.local/bin

other PATH entries:

	/usr/local/bin
	/usr/bin
	/bin
	/usr/sbin
	/sbin

Windows

You can use ~ as a shortcut for %USERPROFILE%.

pathman add ~\.local\bin

The registry will be used, even when your using Node Bash, Git Bash, or MINGW.

build

git clone https://git.rootprojects.org/root/pathman.git
go mod tidy
go mod vendor
go generate -mod=vendor ./...
go build -mod=vendor
./pathman list