ink-cli-parser is a cli parser tool that is built just for ink. You can pass in you custom ink help component and error component.
To install ink-cli-parser
, ensure that you have Node.js >=10.
Install nodejs from here
The easiest way to install ink-cli-parser
is using NPM. If you have Node.js
installed, it is most likely that you have NPM installed as well
$ npm install ink-cli-parser
import React, { FC } from "react";
import { Router, Switch, Command } from "ink-cli-router";
import { render, Text } from "ink";
const Create = () => {
return <Text>{"Creating file"}</Text>;
};
const App: FC<{ any }> = () => {
return (
<Router argv={process.argv}>
<Switch>
<Command name="create" component={<Create />} />
</Switch>
</Router>
);
};
render(<App />);
To read more about the API you can visit here