@tridaksh/static-cli
v1.0.0
Published
Fast ⚡ local static file server with advanced controls, GUI, permissions, gzip support, and SPA routing.
Maintainers
Readme
Static CLI
Fast ⚡ local static file server with advanced controls, GUI, permissions, gzip support, and SPA routing.
✨ Features
- ⚡ fast static server
- 🧭 SPA fallback support
- 🗜️ Gzip compression
- 🖥️ Optionally install, Built-in Web GUI dashboard
- 📁 Include / exclude via glob patterns
- 🔐 File operation permissions
- 🌐 Open browser automatically
- 📊 Server status & process control
📦 Installation
Global (recommended)
npm install -g static-cliRun without installing
npx static-cli start🚀 Quick Start
Start server in current directory:
static startStart on specific port:
static start -p 8080🧭 Commands
| Command | Description |
| --------- | ------------------ |
| start | Start local server |
| stop | Stop local server |
| restart | Restart server |
| status | Show server status |
⚙️ Flags
| Flag | Description |
| --------------------- | ---------------------------- |
| -h, --help | Show help |
| -v, --version | Show CLI version |
| -p, --port <number> | Use custom port |
| --spa | Serve HTML instead of 404 |
| --gzip | Enable gzip compression |
| --gui | Open web GUI dashboard |
| --open, --browse | Open URL in browser |
| --includes <glob> | Include files/folders (glob) |
| --excludes <glob> | Exclude files/folders (glob) |
| --allowed-create | Allow file creation |
| --allowed-rename | Allow file renaming |
| --allowed-delete | Allow file deletion |
| --allowed-update | Allow file updates |
🖥️ Web GUI
Launch dashboard:
static start --guiOpen:
http://localhost:3000/__dashboard📁 Include / Exclude Patterns
Multiple glob patterns can be provided using ; as separator.
⚠️ Must be wrapped in quotes.
Examples
static start --includes "src/**/*.js;assets/**/*.css"static start --excludes "node_modules/**;dist/**"🌐 SPA Mode.
Instead of returning 404, server returns your HTML entry file.
static start --spa🗜️ Gzip Compression
Enable fast transfer:
static start --gzip🔐 File Permissions
Allow specific file operations in GUI:
static start --allowed-create --allowed-deleteAvailable permissions:
- create
- rename
- delete
- update
🌍 Open Browser Automatically
static start --open📊 Server Status
static status🔁 Restart Server
static restart🧪 Advanced Examples
Start SPA server with gzip on port 5000:
static start -p 5000 --spa --gzipStart server with GUI and open browser:
static start --gui --openServe only selected files:
static start --includes "public/**"Exclude build folders:
static start --excludes "dist/**;node_modules/**"🧰 Requirements
- Node.js ≥ 18 recommended
📄 License
MIT
