New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

smart-codegen-cli

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

smart-codegen-cli

AI-powered code generation CLI tool for React applications

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
0
Created
Source

Smart CodeGen 🚀

A robust, AI-powered CLI tool for efficient React development. Generate React components, custom hooks, and CRUD operations with TypeScript support and industry best practices baked in.

🌟 Features

  • 🤖 AI-Powered Code Generation: Write less, build more.
  • ⚛️ React Components: Generate functional or class-based components.
  • 🪝 Custom Hooks: Quickly scaffold reusable logic.
  • 📡 CRUD Operations: Automate RESTful API code generation.
  • 📘 TypeScript Support: Built-in type safety.
  • 🎨 CSS Modules Integration: Clean, modular styling out of the box.
  • 📝 Auto-Documentation: Document your code as you build.
  • Best Practices: Adheres to industry standards.

🚀 Installation

npm install -g smart-codegen
# or
yarn global add smart-codegen

Usage

Component Generation

# Interactive mode
	codegen component 
# Direct mode 
	codegen component --name Button --type functional
# Generated structure:
	src/
	  components/
	    Button/
	      Button.tsx
	      Button.module.css

Custom Hook Generation

# Interactive mode
	codegen hook 
# Direct mode 
	codegen hook --name WindowSize
# Generated structure:
	src/
	  hooks/
	    useWindow.ts

CRUD Generation

# Interactive mode
	codegen crud 
# Direct mode 
	codegen crud --model User
# Generated structure:
	src/
	  features/
		  user/
		    user.service.ts
		    useUser.ts

⚙️ Configuration

Add a .env file in your project root:

OPENAI_API_KEY=your_api_key_here

🛠️ Commands Reference

Component Options

OptionShortcutDescriptionDefault
--name-nComponent name(prompts)
--type-tComponent type (functional/class)functional

Hook Options

OptionShortcutDescriptionDefault
--name-nHook name (without 'use' prefix)(prompts)
--type-tHook typecustom

CRUD Options

OptionShortcutDescriptionDefault
--model-mModel/Entity name(prompts)
--operations-oCRUD operations to generateAll

🤝 Contributing

  • Fork the repository
  • Create your feature branch (git checkout -b feature/amazing-feature)
  • Commit your changes (git commit -m 'Add some amazing feature')
  • Push to the branch (git push origin feature/amazing-feature)
  • Open a Pull Request

📝 License

MIT License - see the LICENSE file for details

🙏 Acknowledgments

  • OpenAI for providing the AI capabilities
  • React community for inspiration and best practices
  • All contributors who help improve this tool

Generated with ❤️ by Smart CodeGen

Keywords

react

FAQs

Package last updated on 06 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts