Netpress Laravel-inspired backend framework for Node.js
Frameworkv0.1.14 Starterv0.1.12 Docsv1.0.3
Overview Installation Architecture CLI
Features

Artisan CLI

The starter exposes artisan.js, which forwards into runCli() from @admicaa/netpress. The implemented CLI now covers scaffolding, shared migrations, seeding, rendering setup, auth page scaffolding, queues, route inspection, cache utilities, key generation, and user-defined commands.

Quick Example

// artisan.js
import "dotenv/config";
import { runCli } from "@admicaa/netpress";

await runCli({ name: "artisan", version: "1.0.0" });

Run commands with:

npm run artisan -- <command> [options]

Code Generation

npm run artisan -- make:controller PostController
npm run artisan -- make:controller PostController --resource
npm run artisan -- make:model Post
npm run artisan -- make:migration create_posts_table
npm run artisan -- make:seeder DatabaseSeeder
npm run artisan -- make:seeder PostSeeder
npm run artisan -- make:job ProcessPaymentJob --queue=payments
npm run artisan -- make:mail WelcomeMail
npm run artisan -- make:middleware AuditRequest
npm run artisan -- make:request StorePostRequest
npm run artisan -- make:provider PaymentServiceProvider
npm run artisan -- make:policy PostPolicy --model=Post
npm run artisan -- make:observer PostObserver --model=Post
npm run artisan -- make:command ReportsCommand --signature=\"reports:send {user} {--queue=default}\"

Important scaffolding changes:

  • make:model now writes shared models into app/Models/
  • make:model pins static connection to the current default configured connection
  • make:migration now writes shared migrations into database/migrations/
  • make:migration uses the shared migration builder, the current default configured connection, and scaffolds table.primaryKey("id") for cross-driver primary keys
  • make:seeder now writes shared seeders into database/seeders/
  • make:mail follows the configured mail engine and writes .jsx or .vue templates accordingly

Database Commands

npm run artisan -- migrate
npm run artisan -- migrate --seed
npm run artisan -- migrate:rollback --step=1
npm run artisan -- migrate:fresh --seed
npm run artisan -- migrate:refresh --seed
npm run artisan -- migrate:status
npm run artisan -- db:seed
npm run artisan -- db:seed --seeder=UserSeeder

These commands use the configured connection list and migration plan. The older docs that relied on runtime --connection flags no longer match the implementation.

Rendering Setup

npm run artisan -- setup:rendering
npm run artisan -- setup:rendering --web react --mail react
npm run artisan -- setup:rendering --web none --mail vue --skip-install

This command:

  • installs only missing renderer packages
  • writes config/view.js
  • updates config/mail.js
  • writes starter web and mail files

setup:rendering also keeps the starter auth views aligned with the chosen web engine unless web rendering is disabled.

Auth Page Scaffolding

npm run artisan -- setup:auth
npm run artisan -- setup:auth --web react --ui tailwind
npm run artisan -- setup:auth --web vue --ui bootstrap

This command publishes the starter auth pages for the selected renderer and UI stack:

  • resources/views/layouts/AuthLayout.*
  • resources/views/pages/auth/*

Use it when you want to republish or restyle the default web guard pages without replacing the auth services or controllers.

CLI output now goes through the shared log helper, so command status, warnings, success messages, and scaffold writes use the same colored formatter as the runtime.

Queue And Utility Commands

npm run artisan -- queue:work
npm run artisan -- queue:work --queue=emails --tries=5

npm run artisan -- route:list
npm run artisan -- cache:clear
npm run artisan -- key:generate
npm run artisan -- key:generate --show
npm run artisan -- key:generate --env=.env.testing
npm run artisan -- storage:link

cache:clear flushes the configured shared cache store through the same cache facade your app code uses. storage:link links public/storage to storage/app for the local storage disk.

Migrations, seeders, queue workers, and other built-in commands also use the same core logger, so command-line output stays consistent across the framework.

User-Defined Commands

The CLI also auto-discovers commands from app/Console/Commands/.

Each command class needs a static signature, and Netpress parses that signature into a Commander command at boot time.