Skip to content

Layouts

Manage your city layouts from the command line.

List Layouts

wt layout list

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

wt layout list --json

Useful for scripting:

wt layout list --json | jq '.layouts[].name'

Check Quota

wt layout quota

Output:

Plan: Premium
Status: active

Layouts: 2 / 20
Archived: 1
Assets per layout: Unlimited

Create Layout

From JSON File

wt layout create -f layout.json

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

wt layout create --name "New City" --grid-width 10 --grid-height 10

Creates an empty layout that you can then edit in the Map Builder.

Update Layout

wt layout update <layout-id> -f layout.json

Updates the existing layout with the new definition.

Destructive

This replaces the entire layout. Buildings not in the new file are removed.

Delete Layout

wt layout delete <layout-id>

Permanently deletes the layout and all its buildings.

Cannot be undone

Deleted layouts cannot be recovered. Consider archiving instead.

Archive Management

List Archived

wt layout archive list

Archive a Layout

wt layout archive <layout-id>

Moves the layout to archive. It: - No longer counts against your quota - Can be restored later - Retains all buildings and settings

Restore Layout

wt layout restore <layout-id>

Restores an archived layout to active status.

Layout JSON Format

Basic Structure

{
  "name": "Layout Name",
  "grid_width": 10,
  "grid_height": 10,
  "cells": []
}

Cell Types

Road cell:

{
  "x": 0,
  "y": 0,
  "type": "road"
}

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