@glash/cli
v0.2.7
Published
glashDB command-line interface — deploy projects, pull source + env, manage env vars.
Maintainers
Readme
@glash/cli
The official command-line interface for glashDB.
npm install -g @glash/cli
glash login
glash deployCommands
| Command | Purpose |
| --- | --- |
| glash login | Sign in (stores a token at ~/.glash/credentials.json) |
| glash logout | Clear local credentials |
| glash whoami | Show the signed-in user |
| glash projects | List your projects |
| glash projects:new <name> | Create a project and link it to the current directory |
| glash new <name> | Alias for projects:new |
| glash new deploy | Deploy to a brand new project, ignoring any existing link |
| glash projects:rm <slug> | Delete a project |
| glash link <slug> | Link the current directory to an existing project |
| glash open | Open the linked project's primary domain |
| glash deploy [--prod] [--detach] | Deploy the linked project; streams the pipeline until live |
| glash deployments | List recent deployments |
| glash status <id> | Show a deployment's pipeline + events |
| glash logs <id> | Alias of status |
| glash rollback <id> | Roll the linked project back to a previous deployment |
| glash retry <id> [--fix <id>] | Retry a failed deployment |
| glash env | List env vars for the linked project |
| glash env:add KEY=value | Set a single env var |
| glash env:rm KEY | Remove an env var |
| glash env:pull [--out .env.local] | Pull env vars to a local file |
| glash env:push [<file>] | Bulk upload from a .env file |
| glash database dump [--url "$DATABASE_URL"] | Dump a Postgres-compatible source database to .glash/database-dumps/ |
| glash database upload [--file dump.dump] | Restore a local dump into the linked glashDB database |
| glash update | Update @glash/cli to the latest version |
Pass --project <slug> to any command to operate on a project other than
the one linked in the current directory.
Database dump and upload
glash database dump looks for a Postgres-compatible source URL in this order:
--url/--from- the current shell environment
.env,.env.local,.env.production,.env.development
Supported env names include DATABASE_URL, POSTGRES_URL,
POSTGRES_URL_NON_POOLING, DIRECT_URL, and SUPABASE_DB_URL.
Examples:
glash database dump
glash database dump --url "$DATABASE_URL" --out ./backup.dump
glash database dump --format plain --out ./backup.sqlglash database upload restores the latest dump into the linked glashDB
project. It fetches the project's revealed direct database URL from the glashDB
API and runs pg_restore for custom dumps or psql for .sql dumps.
glash link my-project
glash database upload --yes
glash database upload --file ./backup.sql --format plain --project my-projectThe commands require PostgreSQL client tools locally: pg_dump for dumps,
pg_restore for custom-format restores, and psql for plain SQL restores.
Environment
| Variable | Default | Notes |
| --- | --- | --- |
| GLASH_API_URL | https://api.glashdb.com/api | Override the API base (self-hosted, staging) |
| GLASH_TOKEN | — | Use this token instead of ~/.glash/credentials.json (useful in CI) |
Requirements
Node.js 20+. Zero runtime dependencies.
License
Apache-2.0
