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
- Sends
BGREWRITEAOFcommand to Redis - Redis compacts all operations into a single AOF file
- File is saved to
.tt/redis.aof(configurable intinytown.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
- tt restore — Restore state from AOF
- tt sync — Sync tasks.toml with Redis
- Redis Configuration