Skip to content

Ink

React components for building interactive command-line apps in the terminal.

Stars
40.2k
Forks
1.1k
Licence
MIT
Language
TypeScript
Last update
5 days ago
Type
Library

What it is

Ink lets you build terminal programs using React, the component-based UI library normally used for web pages. You describe the output as components, and Ink draws it in the command line, using Flexbox-style layout via Yoga. It is useful if you already know React and want to make a CLI that updates over time or responds to input.

  • Build a CLI that shows a live-updating counter or progress display
  • Create a terminal menu or form that responds to keyboard input using useInput
  • Lay out terminal panels side by side with Box and Flexbox properties
  • Render CLI output that can be checked in tests

Great for

  • JavaScript or TypeScript developers who already know React
  • Teams building interactive command-line tools with live-updating output
  • Authors who want to structure CLI output as reusable components
  • Developers who want to test CLI output by rendering components

Not ideal for

  • People who only need a simple script with plain text output, since Ink adds React as a dependency
  • Non-developers, because it requires writing React code
  • Projects that cannot use Node.js-based tooling, since the README shows an npm install
Step-by-step guide: how to use InkInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Node.js · npm

    Install Ink and React

    npm install ink react
  2. 2

    Run it

    • Install Ink and React with npm install ink react
    • Create a file that imports render and Text from ink
    • Write a component, such as the Counter example in the README
    • Call render(<Counter />) and run the file with Node.js
  3. 3

    Get the most out of it

    • Use Box and Flexbox-style properties to lay out multiple sections in the terminal
    • Use useInput to respond to keyboard presses in interactive tools
    • Use Static for output that should stay on screen while other content updates
    • Use useFocus and useFocusManager to move focus between interactive elements
    • Look at the Testing section to check rendered CLI output in tests

Downloads

Strengths

  • Uses the familiar React component model and its features
  • Supports Flexbox-style layout in the terminal through Yoga
  • Widely used, with many listed projects such as Claude Code and Gemini CLI

Trade-offs

  • Requires knowing React, and the README says only Ink's own methods are documented, so you must learn React separately
  • The README notes the documented version is the upcoming release, and points to npm for the latest stable one
  • Adds a React runtime to what would otherwise be a simple command-line tool

How it compares

ProjectStarsTypeLevelUpdatedBest for
ink (this)40.2kLibraryintermediate5 days agoJavaScript or TypeScript developers who already know React
commander.js28.4kLibraryintermediate5 days agoNode.js developers writing a command-line tool
Inquirer.js21.6kLibraryintermediate5 days agoNode.js developers building interactive command-line tools
terminal105kAppbeginner6 days agoWindows users who work in the command line every day and want tabs and rich text
zoxide40.4kDev toolbeginner4 days agoDevelopers who move between many project folders in a terminal
cmder27kAppbeginner10 days agoWindows users who want a nicer, tabbed command-line window

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.