Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@ jobs:
preflight:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version: '>=1.21'
cache: false
go-version: stable

- name: Lint
uses: golangci/golangci-lint-action@v4

- name: Test
run: go test -v ./...

- name: Build
run: CGO_ENABLED=0 go build -trimpath -ldflags="-w -s"
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release Build

on:
push:
branches: ["main"]
workflow_dispatch:

jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: [amd64, arm64]
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: stable

- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
BINARY_NAME=ttt
if [ "${{ matrix.goos }}" = "windows" ]; then
BINARY_NAME=ttt.exe
fi
go build -v -o "dist/${BINARY_NAME}-${{ matrix.goos }}-${{ matrix.goarch }}" -trimpath -ldflags="-w -s"

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ttt-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/*
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# ttt - Turn Taking Tool

`ttt` is a real-time, multiplayer CLI tool designed to manage turn order and initiative for team meetings. Built with Go, it uses WebSockets for low-latency updates and to bring a bit more joy into your day.

## Features

- **Real-time Synchronization:** See rolls and turn updates from all players instantly.
- **TUI Interface:** Clean, table-based interface built with Bubble Tea.
- **Dice Parsing:** Support for standard dice notation (e.g., `1d20+5`, `2d6-1`).
- **Room-based organization:** Multiple separate games can be hosted on a single server.
- **Binary Protocol:** Uses `msgpack` over WebSockets for efficient communication.

## Installation

Ensure you have [Go](https://go.dev/dl/) installed (version 1.24 or later).

```bash
go install github.com/abennett/ttt@latest
```

## Usage

### 1. Start the Server

To host a session, start the `ttt` server:

```bash
ttt serve --port 8080
```

### 2. Join a Room

Players can join a room by providing the server URL, a room name, and their username:

```bash
ttt roll http://localhost:8080 my-game-room Alice
```

Once in the room, `ttt` will automatically roll initiative for you (based on the room's default dice).

**Controls:**
- `Space`: Toggle your "Done" status (useful for tracking who has taken their turn).
- `q` or `Ctrl+C`: Quit the session.

### 3. Local Dice Rolling

You can also use `ttt` as a simple local dice roller:

```bash
ttt roll_local 2d20+5
```

## Technical Architecture

- **Backend:** Go using `chi` for HTTP routing and `gorilla/websocket` for real-time communication.
- **Frontend:** Terminal UI built with `charmbracelet/bubbletea`, `bubbles`, and `lipgloss`.
- **Serialization:** `vmihailenco/msgpack` for compact binary messaging.
- **CLI Framework:** `peterbourgon/ff` for robust command-line argument parsing.
Loading