CLI Reference
The vesta command-line tool manages your project lifecycle —
from scaffolding a new app to deploying with Nginx and systemd.
Project setup
Runs a wizard that asks which server type and features you want, then generates
server.py, server.ini, requirements.txt
and the appropriate directory structure.
cd myproject
vesta init
The wizard prompts for:
| Question | Options |
|---|---|
| Server type | http (BaseServer) or vesta (full-stack Server) |
| ORM | Include PostgreSQL query builder? |
| WebSockets | Include real-time WebSocket support? |
| JS Framework | Copy frontend JS modules to static/framework/? |
| Markdown | Copy the markdown parser? |
| Cron | Create cron task stubs? |
Answers are saved to vesta.manifest so other commands know
what features are active.
Reads vesta.manifest and installs the required packages via pip.
Equivalent to pip install -r requirements.txt but generates
requirements.txt first based on your selected features.
vesta install
vesta update
Database
Connects to the local Postgres instance as a superuser and creates the
database user and database declared in server.ini [DB].
vesta db create
Executes db/schema.sql against the database configured in
server.ini. Run this after vesta db create
or any time you update the schema.
vesta db init
Drops the database completely and runs vesta db create
followed by vesta db init. Destroys all data.
vesta db reset
Nginx
Vesta ships nginx configuration templates for both local development and
production (with SSL termination). The templates live in misc/
and reference your server.ini port settings.
Copies the appropriate config template to
/etc/nginx/sites-available/, creates a symlink in
sites-enabled/, and reloads nginx.
vesta nginx setup
Adds application/javascript mjs; to
/etc/nginx/mime.types so ES modules are served with
the correct Content-Type header.
vesta nginx mime
.mjs files imported as modules.
Removes the existing site config and re-runs vesta nginx setup.
Useful after changing the port or domain in server.ini.
vesta nginx reset
systemd service
Creates /etc/systemd/system/<SERVICE_NAME>.service
from the template in misc/vesta.service, reloads the
systemd daemon, and enables the service.
vesta service setup
After setup, manage the service with standard systemd commands:
systemctl start myapp
systemctl stop myapp
systemctl status myapp
journalctl -u myapp -f # tail logs
The SERVICE_NAME value comes from server.ini [server].
Scheduled tasks (cron)
When the cron feature is selected at vesta init, your project
gets a crons/ directory of task scripts. Each script subclasses
Server and runs its exec() method. The
vesta cron commands register those scripts with the user's
crontab — the schedule for each is keyed by filename.
Scans crons/ and writes an entry for each recognized script
into a managed block in your crontab. Scripts run with the project
virtualenv interpreter (venv/bin/python3), falling back to
the system python3.
vesta cron setup
Schedules are assigned by filename:
| Script | Schedule | Cron expression |
|---|---|---|
15mins.py | Every 15 minutes | */15 * * * * |
1h.py | Hourly | 0 * * * * |
1day.py | Daily at midnight | 0 0 * * * |
exemple.py | Daily at midnight | 0 0 * * * |
CRON_SCHEDULES map in the installer to schedule them.
Strips the vesta-managed block from your crontab, leaving any other entries in place.
vesta cron reset
Testing
Discovers and runs all tests in the tests/ directory.
Requires a running PostgreSQL instance for ORM tests.
vesta test
Environment variables can override the test DB connection (used by CI):
| Variable | Default |
|---|---|
DB_HOST | localhost |
DB_USER | test_user |
DB_PASSWORD | test_password |
DB_NAME | test_vesta_db |
DB_PORT | 5432 |
Project structure after vesta init
myproject/
├── server.py # Application entry point
├── server.ini # Configuration (never commit secrets!)
├── vesta.manifest # Feature selections for CLI commands
├── requirements.txt # Python dependencies
├── install.sh # One-shot server provisioning script
│
├── static/
│ ├── index.html # Main HTML shell
│ ├── framework/ # Vesta JS modules (if selected)
│ │ ├── vesta.mjs
│ │ ├── navigation.mjs
│ │ ├── websockets.mjs
│ │ └── ...
│ ├── templates/ # HTML fragments for fillWith()
│ ├── translations/ # i18n .mjs files
│ ├── markdown/ # Markdown parser (if selected)
│ └── attachments/ # Uploaded files (auto-created)
│
├── db/
│ ├── schema.sql # Table definitions — edit this
│ └── initDB.py # Called by vesta db init
│
├── mailing/ # Present when mailing is active
│ ├── dkim.txt # DKIM private key
│ ├── mailVerif.html # OTP verification email template
│ ├── mailReset.html # Password reset email template
│ └── mailInvite.html # Org invite email template
│
├── crons/ # Present when cron is selected
│ ├── 15mins.py
│ ├── 1h.py
│ └── 1day.py
│
└── misc/
├── nginx_local # nginx config for local dev
├── nginx_prod # nginx config for production
└── vesta.service # systemd unit file template