UNPKG

create-nodex

Version:

CLI tool to create modern Node.js projects with TypeScript, AI capabilities, and more

164 lines (118 loc) โ€ข 3.75 kB
<div align="center"> <img src="https://ai-calls.vercel.app/banner.png" alt="create-nodex banner" width="500px"/> <br/><br/> </div> [![npm version](https://badge.fury.io/js/create-nodex.svg)](https://badge.fury.io/js/create-nodex) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com) ## โœจ Features - ๐ŸŽฏ **TypeScript/JavaScript Support** - Choose your preferred language - ๐Ÿ”„ **Hot Reload Development** - Instant feedback during development - ๐Ÿงช **Jest Testing Integration** - Ready-to-use testing setup - ๐Ÿ“ฆ **Modern ES Modules** - Latest JavaScript features - ๐Ÿ—๏ธ **Clean Project Structure** - Well-organized codebase - ๐Ÿค– **AI Capabilities** - Built-in support for Langchain and RAG systems - Multiple LLM providers (OpenAI, Anthropic, Groq, etc.) - Vector store integration (Pinecone, MongoDB, FAISS, etc.) - Embedding model support - RAG (Retrieval Augmented Generation) setup - ๐Ÿš€ **Express Integration** - Add Express with a single command ## ๐Ÿ“ฆ Installation Install globally: ```bash npm install -g create-nodex ``` Or use directly with npx: ```bash npx create-nodex ``` ## ๐Ÿš€ Usage ### Creating a New Project ```bash create-nodex [project-name] ``` #### Interactive Mode If `[project-name]` is omitted, you'll be guided through an interactive setup: - Project name - TypeScript or JavaScript - Hot reloading - Testing setup #### Quick Start With project name, creates a project with default settings: - TypeScript - Hot Reload - Testing ### Adding Features Navigate to your project directory: ```bash cd my-project ``` #### Add Express ```bash create-nodex add express ``` This will: - Add `express` dependency - Create a basic `src/server.ts` (or `src/server.js`) - Add development and production scripts - Install required dependencies #### Add AI Capabilities ```bash create-nodex add ai ``` This will: - Add Langchain integration - Set up your chosen LLM provider - Configure necessary dependencies - Create example files #### Add RAG System ```bash create-nodex add ai-rag ``` This will: - Set up a complete RAG system - Configure your chosen: - Chat model - Embedding model - Vector store - Create example implementation ## ๐Ÿ—๏ธ Project Structure ``` my-project/ โ”œโ”€โ”€ src/ โ”‚ โ”œโ”€โ”€ index.ts (or index.js) โ”‚ โ”œโ”€โ”€ server.ts (if Express added) โ”‚ โ””โ”€โ”€ ai/ โ”‚ โ”œโ”€โ”€ common/ โ”‚ โ”‚ โ””โ”€โ”€ ai-setup.ts โ”‚ โ”œโ”€โ”€ [model-provider]/ โ”‚ โ”‚ โ””โ”€โ”€ [model]-example.ts โ”‚ โ””โ”€โ”€ rag/ โ”‚ โ””โ”€โ”€ rag-example.ts โ”œโ”€โ”€ package.json โ”œโ”€โ”€ nodemon.json (if hot-reload enabled) โ”œโ”€โ”€ tsconfig.json (for TypeScript projects) โ”œโ”€โ”€ .gitignore โ””โ”€โ”€ README.md ``` ## ๐Ÿ”ง Development ```bash # Start development server npm run dev:server # Run tests npm test # Build for production npm run build ``` ## ๐Ÿค Contributing Contributions are welcome! Please feel free to submit a Pull Request. 1. Fork the repository 2. Create your feature branch (`git checkout -b feature/amazing-feature`) 3. Commit your changes (`git commit -m 'Add some amazing feature'`) 4. Push to the branch (`git push origin feature/amazing-feature`) 5. Open a Pull Request ## ๐Ÿ“ License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. ## Acknowledgments - [Langchain](https://js.langchain.com/) for AI capabilities - [Express](https://expressjs.com/) for api support - [TypeScript](https://www.typescriptlang.org/) for type safety - [Jest](https://jestjs.io/) for testing