Hello πŸ™‹πŸ»β€β™€οΈ

Renee Ghattas

Software Developer @ Qlik

Building a CLI tool using React

How do you make a CLI tool using React?

πŸ€”

  • Is a library for building command-line applications using React components.
  • Is a react renderer
  • Can use all react features (hooks, state, context, etc.)
  • Is highly testable because of its component nature
  • Uses chalk for theming and yoga for layout
import { render, Color } from 'ink';

const Hello = () => <Color green>Hello World</Color>;
render(<Hello/>);

Example Hello World

Output

Built-in Components

  • Box
  • Text
  • Color
  • Static
  • AppContext
  • StdinContext
  • StdoutContext

External Components

Built with Ink

  • emojΒ - Find relevant emoji on the command-line.
  • gomoku-terminalΒ - Play online Gomoku in the terminal.
  • gatsby-cliΒ - Gatsby is a modern web framework for blazing fast websites.

Demo πŸ’»

Thanks!

Made with Slides.com