Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

tt save

Save Redis state to AOF file for version control.

Synopsis

tt save

Description

Triggers Redis to compact and save its state to an AOF (Append Only File). This file can then be version controlled with git.

How It Works

  1. Sends BGREWRITEAOF command to Redis
  2. Redis compacts all operations into a single AOF file
  3. File is saved to .tt/redis.aof (configurable in tinytown.toml)

Example

tt save

Output:

💾 Saving Redis state...
   AOF rewrite triggered. File: ./.tt/redis.aof

   To version control Redis state:
   git add .tt/redis.aof
   git commit -m 'Save town state'

Version Control Workflow

# Work on your project
tt spawn backend
tt assign backend "Build the API"
# ... agents work ...

# Save state before committing code
tt save
git add .tt/redis.aof tasks.toml
git commit -m "API implementation complete"

# Later, restore on another machine
git pull
tt restore  # See instructions

AOF File Contents

The AOF file contains Redis commands to recreate state:

  • All agent registrations
  • All task states
  • All messages in inboxes
  • All activity logs

Config Options

In tinytown.toml:

[redis]
persist = true
aof_path = ".tt/redis.aof"

See Also