From 7b7cfd2793cbe6b8d0a78212f46bbfb9a1214e21 Mon Sep 17 00:00:00 2001 From: Aaron Bennett <10927621+abennett@users.noreply.github.com> Date: Sat, 17 Jan 2026 23:59:04 -0500 Subject: [PATCH 1/2] setup readme and a release workflow --- .github/workflows/go.yml | 13 +++++--- .github/workflows/release.yml | 40 ++++++++++++++++++++++++ README.md | 58 +++++++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 README.md diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index dceb65d..ce2db93 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -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: latest + - 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" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c51ad86 --- /dev/null +++ b/.github/workflows/release.yml @@ -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: latest + + - 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/* diff --git a/README.md b/README.md new file mode 100644 index 0000000..71d8476 --- /dev/null +++ b/README.md @@ -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. From d25ce62e2556d4c3809a326c044b5d87ded8a565 Mon Sep 17 00:00:00 2001 From: Aaron Bennett <10927621+abennett@users.noreply.github.com> Date: Sun, 18 Jan 2026 00:01:08 -0500 Subject: [PATCH 2/2] fix go-version --- .github/workflows/go.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index ce2db93..1f5e839 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -20,7 +20,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v6 with: - go-version: latest + go-version: stable - name: Lint uses: golangci/golangci-lint-action@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c51ad86..ec0d086 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v6 with: - go-version: latest + go-version: stable - name: Build env: