Repository navigation
hasura metadata auto apply
nself start and nself deploy now apply hasura/metadata/ (or the legacy hasura/metadata.json) automatically, if the project has one. Before this, only the manual nself db hasura metadata apply command ever called Hasura's metadata API — a project's on-disk metadata could silently drift arbitrarily far from what a running environment actually tracked.
| Command | When | Local or remote |
|---|---|---|
nself start |
After health checks confirm Hasura is up (skipped with --skip-db-init) |
Local only |
nself deploy local |
After the rolling restart | Local |
nself deploy staging / nself deploy prod (host configured) |
After the remote rolling restart, over SSH | Remote — hasura/ is rsynced alongside the compose file and env, then the remote host's own nself db hasura metadata apply is invoked |
nself deploy staging / nself deploy prod (no host configured) |
After the local rolling restart (assumes the deploy is being run from the target box itself) | Local |
Every path is a clean no-op when the project has no hasura/metadata/ directory and no hasura/metadata.json — and, separately, when nothing responds on Hasura's configured port at all (a stack/run that doesn't include Hasura). The second check only distinguishes "no Hasura here" (connection refused/timeout) from "Hasura is here but unhealthy" (any HTTP response, including a degraded/down /healthz) — the latter still goes through the normal strict/warn-only apply attempt below, since a real instance may just be slow to come up.
Controlled by NSELF_HASURA_METADATA_STRICT (true/false). If unset, the default is:
-
dev — warn-only. A failed apply, or metadata that applies but leaves inconsistent objects (
get_inconsistent_metadata), prints a warning and does not fail the command. -
staging / prod — strict. The same failures fail
nself start/nself deploy.
Override either direction explicitly:
# Fail dev builds on metadata problems too (e.g. CI):
NSELF_HASURA_METADATA_STRICT=true nself start
# Downgrade a prod deploy to warn-only while investigating a known-bad metadata tree:
NSELF_HASURA_METADATA_STRICT=false nself deploy prodnself db hasura metadata apply # apply hasura/metadata/ by hand
nself db hasura metadata export # export live metadata to git-friendly sorted YAML
nself db hasura diff # compare live metadata against on-disk filesnself db hasura metadata apply --env staging (or --env prod) re-invokes the same command on that environment's own remote host over SSH — see nself db hasura --help. (A dedicated top-level nself hasura alias was considered but dropped: CLI-R11 caps the core command surface, and nself db hasura ... already covers this — see .github/command-surface-budget.txt.)
Hasura CLI-style metadata (hasura/metadata/tables.yaml + one !include'd YAML file per table) requires each included file to be a bare mapping (table: {...}), not a one-element list (- table: {...}). A list-wrapped file is a common copy-paste mistake when hand-editing metadata and previously reached the Hasura API as silently malformed metadata. nself db hasura metadata apply now catches this before sending anything, with an error naming the exact section and index, e.g.:
hasura metadata: tables[12] is a YAML list, not an object — the !include'd file is
list-wrapped (starts with "- " instead of a bare mapping); unwrap it to a single object
- operations/hasura-metadata-backup — daily export + restore
- cmd-start — full start command reference
- cmd-deploy — full deploy command reference
- Home
Getting Started
Commands
- Commands, Overview
- Lifecycle: cmd-init · cmd-build · cmd-start · cmd-stop · cmd-restart · cmd-dev
- Monitoring: cmd-status · cmd-logs · cmd-health · cmd-urls · cmd-doctor · cmd-monitor · cmd-alerts · cmd-sentry · cmd-watchdog
- Data: cmd-db · cmd-backup · cmd-dr · cmd-queue · cmd-webhooks
- Config: cmd-config · cmd-service · cmd-env · cmd-promote
- Networking: cmd-ssl · cmd-trust · cmd-dns-setup
- Security: cmd-access · cmd-security · cmd-secrets
- Tenancy: cmd-tenant · cmd-billing
- Plugins: cmd-plugin · cmd-license · cmd-dogfood (extracted, CLI-R11) · cmd-k8s (extracted, CLI-R11) · cmd-encryption (extracted, CLI-R11) · cmd-waf (extracted, CLI-R11) · cmd-federation (extracted, CLI-R11) · cmd-mail (extracted, CLI-R11) · cmd-dlq (extracted, CLI-R11)
- AI: cmd-ai · cmd-claw · cmd-model
- Templates: cmd-template
- Utilities: cmd-exec · cmd-clean · cmd-reset · cmd-update · cmd-upgrade · cmd-version · cmd-admin · cmd-migrate · cmd-migrate-firebase · cmd-migrate-supabase · cmd-completion
Features
- Features, Overview
- Feature-Auth
- Feature-Storage
- Feature-Search
- Feature-Functions
- Feature-Email
- Feature-Monitoring
- Feature-Plugins
- Feature-nClaw, AI Assistant
- Feature-nChat, Messaging
- Feature-nFamily, Family Social
- Feature-nCloud, Managed Hosting
- Feature-Memory-Rooms, Knowledge Organization
- Feature-Agent-Dashboard, Agent Metrics
- Feature-Image-Generation, AI Image Generation
Configuration
- Configuration, Overview
- Config-Env-Vars
- Config-Postgres
- Config-Hasura
- Config-Auth
- Config-Nginx
- Shared-Proxy
- Config-Optional-Services
- Config-Custom-Services
- Config-System
Plugins (87 + 10 monitoring)
- Plugin-Overview
- Plugin-Catalog
- Plugin-Install
- Plugin-Licensing
- Plugin-Architecture
- Plugin-Dev-Guide
- Plugin-Migrations-Contract
Free (25)
- plugin-backup
- plugin-content-acquisition
- plugin-content-progress
- plugin-cron
- plugin-donorbox
- plugin-feature-flags
- plugin-github
- plugin-github-runner
- plugin-invitations
- plugin-jobs
- plugin-link-preview
- plugin-mdns
- plugin-mlflow
- plugin-monitoring
- plugin-notifications
- plugin-notify
- plugin-paypal
- plugin-search
- plugin-shopify
- plugin-stripe
- plugin-subtitle-manager
- plugin-tokens
- plugin-torrent-manager
- plugin-vpn
- plugin-webhooks
Pro (62)
- plugin-access-controls
- plugin-activity-feed
- plugin-admin-api
- plugin-analytics
- plugin-auth
- plugin-bots
- plugin-browser
- plugin-calendar
- plugin-cdn
- plugin-chat
- plugin-claw
- plugin-claw-budget
- plugin-claw-news
- plugin-claw-web
- plugin-cloudflare
- plugin-cms
- plugin-compliance
- plugin-ddns
- plugin-devices
- plugin-documents
- plugin-entitlements
- plugin-file-processing
- plugin-game-metadata
- plugin-geocoding
- plugin-geolocation
- plugin-google
- plugin-home
- plugin-idme
- plugin-knowledge-base
- plugin-linkedin
- plugin-livekit
- plugin-media-processing
- plugin-meetings
- plugin-moderation
- plugin-mux
- plugin-object-storage
- plugin-observability
- plugin-photos
- plugin-podcast
- plugin-post
- plugin-realtime
- plugin-retro-gaming
- plugin-rom-discovery
- plugin-social
- plugin-sports
- plugin-support
- plugin-tmdb
- plugin-voice
- plugin-web3
- plugin-workflows
Planned (26)
plugin-auditplugin-blogplugin-checkoutplugin-commerceplugin-drmplugin-exportplugin-flowplugin-importplugin-ldapplugin-mailgunplugin-mediaplugin-oauth-providersplugin-pagesplugin-postmarkplugin-rate-limitplugin-reportsplugin-samlplugin-schedulerplugin-sendgridplugin-ssoplugin-subscriptionplugin-thumbplugin-transcoderplugin-twilioplugin-wafplugin-watermark
Guides
- Guide-Production-Deployment
- Guide-SSL-Setup
- Guide-Multi-Tenancy
- Guide-Security-Hardening
- Guide-Monitoring-Setup
- Guide-Backup-Restore
- Guide-Custom-Services
- Guide-Migration-from-v1
Architecture
- Architecture
- Architecture-Guardrails
- Service-Graph
- Compose-Generation
- Nginx-Generation
- Plugin-Architecture
Reference
Machine interface
-
JSON-Output,
--jsonenvelope -
Command-Registry,
nself help --json - Exit-Codes
- error-codes, Error Codes
-
Compat-V15,
NSELF_V15gate
Licensing
Security
Brand
Operations
- operations/release-cascade, Release Cascade
- operations/self-healing, Self-Healing Schema
- operations/redis-tuning, Redis Pool Tuning
- operations/meilisearch-warmup, MeiliSearch Warm-Up
- operations/jwt-rotation, JWT Key Rotation
- operations/windows-wsl2-setup, Windows / WSL2 Setup
- operations/gemini-oauth-reauth, Gemini OAuth Reauth
Contributing
Admin
- USER-ACTION-QUEUE, Pending Admin Actions
All commands (21)
- A: cmd-add · cmd-admin
- B: cmd-backup · cmd-build
- C: cmd-clean · cmd-config
- D: cmd-db · cmd-deploy · cmd-doctor
- E: cmd-exec
- I: cmd-init
- L: cmd-license · cmd-logs
- M: cmd-mcp
- R: cmd-remove · cmd-reset · cmd-restart
- S: cmd-start · cmd-status · cmd-stop
- U: cmd-update