5 releases (3 breaking)

Uses new Rust 2024

0.4.0 Mar 20, 2026
0.3.0 Feb 18, 2026
0.2.1 Feb 17, 2026
0.2.0 Feb 17, 2026
0.1.0 Feb 17, 2026

#484 in Filesystem

MIT license

87KB
1.5K SLoC

Nushell 1K SLoC // 0.0% comments Rust 369 SLoC // 0.0% comments Shell 56 SLoC // 0.0% comments PowerShell 48 SLoC Ruby 26 SLoC

bpwd

A better pwd with clipboard support and targeting.

Installation

Homebrew (macOS/Linux)

brew install CodeTease/tap/bwd

Scoop (Windows)

scoop bucket add codetease https://github.com/CodeTease/scoop-bucket
scoop install bwd

Cargo

cargo install bpwd

Release

You can also download the binary from the Release page.

For more download methods, see INSTALLATION.md.

Usage

bwd [target] [-c] [-s] [-j] [-r]
  • target: Optional path to resolve relative to current directory. Use -- to separate flags from arguments (e.g., bwd -- -my-dir).
  • -c: Copy the result to clipboard.
  • -s: Shorten path (replace home directory with $HOME or %USERPROFILE%).
  • -j: Output path information as JSON.
  • -r: Print path relative to project root (searches for .git or .bwd-root).

Examples

Standard Output (Absolute Path)

$ bwd
/home/codetease/projects/bpwd

Shortened Path (-s)

$ bwd -s
$HOME/projects/bpwd

JSON Output (-j)

$ bwd -j
{"path":"/home/codetease/projects/bpwd","short":"$HOME/projects/bpwd","root":"."}

Priority Logic

  1. JSON (-j): Always outputs the JSON object.
  2. Short (-s): If JSON is not requested, outputs the shortened path.
  3. Default: Outputs the absolute path.

Dependencies

~0.2–7.5MB
~165K SLoC