K

Database & env vars

App database inspection (tables db-list · db-rows) and environment variable (env) commands

This page is for checking, right from the terminal, which tables and rows the app-dedicated DB holds — and for setting and removing app environment variables. The app-dedicated database is enabled by declaring database.engine: postgres in axhub.yaml (or via axhub apps raw-db). Data reads and writes go through the DATABASE_URL injected into the app runtime; the CLI's tables commands do read-only inspection only. The flow from enabling the DB through migrations is covered in the Connect a database.

axhub tables db-list

List the app database's tables (OAuth required).

FlagTypeDescriptionDefault
--appstringApp slug or id to inspect
--environmentstringRead production or staging raw DB metadata

axhub tables db-rows

Browse rows from one app database table (OAuth required).

FlagTypeDescriptionDefault
<table>string (positional)Raw database table name to browse
--appstringApp slug or id to inspect
--environmentstringRead production or staging raw DB rows
--pageintegerPage number to request
--per-pageintegerNumber of rows per page

Enabling/disabling the database lives at axhub apps raw-db enable · disable. Creating tables and writing rows is not a CLI job — use your app's migration tool and DATABASE_URL.

If the app's resource-browsing policy is locked to owners_only · locked, reads of DB rows, storage files, and environment-variable values can be refused with 403 resource_browse_restricted — even for admins.


axhub env

Manage app environment variables: list, get, set, update, and delete.

axhub env delete

Delete an environment variable.

FlagTypeDescriptionDefault
<key>string (positional)Environment variable key.
--appstringApp slug or ID to operate on.
--dry-runbooleanPreview the operation without applying state changes.true
--executebooleanApply the state-changing operation instead of previewing it.

axhub env get

Get one environment variable's value.

FlagTypeDescriptionDefault
<key>string (positional)Environment variable key.
--appstringApp slug or ID to operate on.

axhub env list

List an app's environment variables.

FlagTypeDescriptionDefault
--appstringApp slug or ID to operate on.

axhub env set

Set (create) an environment variable.

FlagTypeDescriptionDefault
<key>string (positional)Environment variable key.
<value>string (positional)Environment variable value.
--appstringApp slug or ID to operate on.
--from-stdinbooleanRead the value from standard input.
--plainbooleanMark the value as plain. Mutually exclusive with --secret
--secretbooleanMark the value as a secret. Backend masks it on read (value=***) and encrypts at rest. When set, value positional arg is disallowed; use --from-stdin instead
--stagestringStage where this variable is available: build, runtime, or both

axhub env set-staging-value

Set an environment variable's staging-only value (dry-run by default).

FlagTypeDescriptionDefault
<key>string (positional)Environment variable key.
<value>string (positional)Environment variable value.
--appstringApp slug or ID to operate on.
--dry-runbooleanPreview the operation without applying state changes.true
--executebooleanApply the state-changing operation instead of previewing it.
--from-stdinbooleanRead the value from standard input.

axhub env update

Update an existing environment variable.

FlagTypeDescriptionDefault
<key>string (positional)Env var key to update. Must already exist (otherwise ExitCode 5)
<value>string (positional)New value, positional. Mirrors env set KEY VALUE so the two commands share a single argument shape. live-QA Gap C/E showed users hitting unexpected argument 'VALUE' because the only way to pass a value was the --value flag. --value stays as a backward-compatible alias (handler prefers positional when both are passed); pass through stdin with --from-stdin
--appstringApp slug or ID to operate on.
--from-stdinbooleanRead the new value from stdin. Mutually exclusive with both positional value and the legacy --value flag — passing more than one input shape is a usage error
--plainbooleanMark as plain on update
--secretbooleanMark as secret on update
--stagestringStage where this variable is available: build, runtime, or both

On apps with the database enabled, DATABASE_URL · DIRECT_DATABASE_URL — and with storage enabled, STORAGE_* — are platform-injected and always win: a same-named saved variable is ignored.