An open API service indexing awesome lists of open source software.

https://github.com/qduc/ink-prompt

An Ink component for collecting multi-line text in CLIs
https://github.com/qduc/ink-prompt

cli ink input multiline react terminal textarea

Last synced: about 2 months ago
JSON representation

An Ink component for collecting multi-line text in CLIs

Awesome Lists containing this project

README

          

# ink-prompt

A React Ink component library focused on terminal-friendly prompts. The first
export is `MultilineInput`, an Ink component for collecting multi-line text in
CLIs.

## Installation

```bash
npm install ink-prompt
```

## Usage

```tsx
import React from 'react';
import { render, Box, Text } from 'ink';
import { MultilineInput } from 'ink-prompt';

const App = () => {
return (

Describe your change (press Enter to submit):
console.log(value)}
width={80}
/>

);
};

render();
```

`MultilineInput` supports typical editing controls:

- Arrow keys for navigation
- `Ctrl+J` or typing `\` before Enter to add a newline
- `Ctrl+Z`/`Ctrl+Y` for undo/redo
- Enter submits the current buffer

## Development

```bash
# Install dependencies
npm install

# Build the project
npm run build

# Watch for changes
npm run dev

# Type check
npm run type-check
```

## License

MIT