
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
rtg-template
Advanced tools
A powerful CLI tool for quickly scaffolding full-stack project templates with your preferred tech stacks.
# Use via npx (recommended)
npx rtg-template
# Or install globally
npm install -g rtg-template
# Interactive mode - choose your stack step by step
npx rtg-template
# Direct template usage
npx rtg-template react my-react-app --typescript --tailwind
npx rtg-template next my-next-app --auth
npx rtg-template node-api my-api --mongodb
Template | Description | Frameworks | Add-ons |
---|---|---|---|
react | React with Vite | React, Vite | TypeScript, Tailwind CSS, Redux Toolkit |
react-tailwind | React with Tailwind CSS | React, Vite, Tailwind CSS | TypeScript, Redux Toolkit |
react-tailwind-ts | React with Tailwind + TypeScript | React, Vite, Tailwind CSS, TypeScript | Redux Toolkit |
react-material-ui | React with Material-UI | React, Vite, Material-UI | TypeScript, Redux Toolkit |
react-styled-components | React with Styled Components | React, Vite, Styled Components | TypeScript, Redux Toolkit |
react-ts | React with TypeScript | React, Vite, TypeScript | Tailwind CSS, Redux Toolkit |
next | Next.js application | Next.js, React | TypeScript, Tailwind CSS, Auth |
node-api | Express.js API | Node.js, Express | TypeScript, MongoDB, MySQL, PostgreSQL, Auth |
nestjs | NestJS application | NestJS, TypeScript | Prisma, PostgreSQL, MySQL, Auth |
fastapi | FastAPI Python app | FastAPI, Python | MySQL, PostgreSQL, Auth |
npx rtg-template
# Follow the prompts to select your template and options
# React app with TypeScript and Tailwind
npx rtg-template react my-app --typescript --tailwind
# React with Tailwind CSS (pre-built template)
npx rtg-template react-tailwind my-app
# React with Material-UI
npx rtg-template react-material-ui my-app
# React with Styled Components
npx rtg-template react-styled-components my-app
# React with TypeScript (pre-built template)
npx rtg-template react-ts my-app
# React with Tailwind + TypeScript (pre-built template)
npx rtg-template react-tailwind-ts my-app
# Next.js app with authentication
npx rtg-template next my-next-app --auth --typescript
# Node.js app with MongoDB
npx rtg-template node-api my-api --mongodb --typescript
# NestJS with Prisma and PostgreSQL
npx rtg-template nestjs my-nest-app --prisma --postgres
# Use a custom template repository
npx rtg-template react my-app --repo username/my-custom-template
Option | Description | Example |
---|---|---|
-t, --typescript | Add TypeScript support | --typescript |
--tailwind | Add Tailwind CSS | --tailwind |
--auth | Add authentication setup | --auth |
--prisma | Add Prisma ORM | --prisma |
--mongodb | Add MongoDB support | --mongodb |
--mysql | Add MySQL support | --mysql |
--postgres | Add PostgreSQL support | --postgres |
-i, --interactive | Run in interactive mode | --interactive |
-d, --directory <dir> | Output directory | --directory ./projects |
--repo <repository> | Custom template repository | --repo org/template |
--no-install | Skip dependency installation | --no-install |
--no-git | Skip git initialization | --no-git |
npx rtg-template <template> <project-name> [options]
Command | Description | Example |
---|---|---|
rtg-template --help | Show help information | npx rtg-template --help |
rtg-template --version | Show version | npx rtg-template --version |
rtg-template list | List all available templates | npx rtg-template list |
rtg-template ls | Alias for list command | npx rtg-template ls |
rtg-template interactive | Run in interactive mode | npx rtg-template interactive |
rtg-template i | Alias for interactive mode | npx rtg-template i |
# Basic React with Vite
npx rtg-template react my-app
# React with TypeScript
npx rtg-template react my-app --typescript
# React with Tailwind CSS
npx rtg-template react my-app --tailwind
# React with Redux Toolkit
npx rtg-template react my-app --redux-toolkit
# React with multiple options
npx rtg-template react my-app --typescript --tailwind --redux-toolkit
# Pre-built React templates
npx rtg-template react-tailwind my-app
npx rtg-template react-material-ui my-app
npx rtg-template react-styled-components my-app
npx rtg-template react-ts my-app
npx rtg-template react-tailwind-ts my-app
# Next.js
npx rtg-template next my-next-app
npx rtg-template next my-next-app --auth --typescript
# Node.js API
npx rtg-template node-api my-api
npx rtg-template node-api my-api --mongodb --typescript
npx rtg-template node-api my-api --postgres --auth
# NestJS
npx rtg-template nestjs my-nest-app
npx rtg-template nestjs my-nest-app --prisma --postgres
# FastAPI
npx rtg-template fastapi my-api
npx rtg-template fastapi my-api --mysql
# Custom output directory
npx rtg-template react my-app --directory /path/to/projects
# Skip dependency installation
npx rtg-template react my-app --no-install
# Skip git initialization
npx rtg-template react my-app --no-git
# Use custom template repository
npx rtg-template react my-app --repo username/my-custom-template
# Interactive mode
npx rtg-template --interactive
# Ensure you're logged in to npm
npm login
# Check your package.json
cat package.json
# Build the project
npm run build
# Test the build locally
node dist/cli.js --help
# Update version (patch, minor, or major)
npm version patch # 1.0.0 -> 1.0.1
npm version minor # 1.0.1 -> 1.1.0
npm version major # 1.1.0 -> 2.0.0
# Or manually update in package.json
# "version": "1.0.0"
# Publish to npm
npm publish
# For scoped packages (if using @your-org/rtg-template)
npm publish --access public
# Check if package is published
npm view rtg-template
# Test the published package
npx rtg-template --version
npm run build
)package.json
# Tag the release in git
git tag v1.0.0
git push origin v1.0.0
# Create a GitHub release (optional)
# Go to GitHub and create a new release with the tag
# 1. Build your project
npm run build
# 2. Create a global symlink
npm link
# 3. Test the command globally
rtg-template --help
rtg-template list
rtg-template react-tailwind my-test-app
# 4. When done testing, unlink
npm unlink
# Test directly with node
node dist/cli.js --help
node dist/cli.js list
node dist/cli.js react-tailwind my-test-app
# Test with npx pointing to your local directory
npx . react-tailwind my-test-app
npx . list
npx . --help
# Run directly from TypeScript source (for development)
npm run dev react-tailwind my-test-app
npm run dev list
npm run dev --help
# Install your package globally for testing
npm install -g .
# Test globally
rtg-template --help
rtg-template list
rtg-template react-tailwind my-test-app
# Uninstall when done
npm uninstall -g rtg-template
# 1. Set up the link once
npm link
# 2. During development, just rebuild and test
npm run build
rtg-template list
# 3. Test different templates
rtg-template react-tailwind test-app1
rtg-template react-material-ui test-app2
rtg-template react-styled-components test-app3
# 4. Clean up test projects
rm -rf test-app1 test-app2 test-app3
# 5. When done developing, unlink
npm unlink
rtg-template --help
rtg-template --version
rtg-template list
rtg-template react-tailwind my-app
rtg-template react-material-ui my-app
rtg-template react-styled-components my-app
rtg-template react-tailwind-ts my-app
rtg-template react my-app --typescript
rtg-template react my-app --tailwind
rtg-template react my-app --redux-toolkit
rtg-template react my-app --typescript --tailwind --redux-toolkit
rtg-template --interactive
npm run dev
)rtg-template <template> <project-name> [options]
rtg-template list
# or
rtg-template ls
rtg-template interactive
# or
rtg-template i
Templates can include the following features:
Templates support variable replacement:
{{PROJECT_NAME}}
- Project name in uppercase{{project-name}}
- Project name in lowercase{{Project Name}}
- Project name in title caseTemplates can include a post-install configuration in the registry:
{
postInstall: {
dependencies: ['react', 'react-dom'],
devDependencies: ['@vitejs/plugin-react', 'vite'],
envTemplate: 'PORT=3000\nNODE_ENV=development\n',
scripts: ['npm run build'],
instructions: 'Run `npm run dev` to start development server.'
}
}
# Clone the repository
git clone https://github.com/your-org/rtg-template.git
cd rtg-template
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode
npm run dev <template> <project-name>
src/
โโโ cli.ts # Main CLI entry point
โโโ commands/ # CLI commands
โ โโโ create.ts # Project creation logic
โ โโโ list.ts # Template listing
โ โโโ interactive.ts # Interactive mode
โโโ core/ # Core functionality
โ โโโ template-engine.ts # Template processing
โ โโโ registry.ts # Template registry
โ โโโ post-install.ts # Post-install hooks
โโโ utils/ # Utility functions
โ โโโ validation.ts # Input validation
โโโ types.ts # TypeScript types
src/core/registry.ts
with your template configurationtemplates/
directory or use an external repositoryExample template configuration:
'my-template': {
name: 'my-template',
description: 'My awesome template',
repository: 'github-user/my-template-repo',
frameworks: ['React', 'Express'],
addons: ['typescript', 'tailwind'],
postInstall: {
dependencies: ['express'],
instructions: 'Run `npm start` to begin!'
}
}
git checkout -b feature/amazing-feature
git commit -m 'Add amazing feature'
git push origin feature/amazing-feature
You can use custom templates from any Git repository:
# GitHub shorthand
npx rtg-template react my-app --repo username/my-react-template
# Full Git URL
npx rtg-template react my-app --repo https://github.com/username/my-react-template
your-template-repo/
โโโ package.json
โโโ src/
โ โโโ index.js
โโโ .env.example
โโโ .get-template.js # Optional custom post-install script
Template not found
npx rtg-template list
Permission errors
sudo
on Unix systemsGit errors
Dependency installation fails
--no-install
flag and install manuallyMIT ยฉ [Your Name]
Made with โค๏ธ by the RTG Template team
FAQs
A CLI tool for quickly scaffolding full-stack project templates
The npm package rtg-template receives a total of 14 weekly downloads. As such, rtg-template popularity was classified as not popular.
We found that rtg-template demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.ย It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socketโs new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.