one-liner-cli
v1.0.0
Published
A command-line utility to convert multi-line terminal commands into a single line
Maintainers
Readme
One-Liner CLI
A command-line utility to convert multi-line terminal commands into a single line.
Installation
You can install this tool globally from npm:
npm install -g one-liner-cliUsage
After copying a multi-line command to your clipboard, simply run:
one-linerThis will read the command from your clipboard, convert it to a single line, and print the result to the console.
Options
-c, --copy: Read from clipboard and write the result back to clipboard-p, --print: Print the result to console (default)-v, --verbose: Show both original and converted command
Examples
Basic usage (prints the converted command):
one-linerCopy the result back to clipboard:
one-liner --copyShow both original and converted command:
one-liner --verboseCopy the result to clipboard and don't print to console:
one-liner --copy --no-printHow It Works
This tool:
- Reads text from your clipboard
- Converts multi-line commands into a single line by:
- Removing line continuation characters (
\at the end of lines) - Replacing newlines with spaces
- Removing extra spaces
- Removing line continuation characters (
- Outputs the result to the console and/or clipboard based on options
Development
To develop locally:
Clone the repository:
git clone https://github.com/yourusername/one-liner-cli.git cd one-liner-cliInstall dependencies:
npm installLink for local development:
npm link
License
ISC
