Automate components management routine
Last updated a year ago by grabantot .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @grabantot/react-cli -g
SYNC missed versions from official npm registry.



npm i -g @grabantot/react-cli


animation gif

Usage: react-cli [options] [command] <path/Component>

Manage react components and related files

  -V, --version  output the version number
  -f, --func     create functional component or convert the existing class component to functional
  -c, --class    create class component or convert the existsing functional component to class
  -s, --style    create style module and add 'import styles' to the component
  -i, --index    add component export to index.js in its directory
  -h, --help     output usage information

  config <path>  set directory for templates and config file; will be filled with defaults if empty

Global config location: '/home/tot/.react-cli/config.json'.

  $ react-cli -fs src/components/views/Primitives/Button
  $ react-cli -csi src/components/views/User/UserCard
  $ react-cli config path/to/empty/dir/to/put/react-cli-config-and-templates

Config options (react-cli.config.json):

  "useSemicolons": false,
  "componentExtension": ".js",
  "styleModuleExtension": ".module.scss"


Per directory configs. Configurable names for templates.


  • mv - move/rename the component and related files, fix imports in the project


  -p, --prop-types  find props used in render and add propTypes for them
  -r, --redux       connect the component to the redux store
  -S, --story       create storybook story for the component
  -P, --pure        make the component pure (use recompose's pure for functional components)
  -t, --test        add tests for the component


  • Components are default exports in files
  • Functional components are defined as function ComponentName(props)
  • ...

No assumptions about the project structure.


It's 2019 and still there is no decent react cli. Yet all the appropriate names for such a package on npm are taken.

Let's fix this. Contributions of any kind are welcome: add features, add tests, refactor the code or simply share you thoughts in issues.

Related projects

Less related:

Current Tags

  • 1.2.1                                ...           latest (a year ago)

10 Versions

  • 1.2.1                                ...           a year ago
  • 1.2.0                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.6                                ...           a year ago
  • 1.0.5                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Today 0
This Week 0
This Month 10
Last Day 0
Last Week 10
Last Month 0
Dependencies (4)
Dev Dependencies (0)
Dependents (0)

Copyright 2014 - 2016 © taobao.org |