Add stdin support to any CLI app that accepts file input

Related tags

Command Line tmpin
Overview

tmpin

Add stdin support to any CLI app that accepts file input

It pipes stdin to a temp file and spawns the chosen app with the temp file path as the first argument.

Similar to process substitution in ZSH/Bash, but cross-platform and without its limitation.

Install

$ npm install --global tmpin

Usage

$ tmpin --help

  Usage
    echo <string> | tmpin <app> [<args>]

  Example
    git diff | tmpin atom

  Note that the first argument to <app> will be set to the temp file

Tip

Create an alias in your .zshrc/.bashrc:

alias atom='tmpin atom'

# Or more specific
alias gda='git diff | tmpin atom'

License

MIT © Sindre Sorhus

You might also like...

download torrents with node from the CLI

download torrents with node from the CLI

torrent Download torrents from the command line usage torrent magnet link OR path to .torrent file Download a torrent from a magnet link to torre

Dec 26, 2022

:white_square_button: WhatsApp chat from commandline/console/cli using GoogleChrome puppeteer

:white_square_button: WhatsApp chat from commandline/console/cli using GoogleChrome puppeteer

Whatspup Use Whatsapp from commandline/console/cli using GoogleChrome puppeteer! 😄 Features ✅ Send and receive messages ✅ Read Receipts ✅ Switch betw

Dec 1, 2022

:notes: Control iTunes via CLI

:notes: Control iTunes via CLI

itunes-remote Control iTunes via your terminal 🎶 Using JXA via osascript via Node.js. Requirements Node.js (v0.12.7 or greater) Mac OS X (Yosemite 10

Nov 19, 2022

Node.js Open CLI Framework. Built with 💜 by Heroku.

Node.js Open CLI Framework. Built with 💜 by Heroku.

oclif: Node.JS Open CLI Framework 🗒 Description 🚀 Getting Started Tutorial ✨ Features 📌 Requirements 🌈 CLI Types 🏗 Usage 📚 Examples 🔨 Commands

Jan 4, 2023

Git commit CLI

commitme Based on this gist by @gustavopch Installation You can install this on your package using npm i -D commitme or run it once using npx commitme

Jun 6, 2021

An extension geared towards Spotify users with larger libraries; view all your playlists that contain a specific song with the click of a button. Designed for Spicetify (https://github.com/khanhas/spicetify-cli)

An extension geared towards Spotify users with larger libraries; view all your playlists that contain a specific song with the click of a button. Designed for Spicetify (https://github.com/khanhas/spicetify-cli)

ViewPlaylistsWithSong An extension developed for Spicetify that allows you to view all the playlists in your library that contain a certain song. Idea

Dec 13, 2022

HMSC (How Much Stuffs CLI) analyst for your files and folders

HMSC (How Much Stuffs CLI) analyst for your files and folders

HMSC 🔰 About HMSC (How Much Stuffs CLI) analyst for your files and folders 📸 Screenshot 📓 Requirements Node.js NPM 🔌 Installation $ npm i -g hmsc

Jan 10, 2022

A C++ based command-line (CLI) program that lets you manage your tasks

A C++ based command-line (CLI) program that lets you manage your tasks

COMMAND LINE INTERFACE TODO APP a command-line (CLI) program that lets you manage your tasks. The specification for this project is written down as te

Dec 25, 2021

A CLI progam show teminal outputs as gradients.

A CLI progam show teminal outputs as gradients.

GRADIENT-TERMINAL A CLI progam to display teminal outputs as gradients. Requirements For Installation, you will only need Node.js. Install $ git clone

Jan 3, 2023
Releases(v3.0.0)
Owner
Sindre Sorhus
Full-Time Open-Sourcerer. Wants more empathy & kindness in open source. Focuses on Swift & JavaScript. Makes macOS apps, CLI tools, npm packages. Likes unicorns
Sindre Sorhus
Pretty diff to html javascript cli (diff2html-cli)

diff2html-cli Diff to Html generates pretty HTML diffs from unified and git diff output in your terminal Table of Contents Features Online Example Dis

Rodrigo Fernandes 404 Dec 19, 2022
LinkFree CLI is a command line tool that helps you to create your LinkFree profile through CLI.

LinkFree CLI LinkFree CLI is a command line tool that helps you to create your LinkFree profile through CLI. Demo Using the CLI (Commands) Note First

Pradumna Saraf 32 Dec 26, 2022
A CLI for peer-to-peer file sharing using the Hypercore Protocol.

A CLI for peer-to-peer file sharing (and more) using the Hypercore Protocol.

Hypercore Protocol 207 Dec 30, 2022
A CLI to add and remove local development environments and create HTTPS certificates for them.

A CLI used to create a local https dev environment with the green lock. Setup takes less than 5 minutes and all of your projects will be running locally over HTTPS with custom domain names in no time!

Entrostat (Pty) Ltd 5 Sep 19, 2022
Clii - Easily build a cli app

Clii Easily build a cli app. Write some functions, jsdoc it, clii automatically turns it into a cli. Clii Quick Start Cli Tool License Quick Start Ins

null 38 Sep 9, 2022
Infinite Red's cutting edge React Native project boilerplate, along with a CLI, component/model generators, and more!

Ignite - the hottest React Native boilerplate Battle-tested React Native boilerplate The culmination of five years of constant React Native developmen

Infinite Red, Inc. 14.7k Dec 29, 2022
CLI tool for running Yeoman generators

yo What's Yeoman? Yeoman helps you to kickstart new projects, prescribing best practices and tools to help you stay productive. To do so, we provide a

Yeoman 3.6k Dec 30, 2022
Test your internet connection speed and ping using speedtest.net from the CLI

speed-test Test your internet connection speed and ping using speedtest.net from the CLI Install Ensure you have Node.js version 8+ installed. Then ru

Sindre Sorhus 3.8k Jan 7, 2023
Distributed, realtime CLI for live Node apps.

Vantage = CLI + SSH + REPL for your live node app. In one line: require("vantage")().listen(4000); What just happened? That's voodoo magic: show me th

dc 3.5k Dec 30, 2022