Skip to content

Add --subscribe / --no-subscribe to recording creation commands#187

Merged
jeremy merged 3 commits intomainfrom
no-subscribers
Mar 4, 2026
Merged

Add --subscribe / --no-subscribe to recording creation commands#187
jeremy merged 3 commits intomainfrom
no-subscribers

Conversation

@jeremy
Copy link
Member

@jeremy jeremy commented Mar 4, 2026

Summary

  • Adds --subscribe / --no-subscribe flags to message, messages create, docs create, and schedule create
  • Controls who gets subscribed and notified at creation time, using the SDK's Subscriptions *[]int64 field
  • --subscribe accepts comma-separated names, emails, IDs, or "me" via the existing ResolvePerson infrastructure
  • --no-subscribe sends an empty subscriber list (nobody notified) — critical for bot/agent use cases
  • Explicit --subscribe "" is a hard error (detected via cmd.Flags().Changed), not a silent fallback to server default
  • Bumps SDK to v0.2.2 and syncs provenance

Test plan

  • make check passes (fmt, vet, lint, test, e2e, naming, surface, provenance, tidy)
  • CI: all 17 checks pass
  • Unit tests for applySubscribeFlags: mutual exclusion, no-subscribe, neither, explicit empty string, whitespace-only, comma-only
  • Command-level tests: flag presence on all four commands, mutual exclusion on messages (both entrypoints), empty-subscribe rejection on all four commands
  • Manual: basecamp message --subject "..." --no-subscribe --in <project> --json → 1 subscriber (creator only, server-enforced) vs 5 default
  • Manual: basecamp message --subject "..." --subscribe me --in <project> --json → 1 subscriber (Jeremy Daer)
  • Manual: basecamp message --subject "Bad" --subscribe me --no-subscribe → usage error: mutually exclusive

Closes #182

jeremy added 2 commits March 3, 2026 21:02
Picks up Subscriptions field on create request types
(CreateMessageRequest, CreateDocumentRequest, CreateScheduleEntryRequest).
Controls who gets subscribed and notified when creating messages, docs,
and schedule entries. Critical for bot/agent use cases that need silent
creation.

  --no-subscribe        subscribe nobody (no notifications)
  --subscribe "X,Y"     subscribe specific people (names, emails, IDs, "me")

Mutually exclusive. Neither flag preserves server default (everyone).
Explicit --subscribe with no resolvable people is a hard error, including
--subscribe "" (via cmd.Flags().Changed detection).

Available on: message, messages create, docs create, schedule create.

Closes #182
Copilot AI review requested due to automatic review settings March 4, 2026 05:03
@github-actions github-actions bot added commands CLI command implementations sdk SDK wrapper and provenance tests Tests (unit and e2e) docs deps enhancement New feature or request labels Mar 4, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds opt-in/opt-out subscription control to several “recording creation” CLI commands by wiring new flags into SDK request payloads, enabling silent/bot-friendly creates.

Changes:

  • Introduce --subscribe / --no-subscribe flags for message, document, and schedule-entry creation, mapping to the SDK Subscriptions *[]int64 field.
  • Add shared helper logic (applySubscribeFlags + token resolution) and unit tests for validation semantics (mutual exclusion, explicit empty).
  • Bump github.com/basecamp/basecamp-sdk/go to v0.2.2 and update provenance/docs.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/commands/helpers.go Adds resolvePersonIDs + applySubscribeFlags to interpret subscription flags and produce *[]int64 for SDK requests.
internal/commands/helpers_test.go Unit tests for applySubscribeFlags validation behavior (mutual exclusion, empty/whitespace/comma-only, no-subscribe).
internal/commands/messages.go Adds flags to messages create and message shortcut; sets CreateMessageRequest.Subscriptions.
internal/commands/messages_test.go Adds command-level tests for new flags and validation errors.
internal/commands/files.go Adds flags to files documents create; sets CreateDocumentRequest.Subscriptions.
internal/commands/files_test.go Adds command-level tests for docs create flag presence and validation errors.
internal/commands/schedule.go Adds flags to schedule create; sets CreateScheduleEntryRequest.Subscriptions.
internal/commands/schedule_test.go Adds command-level tests for schedule create flag presence and validation errors.
go.mod Bumps Basecamp Go SDK dependency to v0.2.2.
go.sum Updates sums for the SDK version bump.
internal/version/sdk-provenance.json Syncs SDK provenance metadata (version/revision/timestamp).
API-COVERAGE.md Notes new subscribe/no-subscribe support on relevant “create” commands.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Wrap ParseInt error in resolvePersonIDs for better diagnostics
- Add happy-path tests verifying --no-subscribe sends empty subscriptions
  array and default omits the field entirely
- Update --no-subscribe help text to "Don't subscribe anyone else" since
  the server always auto-subscribes the creator
@jeremy jeremy merged commit fea17f4 into main Mar 4, 2026
21 checks passed
@jeremy jeremy deleted the no-subscribers branch March 4, 2026 05:23
jeremy added a commit that referenced this pull request Mar 5, 2026
Add v0.2.2 features from PR #187 that were missing from the agent skill:
- Output modes: --md/-m, --styled, -v/-vv
- Quick reference: "Post silently" row
- Messages: --no-subscribe/--subscribe flags with examples
- Files & Documents: --no-subscribe example for doc create
- Schedule: --no-subscribe/--subscribe flags and example

Closes #189
@jeremy jeremy mentioned this pull request Mar 5, 2026
2 tasks
jeremy added a commit that referenced this pull request Mar 5, 2026
* Document --no-subscribe, --subscribe, and output mode flags in SKILL.md

Add v0.2.2 features from PR #187 that were missing from the agent skill:
- Output modes: --md/-m, --styled, -v/-vv
- Quick reference: "Post silently" row
- Messages: --no-subscribe/--subscribe flags with examples
- Files & Documents: --no-subscribe example for doc create
- Schedule: --no-subscribe/--subscribe flags and example

Closes #189

* Document config trust/untrust commands in SKILL.md

Add v0.2.2 feature from PR #181: config trust subsection explaining
authority key protection and trust/untrust commands.

* Add --markdown alias to output modes in SKILL.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands CLI command implementations deps docs enhancement New feature or request sdk SDK wrapper and provenance tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: --silent / --no-notify flag for message and comment creation

2 participants