
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@paljs/cli
Advanced tools
Pal cli will be your friend in developing nodejs full-stack projects to auto generate everything for you
A powerful command-line interface for generating full-stack applications with Prisma, GraphQL, and modern frontend frameworks. The PalJS CLI automates the creation of CRUD operations, admin interfaces, and GraphQL schemas.
npm install -g @paljs/cli
# or
yarn global add @paljs/cli
# or
pnpm add -g @paljs/cli
# Create a new project
pal create my-app
# Generate CRUD operations
pal generate
# Convert Prisma schema
pal schema json
pal create <name>
Create a new full-stack application with Prisma and GraphQL.
pal create my-awesome-app
Options:
--example <type>
- Choose project template (default: full-stack-nextjs
)--framework <framework>
- UI framework selection--multi
- Enable multi-schema support--git
- Initialize git repository--manager <manager>
- Package manager (npm, yarn, pnpm)--skip-install
- Skip dependency installationAvailable Examples:
full-stack-nextjs
- Complete Next.js application with Prismaapollo-nexus-schema
- Apollo Server with Nexus schema-first approachapollo-sdl-first
- Apollo Server with SDL-first approachgraphql-modules
- GraphQL Modules architectureAvailable Frameworks:
Example:
pal create my-app --example full-stack-nextjs --framework "Tailwind CSS + PrismaAdmin UI" --git
pal generate [models] [type]
Generate CRUD operations, admin pages, and GraphQL queries/mutations.
# Generate everything for all models
pal generate
# Generate for specific models
pal generate User,Post
# Generate specific types
pal generate User queries,mutations
# Generate admin pages only
pal generate User admin
Arguments:
models
- Comma-separated list of model names (optional)type
- Type of files to generate: crud
, queries
, mutations
, admin
, graphql
Options:
-c, --config <file>
- Custom config file name (default: pal.config
)-s, --schema <name>
- Schema name from config file-m, --multi
- Work with multi-schema configuration-a, --autoComplete <path>
- Generate CLI auto-completion for oh-my-zshExamples:
# Generate CRUD for User and Post models
pal generate User,Post crud
# Generate admin interface for all models
pal generate admin
# Use custom config file
pal generate --config my-pal.config
# Multi-schema mode
pal generate --multi --schema userSchema
pal schema <converter>
Convert and manipulate Prisma schema files.
# Convert schema to JSON
pal schema json
# Convert to TypeScript types
pal schema typescript
# Convert snake_case to camelCase
pal schema camel-case
Arguments:
converter
- Conversion type: json
, typescript
, camel-case
Options:
-o, --output-path <path>
- Output folder path (default: src/
)-t, --type <type>
- Output file type for JSON conversion: js
, ts
, json
(default: ts
)-s, --schema <path>
- Custom schema file pathExamples:
# Convert to TypeScript with custom output
pal schema typescript --output-path ./types
# Convert to JSON as JavaScript file
pal schema json --type js --output-path ./generated
# Convert specific schema file
pal schema json --schema ./custom/schema.prisma
# 1. Create new project
pal create my-blog --framework "Tailwind CSS + PrismaAdmin UI"
# 2. Navigate to project
cd my-blog
# 3. Update your Prisma schema
# Edit prisma/schema.prisma
# 4. Generate database migration
npx prisma migrate dev
# 5. Generate GraphQL CRUD operations
pal generate
# 6. Generate admin interface
pal generate admin
# 7. Start development server
npm run dev
# Generate only for User model
pal generate User
# Generate queries only for Post model
pal generate Post queries
# Generate admin interface for specific models
pal generate User,Post,Category admin
# Convert schema to TypeScript types
pal schema typescript --output-path ./src/types
# Convert to JSON for external tools
pal schema json --type json --output-path ./tools
# Convert snake_case to camelCase
pal schema camel-case
{
"scripts": {
"generate": "pal generate",
"generate:admin": "pal generate admin",
"schema:types": "pal schema typescript",
"db:generate": "prisma generate && pal generate"
}
}
# .github/workflows/generate.yml
name: Generate Code
on:
push:
paths:
- 'prisma/schema.prisma'
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: npm install
- run: pal generate
- run: git add .
- run: git commit -m "Auto-generate code" || exit 0
- run: git push
Schema file not found
# Specify custom schema path
pal generate --schema ./custom/path/schema.prisma
Config file not found
# Use custom config file
pal generate --config custom.config.js
Permission errors
# Install globally with proper permissions
sudo npm install -g @paljs/cli
Enable debug output:
DEBUG=paljs* pal generate
Generates Nexus GraphQL schema with type-safe resolvers.
{
backend: {
generator: 'nexus',
output: './src/graphql',
}
}
Generated Files:
types.ts
- Nexus type definitionsqueries.ts
- Query resolversmutations.ts
- Mutation resolversindex.ts
- Combined exportsGenerates Schema Definition Language files with resolvers.
{
backend: {
generator: 'sdl',
output: './src/graphql',
}
}
Generated Files:
typeDefs.ts
- GraphQL type definitionsresolvers.ts
- Resolver functionsindex.ts
- Combined exportsGenerates modular GraphQL architecture using GraphQL Modules.
{
backend: {
generator: 'graphql-modules',
output: './src/graphql',
}
}
Generated Files:
modules/
- Individual model modulesinputs/
- Input type definitionsapp.ts
- Application moduleEnable CLI auto-completion for oh-my-zsh:
pal generate --autoComplete ~/.oh-my-zsh/custom/plugins/
Then add paljs
to your plugins in ~/.zshrc
:
plugins=(... paljs)
pal.config.js
)module.exports = {
schema: './prisma/schema.prisma',
backend: {
generator: 'nexus', // 'nexus' | 'sdl' | 'graphql-modules'
output: './src/graphql',
excludeFields: ['password', 'hash'],
excludeModels: [{ name: 'Log', queries: true, mutations: false }],
},
frontend: {
admin: {
models: ['User', 'Post', 'Category'],
output: './src/admin',
},
graphql: {
output: './src/graphql/generated',
},
},
};
module.exports = {
multiSchema: true,
schemas: {
user: {
schema: './prisma/user.prisma',
backend: {
generator: 'nexus',
output: './src/graphql/user',
},
},
blog: {
schema: './prisma/blog.prisma',
backend: {
generator: 'sdl',
output: './src/graphql/blog',
},
},
},
};
module.exports = {
schema: './prisma/schema.prisma',
backend: {
generator: 'nexus',
output: './src/graphql',
// Exclude specific fields globally
excludeFields: ['password', 'hash', 'salt'],
// Exclude specific models or operations
excludeModels: [
{ name: 'InternalLog', queries: true, mutations: true },
{ name: 'Session', mutations: true },
],
// Exclude fields per model
excludeFieldsByModel: {
User: ['password', 'hash'],
Post: ['internalNotes'],
},
// Exclude specific queries/mutations
excludeQueriesAndMutations: ['deleteMany', 'updateMany'],
// Exclude queries/mutations per model
excludeQueriesAndMutationsByModel: {
User: ['deleteMany'],
Post: ['updateMany'],
},
// Disable all queries or mutations
disableQueries: false,
disableMutations: false,
// Custom Prisma client name
prismaName: 'prisma',
// JavaScript output instead of TypeScript
javaScript: false,
},
frontend: {
admin: {
models: ['User', 'Post', 'Category'],
output: './src/admin/pages',
pageContent: 'custom-template.tsx',
},
graphql: {
output: './src/graphql/generated',
models: ['User', 'Post'],
},
},
};
MIT License - see the LICENSE file for details.
FAQs
Pal cli will be your friend in developing nodejs full-stack projects to auto generate everything for you
The npm package @paljs/cli receives a total of 2,811 weekly downloads. As such, @paljs/cli popularity was classified as popular.
We found that @paljs/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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.