This is the core of the CLI - this command generates a new React component, based on the name and options passed to it
Arguments
Name
Description
component
Options
Name
Description
--props <arg>
Determines which prop declaration/validation solution to generate. Defaults to `ts` if `typescript` flag is `true`, `none` otherwise
--children <arg>
Whether the component is meant to have children or not. Defaults to `false`
--typescript, --ts <arg>
Option to generate Typescript components, defaults to `true` if the CLI manages to find a `tsconfig.json` file, false otherwise
--import-react <arg>
Option to import React at the top of the component. Defaults to `true` if the CLI manages to find a `tsconfig.json` file and it has a `jsx` field under `compilerOptions` with `react-jsx` or `react-jsxdev` as the value, `false` otherwise
--export-type <arg>
Whether to export the component as a named export or a default export. Defaults to `named`
--declaration <arg>
Whether to declare the component as a `const` with an arrow function, or as a `function` declaration. Defaults to `const`
--memo <arg>
Generates a component as a memo component. Defaults to `false`
--react-native <arg>
Generates a React Native component. Defaults to `true` if `react-native` is a dependency in the project's `package.json`, `false` otherwise
--styling <arg>
Which styling solution to generate. Defaults to `none`
--styling-module <arg>
Whether to generate a scoped `module` stylesheet. This option is only relevant for `css` or `scss` styling, and will be ignored for other values. Defaults to `true`
--base-dir [path...]
Path to a base directory which components should be generated inside of (directly or nested). Defaults to the current working directory
--dest, --destination [path...]
Required ✳
--allow-outside-base [path...]
Overrides default Agrippa behaviour to allow components to be specified outside `baseDir`. Defaults to current working directory
--flat <arg>
By default, Agrippa generates a dedicated directory for the generated component; this directory has the same name as the component, and will contain the component file (as `index.tsx` or `index.jsx`), and the style file (if one is generated). Defaults to `false`
--separate-index <arg>
In the `separateIndex` generation scheme, Agrippa creates one file for the component's code, and one `index` file, whose purpose is to allow importing exports from the component's directory elegantly (the import path can then be `<path>/<to>/<directory>/Component` instead of `<path>/<to>/<directory>/Component/Component`). Defaults to `true`
--post-command, --postCommand <arg>
Allows a custom command to be run after having generated a component. This allows for some cool functionality, such as opening an IDE at the newly generated files automatically or linting them. Defaults to `none`
--overwrite <arg>
By default, Agrippa prevents the generation of a component over an existing components, to prevent a loss of code. `--overwrite` tells Agrippa to replace existing files, if any are found. Defaults to `false`
--debug <arg>
The `debug` flag makes Agrippa print out additional debug information. It's quite useful when debugging. Defaults to `false`