Ink
Build CLI applications using React. Use when creating terminal UIs, handling keyboard input, or building interactive command-line tools with React components. Supports flexbox layouts, text styling, focus management, and accessibility.From its SKILL.md
npx -y skills add georg-unterholzner/ink-skill --skill inkAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.1 KB, 694 tokens by cl100k_base, as published. Nobody here has run it
Ink - React for CLIs
React for CLIs. Build and test your CLI output using components.
Ink provides the same component-based UI building experience that React offers in the browser, but for command-line apps. It uses Yoga for Flexbox layouts in the terminal.
Important: All text must be wrapped in a <Text> component.
Quick Example
import {render, Text, Box} from 'ink';
render(
<Box borderStyle="round" padding={1}>
<Text color="green">Hello World</Text>
</Box>
);
Components
<Text>- Display text with styling (color, bold, italic, underline, etc.)<Box>- Flexbox container for layouts- Layout Properties - dimensions, flex, spacing, alignment
- Visual Properties - borders, colors, backgrounds
<Newline>- Insert newline characters<Spacer>- Flexible space that expands to fill available space<Static>- Permanently render output above everything else (for logs, completed tasks)<Transform>- Transform string representation before output
Hooks
Interaction
useInput()- Handle keyboard input (arrow keys, enter, escape, etc.)useFocus()- Make components focusable with Tab keyuseFocusManager()- Programmatically manage focus
Lifecycle & Streams
useApp()- Exit the app programmaticallyuseStdin()- Access stdin stream and setRawModeuseStdout()- Access stdout stream and write outputuseStderr()- Access stderr stream
Accessibility
useIsScreenReaderEnabled()- Detect if screen reader is active
API
render(tree, options?)- Mount and render your app- Instance Methods - rerender(), unmount(), waitUntilExit(), clear()
measureElement(ref)- Get width and height of a component
Guides
- Accessibility & Screen Readers - ARIA support, screen reader integration
- Testing - Test Ink components with ink-testing-library
- React DevTools - Debug with React DevTools
Third-Party Components
See references/third-party.md for a comprehensive list of community components including:
- Text inputs, spinners, select menus
- Progress bars, tables, charts
- Markdown rendering, syntax highlighting
- And many more
What ships with it: 17 files
43.3 KB alongside SKILL.md
references/
- accessibility.md2.5 KB
- box-layout.md8.2 KB
- box-styling.md5.1 KB
- devtools.md734 B
- focus.md3.6 KB
- input.md3.8 KB
- instance.md862 B
- lifecycle.md2.2 KB
- measure.md1.2 KB
- render.md2.6 KB
- screen-reader.md559 B
- spacer-newline.md1.3 KB
- static.md2.6 KB
- testing.md556 B
- text.md2.6 KB
- third-party.md2.7 KB
- transform.md2.4 KB