CLI Commands

Complete reference for all zMesh CLI commands.

Authentication

CommandDescription
zmesh loginAuthenticate with email/password
zmesh login --api-url <url>Login to self-hosted instance
zmesh logoutClear stored credentials
zmesh whoamiShow current user & linked project

Projects

CommandDescription
zmesh projectsList all projects
zmesh init --name "App"Create & link a new project
zmesh link <project-id>Link existing project to current dir
zmesh unlinkUnlink current directory

Database

CommandDescription
zmesh database tablesList all tables in the project
zmesh database query "SQL"Execute raw SQL
zmesh database query --file schema.sqlRun SQL from file
zmesh database migrate <file>Run a migration script
zmesh database seed <file>Seed data from JSON file
Examples
# Create a table
zmesh database query "CREATE TABLE posts (
  id SERIAL PRIMARY KEY,
  title TEXT NOT NULL,
  body TEXT,
  created_at TIMESTAMP DEFAULT NOW()
)"

# Query data
zmesh database query "SELECT * FROM posts LIMIT 10"

# Run migration file
zmesh database migrate ./migrations/001_add_users.sql

# Seed from JSON
zmesh database seed ./seeds/users.json
# JSON format: { "table": "users", "data": [{ "name": "Alice" }] }

Edge Functions

CommandDescription
zmesh functions listList all deployed functions
zmesh functions deploy <file>Deploy a .js or .py function
zmesh functions invoke <slug>Invoke with --payload JSON
zmesh functions logs <slug>View invocation logs
zmesh functions delete <slug>Remove a function
Deploy with options
zmesh functions deploy ./send-email.js \
  --name send-email \
  --description "Send transactional emails" \
  --entry-point handler \
  --env SMTP_HOST=smtp.sendgrid.net \
  --timeout 10000

Storage

CommandDescription
zmesh storage listList files (--bucket, --prefix)
zmesh storage upload <file>Upload with --path and --bucket
zmesh storage download <path>Download to --output
zmesh storage delete <path>Remove a file
Examples
# Upload an image
zmesh storage upload ./logo.png --path images/logo.png --bucket assets

# List files in a folder
zmesh storage list --bucket assets --prefix images/

# Download a file
zmesh storage download images/logo.png --output ./downloaded.png

Environment Variables

CommandDescription
zmesh env --listList all environment variables
zmesh env --set KEY=valueSet an environment variable
zmesh env --unset KEYRemove an environment variable