Skip to content
This repository was archived by the owner on Nov 14, 2022. It is now read-only.

podrezo/react-command-line

Repository files navigation

react-command-line

ReactCLI is a ReactJS component that provides a simple way to present a command line interface to your user in your web app.

You can view a live demo here.

Installation

npm install --save react-command-line
# or
yarn add react-command-line

Example Usage

The following will produce a terminal where the user can type "hello" to see a message containing the arguments passed to the function.

const commands = {
  hello: {
    fn: args => {
      return `The arguments are ${args}`
    }
  }
}

// ...

ReactDOM.render(
  <CommandLine commands={commands} />,
  document.getElementById('root')
);

Features

  • Stylable terminal that accepts synchronous and asynchronous commands

Ideas for future features

  • Automatically clearing buffer past certain number of lines
  • Supporting ANSI colors

About

A ReactJS-based CLI component

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published