A cli parser built using ink for ink
npm install ink-router-cliink-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.
- Getting Started
- Installation
- Usage
- Api reference
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
`tsx
import React, { FC } from "react";
import { Router, Switch, Command } from "ink-cli-router";
import { render, Text } from "ink";
const Create = () => {
return
};
const App: FC<{ any }> = () => {
return (
);
};
render(
`
!ss
---
A that uses react context to keep the UI sync with the CLI argument
and falgs
argv: string[] name
?: string description
?: string autoHelp?: boolean
Renders only the command and flags that match the CLI arguments
name: string description
?: string component
?: React.ReactElement
name: string alias
: string component
?: React.ReactElement description?: string
#### useCli
Use this hook to get the CLI arguments
returns
`ts``
{
command: string | undefined
arguments: string[] | undefined
flags: any
}