Don't Even Bother with Terminal prefixes
Never worry about accidentally copying those pesky command prompt symbols again.
debt is a cross-platform command-line utility that strips the $ and > prefixes from terminal commands you copy from the web. It solves that frustrating moment when you paste a command from Stack Overflow or documentation that includes the prompt symbol, resulting in "command not found" errors.
# Without debt, this happens:
$ $ ls -la
-bash: $: command not found
# With debt installed:
$ $ ls -la
# Works as if you typed: ls -la$ nix profile install github:jeebuscrossaint/debt- C compiler (GCC, Clang, MSVC, etc.)
- CMake 3.10 or higher
$ git clone https://github.com/jeebuscrossaint/debt.git
$ cd debt
$ mkdir build && cd build
$ cmake ..
$ make
$ sudo make installAfter installation, you can use debt in three ways:
$ debt ls -la$ debt $ ls -la
$ debt > echo "hello world"The installation creates symbolic links named $ and > that point to the debt executable. This allows you to directly paste commands with prefixes:
$ $ ls -la
# Works as if you typed: ls -la
$ > npm install express
# Works as if you typed: npm install expressWhen you install debt, it:
- Creates symbolic links (or copies on Windows) named
$and>that point to the debt executable - When you run a command prefixed with
$or>, debt:- Detects if it's being called via these special names
- Strips the prefix
- Executes the rest of the command efficiently using your system's shell
debt is designed to be lightweight with minimal overhead:
- Direct execution without intermediate shells when possible
- Falls back to shell execution for complex commands with pipes, redirects, etc.
- Efficient signal handling to ensure proper behavior with Ctrl+C
# From a tutorial:
$ npm install express
$ node server.js
# You can copy-paste directly:
$ $ npm install express
$ $ node server.js
> cd project
> npm start
# Copy-paste directly:
$ > cd project
$ > npm start
-
undollar (github.com/xtyrrell/undollar): The original inspiration, written in JavaScript.
debtbuilds on this concept with cross-platform support, performance optimizations, and support for both$and>prefixes. -
Other shell aliases: Many users create shell aliases like
$='command', but these don't work across shells and can have unexpected behavior.debtworks regardless of your shell and provides consistent behavior.
- Inspired by undollar by xtyrrell
- Thanks to everyone who's ever been frustrated by copying terminal commands with prefixes 😄
Q: Why is it called "debt"?
A: Don't Even Bother with Terminal prefixes. Also, the dollar sign ($) is often associated with money and debt, and we're getting rid of it!
Q: Will this work on all platforms?
A: Yes! debt is designed to work on Linux, macOS, BSD, and Windows systems.
Q: Is it secure to use?
A: debt simply forwards commands to your system's default shell. It doesn't modify the command other than removing the leading $ or >.
Q: Why not just create a shell alias?
A: Shell aliases only work in specific shells, need to be configured for each user, and don't handle complex edge cases. debt works anywhere, for any user, consistently.