@node-software-ts/server-cli
v1.1.2
Published
Deploy and manage Next.js, Nuxt.js, Laravel (Supervisor) and Socket apps on a Linux server.
Downloads
1,682
Maintainers
Readme
@mohamed-emad-software/server-cli
Deploy and manage Next.js (static export), Nuxt.js, Laravel (Supervisor), and Socket.io apps on a Linux server with PM2.
Install
npm i -g @mohamed-emad-software/server-cli
server --versionQuick start
# Next.js
server next /home/offroads/provider.offroadsapp.com 4989
server next 4989 # from inside the dir
server 4989 # type auto-detected
# Restart (no port check)
server restart /home/offroads/provider.offroadsapp.com
server restart # from inside the dir
server restart all
# Nuxt.js
server nuxt /home/wesellco/public_html 4988
# Laravel / Supervisor
server supervisor /home/aladarba/public_html
# Socket (v1.1)
server socket /home/foo/chat-app 4990Auto-detection
- Type:
nuxt→next→socket→supervisor(see sourcesrc/core/detect.ts). - User:
/home/<user>/..., else--user, else$USER. - Name:
package.json/composer.jsonname, else a stable fallback. - Domain (health check):
--domain, cPanel userdata, nginxserver_name, or directory basename if it looks like a domain.
Supported project types
| Type | Detection / notes | Runtime |
| ----------- | ------------------------------------------------------ | -------------- |
| next | next.config.* or .next/, static export out/ | PM2 + static server |
| nuxt | .output/server/index.mjs or nuxt.config.* | PM2 + Nitro |
| supervisor | artisan + composer.json | supervisord |
| socket | server/app.js + socket.io dependency (v1.1) | stub in v1.0 |
Config
Global defaults live in ~/.server-cli/config.json (create via server init).
Optional per-project overrides in ./server.yaml (name, type, port, env).
Precedence: defaults → global JSON → server.yaml → CLI flags.
Global flags
| Flag | Meaning |
| ---- | ------- |
| --dry-run | Log shell/file actions, execute nothing |
| --verbose / -v | Stream child output |
| --yes / -y | Non-interactive init |
| --user | Override detected Linux user |
| --name | Override app name |
| --domain | Override health-check domain |
| --no-healthcheck | Skip HTTP probe |
| --config | Alternate global config path |
Troubleshooting (exit codes)
| Code | Meaning | | ---- | ------- | | 10 | Bad arguments / merge conflicts | | 20 | Missing/empty directory | | 30 | Port in use | | 40 | Unknown project type / missing metadata | | 50 | Build failed | | 60 | PM2 / permission issues | | 70 | Supervisor failure | | 80 | Health check failed | | 90 | Lock held |
License
MIT
