Layouts
Manage your city layouts from the command line.
List Layouts
Output:
Plan: Premium (Status: active)
Layouts: 2/20
Archived: 1
Assets per layout: Unlimited
LAYOUTS:
ID NAME SIZE BUILDINGS
550e8400-e29b-41d4-a716-446655440000 Production 10x10 32
550e8400-e29b-41d4-a716-446655440001 Staging 8x8 18
JSON Output
Useful for scripting:
Check Quota
Output:
Create Layout
From JSON File
layout.json example:
{
"name": "My City",
"grid_width": 10,
"grid_height": 10,
"cells": [
{
"x": 0,
"y": 0,
"type": "road"
},
{
"x": 1,
"y": 0,
"type": "building",
"building": {
"type": "windmill",
"name": "App Server",
"orientation": "N"
}
}
]
}
From Flags
Creates an empty layout that you can then edit in the Map Builder.
Update Layout
Updates the existing layout with the new definition.
Destructive
This replaces the entire layout. Buildings not in the new file are removed.
Delete Layout
Permanently deletes the layout and all its buildings.
Cannot be undone
Deleted layouts cannot be recovered. Consider archiving instead.
Archive Management
List Archived
Archive a Layout
Moves the layout to archive. It: - No longer counts against your quota - Can be restored later - Retains all buildings and settings
Restore Layout
Restores an archived layout to active status.
Layout JSON Format
Basic Structure
Cell Types
Road cell:
Building cell:
{
"x": 1,
"y": 1,
"type": "building",
"building": {
"id": "optional-uuid",
"type": "windmill",
"name": "Building Name",
"description": "Optional description",
"tags": ["tag1", "tag2"],
"notes": "Optional notes",
"orientation": "N"
}
}
Orientation Values
N- North (up)E- East (right)S- South (down)W- West (left)
Building Types
windmill, data_center, arcade, bank, pyramid, supervisor,
tower_a, tower_b, monitor_tube, display_a, house_a, house_b,
house_c, spire, led_facade, diamond_tower, twin_towers,
bakery, farm_building_a, farm_building_b, farm_silo,
farm_field_a, farm_field_b, farm_cattle_a, traffic_light, tree
Examples
Export Layout to JSON
While there's no direct export command, you can fetch via API:
curl -H "Authorization: Bearer $(wt config show --json | jq -r '.token')" \
https://api.whook.town/ui/layout/<layout-id> | jq > layout.json
Duplicate Layout
# Fetch existing layout
curl ... > original.json
# Modify name
jq '.name = "Copy of Original"' original.json > copy.json
# Create new layout
wt layout create -f copy.json
Batch Create Buildings
Create a script to generate layout JSON:
#!/bin/bash
cat > layout.json << EOF
{
"name": "Generated City",
"grid_width": 5,
"grid_height": 5,
"cells": [
{"x": 0, "y": 0, "type": "road"},
{"x": 1, "y": 0, "type": "road"},
{"x": 2, "y": 0, "type": "building", "building": {"type": "windmill", "name": "Server 1", "orientation": "N"}},
{"x": 3, "y": 0, "type": "building", "building": {"type": "windmill", "name": "Server 2", "orientation": "N"}}
]
}
EOF
wt layout create -f layout.json