https://github.com/jeebuscrossaint/debt
remove the damn dollar sign we got no money
https://github.com/jeebuscrossaint/debt
Last synced: 12 months ago
JSON representation
remove the damn dollar sign we got no money
- Host: GitHub
- URL: https://github.com/jeebuscrossaint/debt
- Owner: jeebuscrossaint
- License: mit
- Created: 2025-04-16T01:13:22.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-17T01:24:41.000Z (about 1 year ago)
- Last Synced: 2025-05-18T16:11:18.996Z (about 1 year ago)
- Language: C
- Size: 11.7 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# debt


> **D**on't **E**ven **B**other with **T**erminal prefixes
Never worry about accidentally copying those pesky command prompt symbols again.
## What is debt?
`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.
```bash
# Without debt, this happens:
$ $ ls -la
-bash: $: command not found
# With debt installed:
$ $ ls -la
# Works as if you typed: ls -la
```
## Installation
### Using Nix (recommended)
```bash
$ nix profile install github:jeebuscrossaint/debt
```
### From Source
#### Prerequisites
- C compiler (GCC, Clang, MSVC, etc.)
- CMake 3.10 or higher
```bash
$ git clone https://github.com/jeebuscrossaint/debt.git
$ cd debt
$ mkdir build && cd build
$ cmake ..
$ make
$ sudo make install
```
## Usage
After installation, you can use `debt` in three ways:
### 1. Direct command execution
```bash
$ debt ls -la
```
### 2. Handling commands with $ or > prefixes
```bash
$ debt $ ls -la
$ debt > echo "hello world"
```
### 3. Transparent usage (recommended)
The installation creates symbolic links named `$` and `>` that point to the `debt` executable. This allows you to directly paste commands with prefixes:
```bash
$ $ ls -la
# Works as if you typed: ls -la
$ > npm install express
# Works as if you typed: npm install express
```
## How It Works
When you install `debt`, it:
1. Creates symbolic links (or copies on Windows) named `$` and `>` that point to the debt executable
2. 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
## Performance
`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
## Examples
### Copy-pasting from tutorials
```
# From a tutorial:
$ npm install express
$ node server.js
# You can copy-paste directly:
$ $ npm install express
$ $ node server.js
```
### Copy-pasting Windows commands
```
> cd project
> npm start
# Copy-paste directly:
$ > cd project
$ > npm start
```
## Comparison with Similar Tools
- **undollar** ([github.com/xtyrrell/undollar](https://github.com/xtyrrell/undollar)): The original inspiration, written in JavaScript. `debt` builds 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. `debt` works regardless of your shell and provides consistent behavior.
## Acknowledgments
- Inspired by [undollar](https://github.com/xtyrrell/undollar) by [xtyrrell](https://github.com/xtyrrell)
- Thanks to everyone who's ever been frustrated by copying terminal commands with prefixes 😄
---
## FAQ
**Q: Why is it called "debt"?**
A: **D**on't **E**ven **B**other with **T**erminal 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.