
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
@diagramers/cli
Advanced tools
Diagramers CLI - Command-line tools for managing Diagramers projects
A powerful command-line interface for managing Diagramers projects, generating modules, and extending functionality with a comprehensive template system.
npm install -g @diagramers/cli
npm install @diagramers/cli
npx diagramers --help
# Install the CLI globally
npm install -g @diagramers/cli
# Create a new API project
diagramers init api my-new-api
# Navigate to the project
cd my-new-api
# Set up environment variables
cp .env.example .env
# Install dependencies
npm install
# Start development
npm start
diagramers init <template-type> <project-name> [options]
Options:
-v, --version <version>
- Specific version of the template to use (e.g., 1.1.17, latest)-t, --template <template>
- Template version to use (deprecated, use --version)-y, --yes
- Skip prompts and use defaultsExamples:
# Create API project with latest version
diagramers init api my-api-project
# Create API project with specific version
diagramers init api my-api-project -v 1.1.17
# Create admin project with specific version
diagramers admin init react-typescript my-admin-dashboard -v 1.0.0
Update an existing project with the latest template features:
diagramers update [options]
Options:
-v, --version <version>
- Specific version to update to (e.g., 1.1.27, latest)-f, --force
- Force update even if conflicts detected-b, --backup
- Create backup before updatingExamples:
# Update to latest version
diagramers update
# Update to specific version
diagramers update -v 1.1.27
# Force update (overwrite conflicts)
diagramers update --force
# Create backup before updating
diagramers update --backup
# Combine options
diagramers update -v 1.1.27 --backup --force
The update command intelligently updates the following:
src/core/
, src/shared/
, src/plugins/
config/
folder, webpack.config.js
, tsconfig.json
scripts/
folder with utility scriptsREADME.md
, DEVELOPER_GUIDE.md
.env.example
templateš Checking for template updates...
š¦ Current project version: 1.1.26
š Updating to latest version
š¦ Downloading latest template: @diagramers/api
ā
Template downloaded from npm: @diagramers/api
š Updating project files...
ā
Updated: src/core/config/index.ts
ā
Updated: scripts/env-debug.js
ā
Updated: package.json (version: 1.1.27)
ā
Project updated successfully!
š¦ Template version: 1.1.27
š Review the changes and test your application
š” Run "npm install" to update dependencies if needed
diagramers versions [options]
Options:
-a, --all
- Show all versions (default: show last 10)Examples:
# Show last 10 versions
diagramers versions
# Show all available versions
diagramers versions --all
diagramers extend --module <module-name> [options]
Examples:
# Generate basic module
diagramers extend --module products
# Generate module with CRUD operations
diagramers extend --module products --crud
# Generate module with custom fields
diagramers extend --module products --fields name,price,description --crud
diagramers extend --table <module:table> --fields <field1,field2,...>
Examples:
# Add categories table to products module
diagramers extend --table products:categories --fields name,description,slug
# Add products table to products module
diagramers extend --table products:products --fields name,price,category_id
# Add user profiles table to users module
diagramers extend --table users:profiles --fields bio,avatar,social_links
Field Types (Auto-detected):
name
, title
, description
ā Stringemail
, phone
ā Stringprice
, count
, age
ā Numbercreated_at
, updated_at
ā Dateis_active
, verified
ā Boolean*_id
ā ObjectIdstatus
ā Numberdiagramers extend --endpoint <module:endpoint> [options]
Examples:
# Add GET endpoint
diagramers extend --endpoint products:search --method GET
# Add POST endpoint
diagramers extend --endpoint users:reset-password --method POST
# Add endpoint with custom path
diagramers extend --endpoint products:featured --method GET --path /featured --description "Get featured products"
Supported Methods:
GET
- Retrieve dataPOST
- Create dataPUT
- Update dataDELETE
- Delete datadiagramers extend --relation <module:table1-table2[:type]>
Examples:
# One-to-many relation (default)
diagramers extend --relation products:category-product
# One-to-one relation
diagramers extend --relation users:user-profile:one-to-one
# Many-to-many relation
diagramers extend --relation products:product-tag:many-to-many
Relation Types:
one-to-one
- Single record relationsone-to-many
- Parent-child relations (default)many-to-many
- Junction table relationsdiagramers extend --list
diagramers extend --feature <feature-name>
The CLI provides comprehensive support for managing admin dashboard projects with modern frameworks and features.
diagramers admin init <template-type> <project-name> [options]
Template Types:
react-typescript
- React 18 + TypeScript + Tailwind CSSvue-typescript
- Vue 3 + TypeScript + Tailwind CSSangular
- Angular 17 + TypeScript + Tailwind CSSOptions:
-f, --framework <framework>
- Framework to use (react, vue, angular)-t, --template <template>
- Template package name-v, --version <version>
- Template version to use-y, --yes
- Skip prompts and use defaults--typescript
- Use TypeScript (default: true)--tailwind
- Use Tailwind CSS (default: true)--api-url <url>
- API URL for the backend--socket-url <url>
- Socket.IO URL for real-time featuresExamples:
# Create React admin project
diagramers admin init react-typescript my-admin-app
# Create Vue admin project with specific version
diagramers admin init vue-typescript my-vue-admin --version 1.0.0
# Create Angular admin project with custom API URL
diagramers admin init angular my-angular-admin --api-url http://localhost:3000
# Create with all options
diagramers admin init react-typescript my-admin-app \
--framework react \
--typescript \
--tailwind \
--api-url http://localhost:3000 \
--socket-url http://localhost:3000
diagramers admin extend [options]
Options:
-p, --page <name>
- Generate a new page-c, --component <name>
- Generate a new component-s, --service <name>
- Generate a new service-h, --hook <name>
- Generate a new custom hook-m, --module <name>
- Generate a complete module with CRUD--crud
- Include CRUD operations for module--api
- Include API integration for module--socket
- Include Socket.IO integration for module--table
- Include data table for module--form
- Include form components for module--chart
- Include chart components for module--auth
- Include authentication for module--path <path>
- Custom path for generated filesExamples:
# Generate a new module with CRUD operations
diagramers admin extend --module products --crud --api --table
# Generate a new page
diagramers admin extend --page analytics
# Generate a new component
diagramers admin extend --component ProductCard
# Generate a new service
diagramers admin extend --service orderService
# Generate a new custom hook
diagramers admin extend --hook useOrders
# Generate complete module with all features
diagramers admin extend --module orders --crud --api --socket --table --form --chart --auth
diagramers admin update [options]
Options:
-t, --template <template>
- Template to update-v, --version <version>
- Version to update to--force
- Force update even if conflicts exist--backup
- Create backup before updatingExamples:
# Update to latest version
diagramers admin update
# Update to specific version
diagramers admin update --version 1.0.0
# Force update with backup
diagramers admin update --force --backup
diagramers admin version [options]
Options:
-c, --check <version>
- Check if specific version existsExamples:
# Show current version info
diagramers admin version
# Check specific version
diagramers admin version --check 1.0.0
diagramers admin versions [options]
Options:
-a, --all
- Show all versions (default: show last 10)Examples:
# Show last 10 versions
diagramers admin versions
# Show all available versions
diagramers admin versions --all
my-admin-app/
āāā src/
ā āāā components/ # Reusable UI components
ā ā āāā ui/ # Base UI components
ā ā āāā layout/ # Layout components
ā āāā features/ # Feature modules
ā ā āāā auth/ # Authentication
ā ā āāā dashboard/ # Dashboard
ā ā āāā users/ # User management
ā ā āāā [modules]/ # Generated modules
ā āāā hooks/ # Custom React hooks
ā āāā services/ # API services
ā āāā lib/ # Utilities and configurations
ā āāā types/ # TypeScript type definitions
ā āāā styles/ # Global styles
ā āāā assets/ # Static assets
āāā public/ # Public assets
āāā package.json # Dependencies and scripts
āāā tsconfig.json # TypeScript configuration
āāā tailwind.config.js # Tailwind CSS configuration
āāā vite.config.ts # Vite configuration
āāā .env # Environment variables
diagramers extend --module email --crud
diagramers extend --table email:configs --fields provider,code,credentials,fromName,fromEmail,default
diagramers extend --table email:templates --fields name,subject,body,isActive,createdAt
diagramers extend --table email:logs --fields to,subject,status,provider,error,createdAt
# One-to-many: User to Email Configs
diagramers extend --relation email:user-config:one-to-many
# One-to-many: Email Config to Email Logs
diagramers extend --relation email:config-log:one-to-many
# Send email endpoint
diagramers extend --endpoint email:send --method POST --description "Send email using configured provider"
# Test email endpoint
diagramers extend --endpoint email:test --method POST --description "Test email configuration"
# Get email statistics
diagramers extend --endpoint email:stats --method GET --description "Get email sending statistics"
# Add Gmail SMTP configuration
diagramers extend --endpoint email:setup-gmail --method POST --description "Setup Gmail SMTP configuration"
# Add SendGrid configuration
diagramers extend --endpoint email:setup-sendgrid --method POST --description "Setup SendGrid configuration"
# Add AWS SES configuration
diagramers extend --endpoint email:setup-ses --method POST --description "Setup AWS SES configuration"
diagramers extend --module users --crud
diagramers extend --table users:profiles --fields bio,avatar,socialLinks,location,website,birthDate,preferences
diagramers extend --table users:sessions --fields userId,deviceInfo,ipAddress,userAgent,isActive,lastActivity
diagramers extend --table users:activities --fields userId,action,details,ipAddress,userAgent,timestamp
# One-to-one: User to Profile
diagramers extend --relation users:user-profile:one-to-one
# One-to-many: User to Sessions
diagramers extend --relation users:user-session:one-to-many
# One-to-many: User to Activities
diagramers extend --relation users:user-activity:one-to-many
# User profile management
diagramers extend --endpoint users:profile --method GET --description "Get user profile"
diagramers extend --endpoint users:update-profile --method PUT --description "Update user profile"
diagramers extend --endpoint users:upload-avatar --method POST --description "Upload user avatar"
# User administration
diagramers extend --endpoint users:list --method GET --description "List all users (admin)"
diagramers extend --endpoint users:create --method POST --description "Create user (admin)"
diagramers extend --endpoint users:update --method PUT --description "Update user (admin)"
diagramers extend --endpoint users:delete --method DELETE --description "Delete user (admin)"
# User statistics
diagramers extend --endpoint users:stats --method GET --description "Get user statistics"
diagramers extend --endpoint users:activity --method GET --description "Get user activity"
# 1. Create new API project
diagramers init api ecommerce-api
cd ecommerce-api
# 2. Generate products module
diagramers extend --module products --crud
# 3. Add categories table
diagramers extend --table products:categories --fields name,description,slug
# 4. Add products table
diagramers extend --table products:products --fields name,price,description,category_id
# 5. Create category-product relation
diagramers extend --relation products:category-product:one-to-many
# 6. Add custom search endpoint
diagramers extend --endpoint products:search --method GET --description "Search products"
# 7. Install dependencies and start
npm install
npm start
# 1. Generate users module (if not exists)
diagramers extend --module users --crud
# 2. Add user profiles table
diagramers extend --table users:profiles --fields bio,avatar,social_links,birth_date
# 3. Create user-profile relation
diagramers extend --relation users:user-profile:one-to-one
# 4. Add profile endpoints
diagramers extend --endpoint users:update-profile --method PUT
diagramers extend --endpoint users:get-profile --method GET
# 1. Generate email module with CRUD operations
diagramers extend --module email --crud
# 2. Add email configurations table
diagramers extend --table email:configs --fields provider,code,credentials,fromName,fromEmail,default
# 3. Add email templates table
diagramers extend --table email:templates --fields name,subject,body,isActive,createdAt
# 4. Add email logs table for tracking
diagramers extend --table email:logs --fields to,subject,status,provider,error,createdAt
# 5. Create relationships
diagramers extend --relation email:user-config:one-to-many
diagramers extend --relation email:config-log:one-to-many
# 6. Add email-specific endpoints
diagramers extend --endpoint email:send --method POST --description "Send email using configured provider"
diagramers extend --endpoint email:test --method POST --description "Test email configuration"
diagramers extend --endpoint email:stats --method GET --description "Get email sending statistics"
# 7. Add provider setup endpoints
diagramers extend --endpoint email:setup-gmail --method POST --description "Setup Gmail SMTP configuration"
diagramers extend --endpoint email:setup-sendgrid --method POST --description "Setup SendGrid configuration"
# 8. Install dependencies and start
npm install
npm start
# 1. Generate users module with CRUD operations
diagramers extend --module users --crud
# 2. Add user profiles table
diagramers extend --table users:profiles --fields bio,avatar,socialLinks,location,website,birthDate,preferences
# 3. Add user sessions table for tracking
diagramers extend --table users:sessions --fields userId,deviceInfo,ipAddress,userAgent,isActive,lastActivity
# 4. Add user activity table for audit
diagramers extend --table users:activities --fields userId,action,details,ipAddress,userAgent,timestamp
# 5. Create user relationships
diagramers extend --relation users:user-profile:one-to-one
diagramers extend --relation users:user-session:one-to-many
diagramers extend --relation users:user-activity:one-to-many
# 6. Add user profile endpoints
diagramers extend --endpoint users:profile --method GET --description "Get user profile"
diagramers extend --endpoint users:update-profile --method PUT --description "Update user profile"
diagramers extend --endpoint users:upload-avatar --method POST --description "Upload user avatar"
# 7. Add user administration endpoints
diagramers extend --endpoint users:list --method GET --description "List all users (admin)"
diagramers extend --endpoint users:create --method POST --description "Create user (admin)"
diagramers extend --endpoint users:update --method PUT --description "Update user (admin)"
diagramers extend --endpoint users:delete --method DELETE --description "Delete user (admin)"
# 8. Add user analytics endpoints
diagramers extend --endpoint users:stats --method GET --description "Get user statistics"
diagramers extend --endpoint users:activity --method GET --description "Get user activity"
# 9. Install dependencies and start
npm install
npm start
All generated tables automatically include:
# Run database seeding
npm run seed
# Reset and reseed database
npm run seed --reset
# Update project with latest template
diagramers update
# Force update with backup
diagramers update --force --backup
The CLI automatically detects field types based on naming conventions:
# These fields will be auto-typed:
diagramers extend --table products:products --fields \
name,description,price,stock_count,created_at,is_active,category_id
Auto-detection:
name
, title
, description
ā Stringprice
, count
, stock_count
ā Numbercreated_at
, updated_at
ā Dateis_active
, verified
ā Booleancategory_id
, user_id
ā ObjectIdGenerated projects follow this structure:
my-project/
āāā src/
ā āāā modules/
ā ā āāā products/
ā ā ā āāā controllers/
ā ā ā āāā entities/
ā ā ā āāā schemas/
ā ā ā āāā services/
ā ā ā āāā routes/
ā ā āāā users/
ā āāā core/
ā ā āāā database/
ā ā āāā config/
ā ā āāā server/
ā āāā shared/
āāā scripts/
āāā package.json
ā Module 'inventory' does not exist
Solution: Create the module first:
diagramers extend --module inventory
ā Table 'products' already exists in module 'products'
Solution: Use a different table name or check existing tables
ā Table 'categories' does not exist in module 'products'
Solution: Create both tables before creating relations:
diagramers extend --table products:categories --fields name,description
diagramers extend --table products:products --fields name,price
diagramers extend --relation products:category-product
# General help
diagramers --help
# Command-specific help
diagramers init --help
diagramers extend --help
diagramers update --help
We welcome contributions! Please see our Contributing Guide for details.
MIT License - see LICENSE file for details.
FAQs
Diagramers CLI - Command-line tools for managing Diagramers projects
We found that @diagramers/cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Ā It has 1 open source maintainer 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.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.