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
1 change: 1 addition & 0 deletions .surface
Original file line number Diff line number Diff line change
Expand Up @@ -11742,6 +11742,7 @@ FLAG basecamp gauges list --no-hints type=bool
FLAG basecamp gauges list --no-stats type=bool
FLAG basecamp gauges list --profile type=string
FLAG basecamp gauges list --project type=string
FLAG basecamp gauges list --projects type=stringSlice
FLAG basecamp gauges list --quiet type=bool
FLAG basecamp gauges list --stats type=bool
FLAG basecamp gauges list --styled type=bool
Expand Down
2 changes: 1 addition & 1 deletion API-COVERAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ cannot faithfully cover at least one endpoint for a reason outside the CLI. A
| **Hill Charts** |
| hill_charts | 2 | `hillcharts` | ✅ | BC4 | - | show, track/untrack todolists |
| hill_charts (progress updates) | 3 | `hillcharts updates`, `hillcharts update` | ✅ | BC5 | - | post (`POST /todosets/:id/hills/versions.json`; `hillcharts update --dot <todolist-id\|name>=<0-100>`, repeatable, lists left out keep their position; `--note` Markdown converted to rich text, `-` reads stdin; `--notify` names who is told, nobody otherwise), list (`GET /todosets/:id/hills/versions.json`, paginated, newest first; bare `hillcharts updates` or `updates list`), show (`GET /todosets/:id/hills/versions/:id.json`; an id with `--in`/`--todoset`, or the update's web or API URL, which names its todoset). Each update carries its note (`description`, rich text) and every tracked todolist's position (`dots`; `id` is null for a todolist since deleted or moved). Todoset resolved as `hillcharts show` does |
| gauges | 7 | `gauges` | ✅ | BC4 | - | list, needles, needle, create, update, delete, enable/disable |
| gauges | 7 | `gauges` | ✅ | BC4 | - | list (--project/--in or --projects filter), needles, needle, create, update, delete, enable/disable |
| **Communication** |
| messages | 10 | `messages`, `message` | ✅ | BC4 | - | list, show, create, update, publish, pin, unpin. Create supports `--subscribe`/`--no-subscribe` and `--draft`. Publish promotes drafts to active. `move`/`copy` file a message onto a message board in another project (see recordings (moves, copies)) |
| message_boards | 3 | `messageboards` | ✅ | BC4 | - | Container, accessed via project dock |
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
charm.land/bubbles/v2 v2.2.1
charm.land/bubbletea/v2 v2.1.0
charm.land/lipgloss/v2 v2.0.6
github.com/basecamp/basecamp-sdk/go v0.36.0
github.com/basecamp/basecamp-sdk/go v0.37.0
Comment thread
robzolkos marked this conversation as resolved.
Resolved
github.com/basecamp/cli v0.2.2-0.20261023171439-c9bce8206df9
github.com/basecamp/mcp v0.0.0-20261118214004-663b2e5d2836
github.com/basecamp/surfguard/go v0.1.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuP
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
github.com/basecamp/actioncable-go v1.2.0 h1:t0MxlfMTcmaGXZ5ztgKRs7ZiY1MwXtBRwSSSAh1ofVg=
github.com/basecamp/actioncable-go v1.2.0/go.mod h1:ezaV5z1GXQAsqyejqTs6wCFl2D8Wj+COLQkHc/kwoRs=
github.com/basecamp/basecamp-sdk/go v0.36.0 h1:mkAcJQlh+5Vz64OmpImSda/pfa/usWPJ6gDTuZYVaTI=
github.com/basecamp/basecamp-sdk/go v0.36.0/go.mod h1:ynVJME8mVV3UHMUMnzBgygTnMtadQFxz1iYg7fqwUeM=
github.com/basecamp/basecamp-sdk/go v0.37.0 h1:/Tv7GALbwmj0/gk8y2kwAi9/OiiWEQlJcVDH9PfMHWM=
github.com/basecamp/basecamp-sdk/go v0.37.0/go.mod h1:ynVJME8mVV3UHMUMnzBgygTnMtadQFxz1iYg7fqwUeM=
github.com/basecamp/cli v0.2.2-0.20261023171439-c9bce8206df9 h1:3NfGs+zx23Tp6cf+97+UewrJHlzZMLzmvEXOmOJyQAk=
github.com/basecamp/cli v0.2.2-0.20261023171439-c9bce8206df9/go.mod h1:iTBTaWvsPEFIcZfkxQHEfISyJ6sZ7036K6bNx0RY3EE=
github.com/basecamp/mcp v0.0.0-20261118214004-663b2e5d2836 h1:ND4te8b+HVFFrgcm7+n8P83MKKPqBpIyoJ63tT9liRU=
Expand Down
66 changes: 59 additions & 7 deletions internal/commands/gauges.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package commands
import (
"fmt"
"strconv"
"strings"

"github.com/basecamp/basecamp-sdk/go/pkg/basecamp"
"github.com/spf13/cobra"
Expand All @@ -24,7 +25,8 @@ A gauge shows the current state of a project via needles positioned on a
0–100 scale, each colored green, yellow, or red.`,
Annotations: map[string]string{
"agent_notes": "Gauges track project progress with colored needles (0-100 scale).\n" +
"list is account-wide. needles/create/enable/disable are project-scoped (--in).\n" +
"list is account-wide unless --project/--in or --projects is given; configured project is ignored.\n" +
"needles/create/enable/disable are project-scoped (--in).\n" +
"Colors: green, yellow, red. Notify: everyone, working_on, custom.",
},
}
Expand All @@ -33,7 +35,7 @@ A gauge shows the current state of a project via needles positioned on a
cmd.PersistentFlags().StringVar(&project, "in", "", "Project ID (alias for --project)")

cmd.AddCommand(
newGaugesListCmd(),
newGaugesListCmd(&project),
newGaugesNeedlesCmd(&project),
newGaugesNeedleCmd(),
newGaugesCreateCmd(&project),
Expand All @@ -46,19 +48,67 @@ A gauge shows the current state of a project via needles positioned on a
return cmd
}

func newGaugesListCmd() *cobra.Command {
return &cobra.Command{
func newGaugesListCmd(project *string) *cobra.Command {
var projects []string

cmd := &cobra.Command{
Use: "list",
Short: "List all gauges across the account",
Long: "List all gauges across every project in the account.",
Short: "List gauges across the account or chosen projects",
Long: `List gauges across every project in the account, or filter by project.

Use --project/--in for one project, or --projects for a comma-separated list
of project IDs or names (repeatable). These forms cannot be combined.
Without an explicit filter, the configured default project is ignored.
Filtered gauges follow the supplied project order; unavailable gauges are omitted.

basecamp gauges list
basecamp gauges list --in MyProject
basecamp gauges list --projects "Marketing,Engineering"
basecamp gauges list --projects 30,10 --projects 20`,
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
app := appctx.FromContext(cmd.Context())

// Account-wide reports use only explicit scope, never ambient config.
single := *project
if single == "" {
single = app.Flags.Project
}
explicitSingle := single != "" || cmd.Flags().Changed("project") || cmd.Flags().Changed("in")
if cmd.Flags().Changed("projects") && explicitSingle {
return output.ErrUsage("--projects cannot be combined with --project/--in")
}
filters := projects
if explicitSingle {
filters = []string{single}
}
if (explicitSingle || cmd.Flags().Changed("projects")) && len(filters) == 0 {
return output.ErrUsage("Project filter needs a value")
}
for _, filter := range filters {
if strings.TrimSpace(filter) == "" {
return output.ErrUsage("Project filter needs a value")
}
}

if err := ensureAccount(cmd, app); err != nil {
return err
}

result, err := app.Account().Gauges().List(cmd.Context(), nil)
opts := &basecamp.GaugeListOptions{}
for _, filter := range filters {
resolved, _, err := app.Names.ResolveProject(cmd.Context(), strings.TrimSpace(filter))
if err != nil {
return err
}
id, err := strconv.ParseInt(resolved, 10, 64)
if err != nil || id <= 0 {
return output.ErrUsage("Invalid project ID")
}
opts.BucketIDs = append(opts.BucketIDs, id)
}

result, err := app.Account().Gauges().List(cmd.Context(), opts)
if err != nil {
return convertSDKError(err)
}
Expand All @@ -76,6 +126,8 @@ func newGaugesListCmd() *cobra.Command {
)
},
}
cmd.Flags().StringSliceVar(&projects, "projects", nil, "Filter by project IDs or names (comma-separated; repeatable)")
return cmd
}

func newGaugesNeedlesCmd(project *string) *cobra.Command {
Expand Down
83 changes: 83 additions & 0 deletions internal/commands/gauges_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package commands

import (
"net/http"
"strings"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

const gaugesPath = "/99999/reports/gauges.json"

func TestGaugesListProjectFilters(t *testing.T) {
cases := []struct {
name string
args []string
want string
}{
{"account-wide", nil, ""},
{"project", []string{"--project", "30"}, "30"},
{"in", []string{"--in", "30"}, "30"},
{"short", []string{"-p", "30"}, "30"},
{"name", []string{"--in", "Test Project"}, "123"},
{"ordered", []string{"--projects", "30,10", "--projects", "20"}, "30,10,20"},
{"mixed names and IDs", []string{"--projects", "30,Test Project,20"}, "30,123,20"},
{"parent flag", []string{"--in", "30", "list"}, "30"},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
app, transport := setupRecordingTestApp(t, projectsRoute(), stubRoute{
method: http.MethodGet, path: gaugesPath, status: http.StatusOK,
body: "[]",
})
app.Config.ProjectID = "999"
args := append([]string{"list"}, tc.args...)
if tc.name == "parent flag" {
args = tc.args
}
require.NoError(t, executeRecordingCommand(NewGaugesCmd(), app, args...))
queries := transport.queriesFor(gaugesPath)
require.Len(t, queries, 1)
values := queryValues(t, queries[0])
assert.Equal(t, tc.want, values.Get("bucket_ids"))
if tc.want == "" {
assert.NotContains(t, values, "bucket_ids")
} else {
assert.Len(t, values["bucket_ids"], 1)
}
})
}
}

func TestGaugesListInvalidProjectFilters(t *testing.T) {
cases := [][]string{
{"--projects", "30", "--in", "10"},
{"--projects", "30", "--project", "10"},
{"--projects", ""},
{"--projects", "30,,10"},
{"--in", ""},
{"--projects", "0"},
{"--projects", "-1"},
{"--projects", "9223372036854775808"},
{"--in", "Missing"},
}
for _, args := range cases {
t.Run(strings.Join(args, " "), func(t *testing.T) {
app, transport := setupRecordingTestApp(t, projectsRoute())
err := executeRecordingCommand(NewGaugesCmd(), app, append([]string{"list"}, args...)...)
require.Error(t, err)
assert.Empty(t, transport.queriesFor(gaugesPath))
})
}
}

func TestGaugesListGlobalProjectFilter(t *testing.T) {
app, transport := setupRecordingTestApp(t, stubRoute{
method: http.MethodGet, path: gaugesPath, status: http.StatusOK, body: "[]",
})
app.Flags.Project = "42"
require.NoError(t, executeRecordingCommand(NewGaugesCmd(), app, "list"))
assert.Equal(t, "42", queryValues(t, transport.queriesFor(gaugesPath)[0]).Get("bucket_ids"))
}
6 changes: 4 additions & 2 deletions internal/commands/reports.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ func newReportsOverdueCmd() *cobra.Command {
return &cobra.Command{
Use: "overdue",
Short: "View overdue todos grouped by lateness",
Long: `View all overdue todos grouped by how late they are.
Long: `View the first page of overdue todos grouped by how late they are.
In JSON output, data.meta.truncated indicates whether more pages exist
(meta.truncated in data-only --agent/--quiet output).

Todos are grouped into categories:
- Under a week late
Expand All @@ -195,7 +197,7 @@ Todos are grouped into categories:
return err
}

result, err := app.Account().Reports().OverdueTodos(cmd.Context())
result, err := app.Account().Reports().OverdueTodos(cmd.Context(), 0)
if err != nil {
return convertSDKError(err)
}
Expand Down
4 changes: 2 additions & 2 deletions internal/mcpserver/model/PROVENANCE.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"source": "github.com/basecamp/basecamp-sdk",
"commit": "867cdd87d0fbbefbad9fd99648002496c909c834",
"ref": "go/v0.36.0",
"commit": "da4686b0d61a088a86d203d038d8b53637e8efe4",
"ref": "go/v0.37.0",
"files": ["behavior-model.json", "openapi.json"],
"synced_by": "scripts/sync-mcp-model.sh",
"patches": "binary-upload operations dropped because the toolkit refuses their non-JSON bodies (EXCLUDED_OPERATIONS) and the stream-ticket mint dropped by policy (POLICY_EXCLUDED_OPERATIONS); no tag patches applied (PATCHED_TAGS is empty — the export tags every operation) — see the sync script"
Expand Down
52 changes: 51 additions & 1 deletion internal/mcpserver/model/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -23089,7 +23089,7 @@
},
"/{accountId}/reports/todos/overdue.json": {
"get": {
"description": "Get overdue todos grouped by lateness",
"description": "Get one page of overdue todos grouped by lateness, latest first.\n\nPages hold 15, 30, 50, then 100 to-dos, and each page fills the same four\ngroups with only its own to-dos, so a group can continue onto the next\npage. A `Link: rel=\"next\"` header names the next page and `X-Total-Count`\nthe total. This operation is not auto-paginated in any SDK: the response\nis an object of four arrays, which no pagination key can name.",
"operationId": "GetOverdueTodos",
"parameters": [
{
Expand All @@ -23102,6 +23102,16 @@
"description": "Basecamp account ID (numeric string)"
},
"required": true
},
{
"name": "page",
"in": "query",
"description": "Page number for paginating through results. Defaults to 1. This\noperation is not auto-paginated in any SDK, so a page is returned as\nasked for and later pages are not followed.",
"schema": {
"type": "integer",
"description": "Page number for paginating through results. Defaults to 1. This\noperation is not auto-paginated in any SDK, so a page is returned as\nasked for and later pages are not followed.",
"format": "int32"
}
}
],
"responses": {
Expand Down Expand Up @@ -33814,6 +33824,26 @@
},
"description": {
"type": "string"
},
"color": {
"type": "string",
"description": "The project's color, used for it on calendars: white, red, orange,\nyellow, green, blue, aqua, purple, gray, pink or brown. Omitted, Basecamp\nderives one from the project's name. Basecamp answers a value outside the enum\nwith a server error, not a validation error."
},
"purpose": {
"type": "string",
"description": "What kind of project it is: `topic` (a regular project, the default),\n`team`, or `company_hq` (the account's Company HQ, at most one per\naccount; a second answers 422). BC3's enum also has `guide`, which marks\na project as a sample nobody can edit afterwards, so it isn't offered."
},
"admissions": {
"type": "string",
"description": "invite|employee|team"
},
"timesheet_enabled": {
"type": "boolean",
"description": "Turn on the project's timesheet. Basecamp ignores this when the caller\ncan't use timesheets (the account lacks them, or the caller is a client)."
},
"wallpaper_mode": {
"type": "string",
"description": "How a wallpaper uploaded later is laid out. UpdateProjectWallpaper\nuploads one."
}
},
"required": [
Expand Down Expand Up @@ -38500,6 +38530,14 @@
"start_date": {
"type": "string",
"description": "Date the new project starts on. Template dates are relative to the start\nof the template's first week, and template weeks start on a Sunday, so\nthe project's dates are anchored to the Sunday on or before this date.\nOmitted, they are anchored to the week in which the construction is\nprocessed."
},
"admissions": {
"type": "string",
"description": "Who can join the new project: invite, employee or team. Basecamp stores this with the construction\nand applies it when the project is built, so a value outside the enum\nisn't refused up front: the construction fails."
},
"timesheet_enabled": {
"type": "boolean",
"description": "Turn on the new project's timesheet. Basecamp ignores this when the\ncaller can't use timesheets (the account lacks them, or the caller is a\nclient)."
}
},
"required": [
Expand Down Expand Up @@ -42270,6 +42308,18 @@
"wallpaper_mode": {
"type": "string",
"description": "How the project's wallpaper is laid out. Changes only the layout of a\nwallpaper already attached; UpdateProjectWallpaper uploads one."
},
"color": {
"type": "string",
"description": "The project's color, used for it on calendars: white, red, orange,\nyellow, green, blue, aqua, purple, gray, pink or brown. An empty string clears\nit, and Basecamp derives one from the project's name again. A value\noutside the enum answers a server error, not a validation error. The\n`color` a project read returns is something else: the caller's own color\nfor the project on their home screen, null unless they set one."
},
"purpose": {
"type": "string",
"description": "What kind of project it is: `topic` (a regular project), `team`, or\n`company_hq` (the account's Company HQ). Changing a `topic` to anything\nelse deletes the project's start and end dates. An account has at most\none `company_hq`; asking for a second answers 422. BC3's enum also has\n`guide`, which marks a project as a sample nobody can edit afterwards,\nso it isn't offered."
},
"timesheet_enabled": {
"type": "boolean",
"description": "Turn the project's timesheet on or off. Basecamp ignores this when the\ncaller can't use timesheets (the account lacks them, or the caller is a\nclient)."
}
},
"required": [
Expand Down
2 changes: 1 addition & 1 deletion internal/mcpserver/testdata/catalog_snapshot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ Call {"action": "describe", "params": {"action": "NAME"}} for an action's full p

ACTIONS (RO = read-only):
- get_assigned_todos (RO): Get todos assigned to a specific person
- get_overdue_todos (RO): Get overdue todos grouped by lateness
- get_overdue_todos (RO): Get one page of overdue todos grouped by lateness, latest first
- get_person_progress (RO, paginated): Get a person's activity timeline
- get_progress_report (RO, paginated): Get account-wide activity feed (progress report)
- get_project_timeline (RO, paginated): Get project timeline
Expand Down
6 changes: 3 additions & 3 deletions internal/version/sdk-provenance.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"sdk": {
"module": "github.com/basecamp/basecamp-sdk/go",
"version": "v0.36.0",
"revision": "867cdd87d0fb",
"updated_at": "2026-11-12T18:43:30Z"
"version": "v0.37.0",
"revision": "da4686b0d61a",
"updated_at": "2026-11-19T01:35:10Z"
},
"api": {
"repo": "basecamp/bc3",
Expand Down
2 changes: 1 addition & 1 deletion nix/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildGoModule.override { go = go_1_26; } (finalAttrs: {
src = lib.cleanSource ./..;

# To update: set to lib.fakeHash, run `nix build`, use the hash from the error.
vendorHash = "sha256-G4ZStXZ/h7D33tLkgna/3LkpCtLprYcsGWrtkkgg0OE=";
vendorHash = "sha256-pra9JQdNbQ/gvdQmdeS/QU+n7wqTND3BzVfmSJj+03k=";

subPackages = [ "cmd/basecamp" ];

Expand Down
Loading
Loading