Skip to main content

Synopsis

chameleon status
Display current status of schema, vault, and configuration.

Description

The status command provides a quick overview of:
  • Schema status - Current version, last modified, pending changes
  • Vault status - Registered versions, integrity, paranoid mode
  • Configuration - Debug settings and project config
Use this command to check project health and vault state.

Examples

Fresh Project (No Migrations)

chameleon status
Output:
🗂️  ChameleonDB Status
────────────────────────────────────────────

Schema:
  Status:          ⚠️  No vault initialized
  Action:          Run 'chameleon migrate' to start

Vault:
  Status:          Not initialized

Configuration:
  Debug Level:     off

After First Migration

chameleon migrate --apply
chameleon status
Output:
🗂️  ChameleonDB Status
────────────────────────────────────────────

Schema:
  Current version:  v001
  Hash:            3f2a8b9c...
  Last modified:   2 hours ago
  Status:          ✓ Up to date

Vault:
  Versions:        1 registered
  Integrity:       ✓ OK
  Mode:            🛡️ readonly

Configuration:
  Debug Level:     off

Schema Modified (Pending Migration)

# Edit schema
vim schemas/users.cham

# Check status
chameleon status
Output:
🗂️  ChameleonDB Status
────────────────────────────────────────────

Schema:
  Current version:  v001
  Hash:            3f2a8b9c...
  Last modified:   just now
  Status:          ⚠️  Schema modified (not registered)

Vault:
  Versions:        1 registered
  Integrity:       ✓ OK
  Mode:            ⚙️ standard

Configuration:
  Debug Level:     off

Multiple Versions

chameleon status
Output:
🗂️  ChameleonDB Status
────────────────────────────────────────────

Schema:
  Current version:  v003
  Hash:            9e2f5a1b...
  Last modified:   5 minutes ago
  Status:          ✓ Up to date

Vault:
  Versions:        3 registered
  Integrity:       ✓ OK
  Mode:            ⚙️ standard

Configuration:
  Debug Level:     off

Integrity Issues

chameleon status
Output:
🗂️  ChameleonDB Status
────────────────────────────────────────────

Schema:
  Current version:  v002
  Hash:            7d4e1c2a...
  Last modified:   1 day ago
  Status:          ✓ Up to date

Vault:
  Versions:        2 registered
  Integrity:       ❌ 1 issues
  Mode:            🛡️ readonly

Configuration:
  Debug Level:     off

Status Fields

Schema Section

Current version
string
Latest registered schema version (e.g., v001, v002)
Hash
string
SHA256 hash of current version (first 12 characters)Example: 3f2a8b9c...
Last modified
string
Time since last schema changeExamples:
  • just now
  • 5 minutes ago
  • 2 hours ago
  • 3 days ago
Status
string
Current schema state:
  • ✓ Up to date - No pending changes
  • ⚠️ Schema modified - Changes not yet migrated
  • ⚠️ No vault initialized - First-time setup needed

Vault Section

Versions
number
Total number of registered schema versionsExample: 3 registered
Integrity
string
Cryptographic verification result:
  • ✓ OK - All hashes verified
  • ❌ N issues - Tampering detected
Mode
string
Current paranoid mode:
  • 🛡️ readonly - Schema locked (default)
  • ⚙️ standard - Controlled changes allowed
  • 👑 privileged - DBA access
  • 🚨 emergency - Incident recovery

Paranoid Mode Icons

IconModeDescription
🛡️readonlySchema modifications blocked (default)
⚙️standardControlled schema changes allowed
👑privilegedDBA-level access with logging
🚨emergencyEmergency recovery mode

Time Formatting

“Last modified” displays:
  • < 1 minute: just now
  • < 1 hour: N minutes ago
  • < 24 hours: N hours ago
  • ≥ 24 hours: N days ago

Common Status Patterns

Ready to Migrate

Schema:
  Status:          ⚠️  Schema modified (not registered)
  
Vault:
  Integrity:       ✓ OK
  Mode:            ⚙️ standard
Action:
chameleon migrate --apply

Locked in Readonly Mode

Vault:
  Mode:            🛡️ readonly
Action:
# Upgrade mode to allow changes
chameleon config set mode=standard

Integrity Violation

Vault:
  Integrity:       ❌ 2 issues
Action:
# Get detailed report
chameleon verify

First-Time Setup

Schema:
  Status:          ⚠️  No vault initialized
Action:
chameleon migrate --apply

Troubleshooting

No Vault Initialized

Schema:
  Status:          ⚠️  No vault initialized
  Action:          Run 'chameleon migrate' to start
Solution: Run first migration:
chameleon migrate --apply

Cannot Read Vault

❌ Failed to load vault: permission denied
Solution: Ensure permissions:
chmod -R u+r .chameleon/vault/

Schema File Missing

Schema Files:
  ⚠️  schema *.cham not found
Solution: Regenerate merged schema:
chameleon migrate --check

Quick Status Check Script

#!/bin/bash
# Quick status check for CI/CD

OUTPUT=$(chameleon status)

if echo "$OUTPUT" | grep -q "✓ OK"; then
  echo "✅ Vault integrity OK"
  exit 0
else
  echo "❌ Vault has issues"
  exit 1
fi

Integration Examples

Pre-Commit Hook

#!/bin/bash
# .git/hooks/pre-commit

if ! chameleon status | grep -q "✓ Up to date"; then
  echo "⚠️  Warning: Schema has uncommitted changes"
  chameleon status
fi

Monitoring Script

#!/bin/bash
# /usr/local/bin/check-chameleon-vault

OUTPUT=$(chameleon status)

if echo "$OUTPUT" | grep -q "❌"; then
  echo "CRITICAL: Vault integrity violation"
  echo "$OUTPUT"
  exit 2
fi

echo "OK: Vault healthy"
exit 0

See Also