The nself history command provides an audit trail of all ɳSelf operations, deployments, and changes. Track deployments, migrations, rollbacks, and commands with search and export functionality.
View command history (default command).
nself history [options]
# Options:
# -n, --limit <n> Number of entries (default: 20)
# --since <duration> Time range (e.g., 24h, 7d)
# --type <type> command, deploy, config, db
# --json Output as JSON
# Example output:
# ID TIME TYPE COMMAND
# 156 2026-01-23 10:30 command nself deploy staging
# 155 2026-01-23 10:25 command nself build
# 154 2026-01-23 10:20 config .env updated
# 153 2026-01-23 09:45 db migration appliedShow details of a specific history entry.
nself history show <id>
# Example
nself history show 156
# Output:
# History Entry #156
# ==================
# Type: command
# Command: nself deploy staging
# Time: 2026-01-23 10:30:15
# Duration: 45s
# Status: success
# User: admin
#
# Details:
# Environment: staging
# Files synced: 24
# Services restarted: 8View deployment history.
nself history deploy [environment] [options]
# Options:
# -n, --limit <n> Number of entries
# --status <status> Filter by status (success, failed, rollback)
# Examples
nself history deploy # All deployments
nself history deploy staging # Staging only
nself history deploy prod --limit 10 # Last 10 production
# Output:
# ID TIME ENV STATUS DURATION
# 45 2026-01-23 10:30 staging success 45s
# 44 2026-01-22 18:00 prod success 62s
# 43 2026-01-22 15:30 staging failed 12s
# 42 2026-01-22 14:00 staging success 38sShow deployment details.
nself history deploy show <id>
# Output:
# Deployment #45
# ==============
# Environment: staging
# Time: 2026-01-23 10:30:15
# Duration: 45 seconds
# Status: success
# Deployed by: admin
#
# Changes:
# - docker-compose.yml updated
# - nginx/conf.d/default.conf updated
# - .env updated
#
# Services:
# - postgres: no change
# - hasura: restarted
# - auth: restarted
# - nginx: reloaded
#
# Commit: abc123fView configuration change history.
nself history config [options]
# Output:
# TIME FILE CHANGES
# 2026-01-23 10:20 .env 3 variables changed
# 2026-01-22 18:00 .env MONITORING_ENABLED added
# 2026-01-22 14:00 server.json host updatedShow configuration diff between entries.
nself history config diff <id1> <id2>
# Example
nself history config diff 150 155
# Output:
# Configuration Changes (150 → 155)
# =================================
# + MONITORING_ENABLED=true
# + GRAFANA_ADMIN_PASSWORD=****
# - DEBUG=true
# ~ LOG_LEVEL: info → warningView database operation history.
nself history db [options]
# Options:
# --type <type> migration, backup, restore, seed
# Output:
# TIME TYPE DETAILS
# 2026-01-23 09:45 migration 20260123_add_orders applied
# 2026-01-22 23:00 backup backup_20260122.sql (2.3GB)
# 2026-01-22 14:00 seed staging data loaded
# 2026-01-21 10:00 migration 20260121_users_table appliedSearch through history.
nself history search <query> [options]
# Examples
nself history search "deploy"
nself history search "prod" --type deploy
nself history search "migration" --since 7dFilter history by criteria.
nself history filter [options]
# Options:
# --type <type> command, deploy, config, db
# --status <status> success, failed
# --since <duration> Time range
# --user <user> Filter by user
# Example
nself history filter --type deploy --status failed --since 30dRollback to a previous state.
nself history rollback <id> [options]
# Options:
# --config-only Only rollback configuration
# --dry-run Preview rollback
# --force Skip confirmation
# Examples
nself history rollback 150 # Full rollback
nself history rollback 150 --dry-run # Preview
nself history rollback 150 --config-only # Config onlyExport history for reporting.
nself history export [options]
# Options:
# --format <fmt> json, csv, markdown
# --output <file> Output file
# --since <duration> Time range
# Example
nself history export --format csv --output history.csv --since 30dGenerate history report.
nself history report [options]
# Options:
# --period <period> daily, weekly, monthly
# --format <fmt> html, markdown
# Example
nself history report --period weekly --format htmlHistory is stored in .ɳSelf/history/:
.nself/history/
├── commands.log # Command history
├── deployments.log # Deployment records
├── config/ # Config snapshots
│ ├── 2026-01-23_10-20.env
│ └── 2026-01-22_18-00.env
└── db/ # Database operation logs| Variable | Description | Default |
|---|---|---|
| NSELF_HISTORY_RETENTION | Days to keep history | 90 |
| NSELF_HISTORY_ENABLED | Enable history tracking | true |