diff --git a/.surface b/.surface index d6819f744..6fb3716b3 100644 --- a/.surface +++ b/.surface @@ -3132,9 +3132,11 @@ FLAG basecamp campfire update --cache-dir type=string FLAG basecamp campfire update --content type=string FLAG basecamp campfire update --content-type type=string FLAG basecamp campfire update --count type=bool +FLAG basecamp campfire update --force type=bool FLAG basecamp campfire update --help type=bool FLAG basecamp campfire update --hints type=bool FLAG basecamp campfire update --ids-only type=bool +FLAG basecamp campfire update --if-unmodified-since type=string FLAG basecamp campfire update --in type=string FLAG basecamp campfire update --jq type=string FLAG basecamp campfire update --json type=bool @@ -3924,10 +3926,12 @@ FLAG basecamp cards update --cache-dir type=string FLAG basecamp cards update --card-table type=string FLAG basecamp cards update --count type=bool FLAG basecamp cards update --due type=string +FLAG basecamp cards update --force type=bool FLAG basecamp cards update --format type=string FLAG basecamp cards update --help type=bool FLAG basecamp cards update --hints type=bool FLAG basecamp cards update --ids-only type=bool +FLAG basecamp cards update --if-unmodified-since type=string FLAG basecamp cards update --in type=string FLAG basecamp cards update --jq type=string FLAG basecamp cards update --json type=bool @@ -4271,9 +4275,11 @@ FLAG basecamp chat update --cache-dir type=string FLAG basecamp chat update --content type=string FLAG basecamp chat update --content-type type=string FLAG basecamp chat update --count type=bool +FLAG basecamp chat update --force type=bool FLAG basecamp chat update --help type=bool FLAG basecamp chat update --hints type=bool FLAG basecamp chat update --ids-only type=bool +FLAG basecamp chat update --if-unmodified-since type=string FLAG basecamp chat update --in type=string FLAG basecamp chat update --jq type=string FLAG basecamp chat update --json type=bool @@ -4412,10 +4418,12 @@ FLAG basecamp checkin answer update --account type=string FLAG basecamp checkin answer update --agent type=bool FLAG basecamp checkin answer update --cache-dir type=string FLAG basecamp checkin answer update --count type=bool +FLAG basecamp checkin answer update --force type=bool FLAG basecamp checkin answer update --format type=string FLAG basecamp checkin answer update --help type=bool FLAG basecamp checkin answer update --hints type=bool FLAG basecamp checkin answer update --ids-only type=bool +FLAG basecamp checkin answer update --if-unmodified-since type=string FLAG basecamp checkin answer update --in type=string FLAG basecamp checkin answer update --jq type=string FLAG basecamp checkin answer update --json type=bool @@ -4850,10 +4858,12 @@ FLAG basecamp checkins answer update --account type=string FLAG basecamp checkins answer update --agent type=bool FLAG basecamp checkins answer update --cache-dir type=string FLAG basecamp checkins answer update --count type=bool +FLAG basecamp checkins answer update --force type=bool FLAG basecamp checkins answer update --format type=string FLAG basecamp checkins answer update --help type=bool FLAG basecamp checkins answer update --hints type=bool FLAG basecamp checkins answer update --ids-only type=bool +FLAG basecamp checkins answer update --if-unmodified-since type=string FLAG basecamp checkins answer update --in type=string FLAG basecamp checkins answer update --jq type=string FLAG basecamp checkins answer update --json type=bool @@ -5410,10 +5420,12 @@ FLAG basecamp comments update --account type=string FLAG basecamp comments update --agent type=bool FLAG basecamp comments update --cache-dir type=string FLAG basecamp comments update --count type=bool +FLAG basecamp comments update --force type=bool FLAG basecamp comments update --format type=string FLAG basecamp comments update --help type=bool FLAG basecamp comments update --hints type=bool FLAG basecamp comments update --ids-only type=bool +FLAG basecamp comments update --if-unmodified-since type=string FLAG basecamp comments update --in type=string FLAG basecamp comments update --jq type=string FLAG basecamp comments update --json type=bool @@ -6300,10 +6312,12 @@ FLAG basecamp docs new-version --cache-dir type=string FLAG basecamp docs new-version --count type=bool FLAG basecamp docs new-version --description type=string FLAG basecamp docs new-version --folder type=string +FLAG basecamp docs new-version --force type=bool FLAG basecamp docs new-version --format type=string FLAG basecamp docs new-version --help type=bool FLAG basecamp docs new-version --hints type=bool FLAG basecamp docs new-version --ids-only type=bool +FLAG basecamp docs new-version --if-unmodified-since type=string FLAG basecamp docs new-version --in type=string FLAG basecamp docs new-version --jq type=string FLAG basecamp docs new-version --json type=bool @@ -6326,10 +6340,12 @@ FLAG basecamp docs replace --cache-dir type=string FLAG basecamp docs replace --count type=bool FLAG basecamp docs replace --description type=string FLAG basecamp docs replace --folder type=string +FLAG basecamp docs replace --force type=bool FLAG basecamp docs replace --format type=string FLAG basecamp docs replace --help type=bool FLAG basecamp docs replace --hints type=bool FLAG basecamp docs replace --ids-only type=bool +FLAG basecamp docs replace --if-unmodified-since type=string FLAG basecamp docs replace --in type=string FLAG basecamp docs replace --jq type=string FLAG basecamp docs replace --json type=bool @@ -6425,10 +6441,12 @@ FLAG basecamp docs update --cache-dir type=string FLAG basecamp docs update --content type=string FLAG basecamp docs update --count type=bool FLAG basecamp docs update --folder type=string +FLAG basecamp docs update --force type=bool FLAG basecamp docs update --format type=string FLAG basecamp docs update --help type=bool FLAG basecamp docs update --hints type=bool FLAG basecamp docs update --ids-only type=bool +FLAG basecamp docs update --if-unmodified-since type=string FLAG basecamp docs update --in type=string FLAG basecamp docs update --jq type=string FLAG basecamp docs update --json type=bool @@ -7351,10 +7369,12 @@ FLAG basecamp documents new-version --cache-dir type=string FLAG basecamp documents new-version --count type=bool FLAG basecamp documents new-version --description type=string FLAG basecamp documents new-version --folder type=string +FLAG basecamp documents new-version --force type=bool FLAG basecamp documents new-version --format type=string FLAG basecamp documents new-version --help type=bool FLAG basecamp documents new-version --hints type=bool FLAG basecamp documents new-version --ids-only type=bool +FLAG basecamp documents new-version --if-unmodified-since type=string FLAG basecamp documents new-version --in type=string FLAG basecamp documents new-version --jq type=string FLAG basecamp documents new-version --json type=bool @@ -7377,10 +7397,12 @@ FLAG basecamp documents replace --cache-dir type=string FLAG basecamp documents replace --count type=bool FLAG basecamp documents replace --description type=string FLAG basecamp documents replace --folder type=string +FLAG basecamp documents replace --force type=bool FLAG basecamp documents replace --format type=string FLAG basecamp documents replace --help type=bool FLAG basecamp documents replace --hints type=bool FLAG basecamp documents replace --ids-only type=bool +FLAG basecamp documents replace --if-unmodified-since type=string FLAG basecamp documents replace --in type=string FLAG basecamp documents replace --jq type=string FLAG basecamp documents replace --json type=bool @@ -7476,10 +7498,12 @@ FLAG basecamp documents update --cache-dir type=string FLAG basecamp documents update --content type=string FLAG basecamp documents update --count type=bool FLAG basecamp documents update --folder type=string +FLAG basecamp documents update --force type=bool FLAG basecamp documents update --format type=string FLAG basecamp documents update --help type=bool FLAG basecamp documents update --hints type=bool FLAG basecamp documents update --ids-only type=bool +FLAG basecamp documents update --if-unmodified-since type=string FLAG basecamp documents update --in type=string FLAG basecamp documents update --jq type=string FLAG basecamp documents update --json type=bool @@ -7945,10 +7969,12 @@ FLAG basecamp doors update --agent type=bool FLAG basecamp doors update --cache-dir type=string FLAG basecamp doors update --count type=bool FLAG basecamp doors update --description type=string +FLAG basecamp doors update --force type=bool FLAG basecamp doors update --format type=string FLAG basecamp doors update --help type=bool FLAG basecamp doors update --hints type=bool FLAG basecamp doors update --ids-only type=bool +FLAG basecamp doors update --if-unmodified-since type=string FLAG basecamp doors update --in type=string FLAG basecamp doors update --jq type=string FLAG basecamp doors update --json type=bool @@ -8268,10 +8294,12 @@ FLAG basecamp external-links update --agent type=bool FLAG basecamp external-links update --cache-dir type=string FLAG basecamp external-links update --count type=bool FLAG basecamp external-links update --description type=string +FLAG basecamp external-links update --force type=bool FLAG basecamp external-links update --format type=string FLAG basecamp external-links update --help type=bool FLAG basecamp external-links update --hints type=bool FLAG basecamp external-links update --ids-only type=bool +FLAG basecamp external-links update --if-unmodified-since type=string FLAG basecamp external-links update --in type=string FLAG basecamp external-links update --jq type=string FLAG basecamp external-links update --json type=bool @@ -8842,10 +8870,12 @@ FLAG basecamp file new-version --cache-dir type=string FLAG basecamp file new-version --count type=bool FLAG basecamp file new-version --description type=string FLAG basecamp file new-version --folder type=string +FLAG basecamp file new-version --force type=bool FLAG basecamp file new-version --format type=string FLAG basecamp file new-version --help type=bool FLAG basecamp file new-version --hints type=bool FLAG basecamp file new-version --ids-only type=bool +FLAG basecamp file new-version --if-unmodified-since type=string FLAG basecamp file new-version --in type=string FLAG basecamp file new-version --jq type=string FLAG basecamp file new-version --json type=bool @@ -8868,10 +8898,12 @@ FLAG basecamp file replace --cache-dir type=string FLAG basecamp file replace --count type=bool FLAG basecamp file replace --description type=string FLAG basecamp file replace --folder type=string +FLAG basecamp file replace --force type=bool FLAG basecamp file replace --format type=string FLAG basecamp file replace --help type=bool FLAG basecamp file replace --hints type=bool FLAG basecamp file replace --ids-only type=bool +FLAG basecamp file replace --if-unmodified-since type=string FLAG basecamp file replace --in type=string FLAG basecamp file replace --jq type=string FLAG basecamp file replace --json type=bool @@ -8967,10 +8999,12 @@ FLAG basecamp file update --cache-dir type=string FLAG basecamp file update --content type=string FLAG basecamp file update --count type=bool FLAG basecamp file update --folder type=string +FLAG basecamp file update --force type=bool FLAG basecamp file update --format type=string FLAG basecamp file update --help type=bool FLAG basecamp file update --hints type=bool FLAG basecamp file update --ids-only type=bool +FLAG basecamp file update --if-unmodified-since type=string FLAG basecamp file update --in type=string FLAG basecamp file update --jq type=string FLAG basecamp file update --json type=bool @@ -9872,10 +9906,12 @@ FLAG basecamp files new-version --cache-dir type=string FLAG basecamp files new-version --count type=bool FLAG basecamp files new-version --description type=string FLAG basecamp files new-version --folder type=string +FLAG basecamp files new-version --force type=bool FLAG basecamp files new-version --format type=string FLAG basecamp files new-version --help type=bool FLAG basecamp files new-version --hints type=bool FLAG basecamp files new-version --ids-only type=bool +FLAG basecamp files new-version --if-unmodified-since type=string FLAG basecamp files new-version --in type=string FLAG basecamp files new-version --jq type=string FLAG basecamp files new-version --json type=bool @@ -9898,10 +9934,12 @@ FLAG basecamp files replace --cache-dir type=string FLAG basecamp files replace --count type=bool FLAG basecamp files replace --description type=string FLAG basecamp files replace --folder type=string +FLAG basecamp files replace --force type=bool FLAG basecamp files replace --format type=string FLAG basecamp files replace --help type=bool FLAG basecamp files replace --hints type=bool FLAG basecamp files replace --ids-only type=bool +FLAG basecamp files replace --if-unmodified-since type=string FLAG basecamp files replace --in type=string FLAG basecamp files replace --jq type=string FLAG basecamp files replace --json type=bool @@ -9997,10 +10035,12 @@ FLAG basecamp files update --cache-dir type=string FLAG basecamp files update --content type=string FLAG basecamp files update --count type=bool FLAG basecamp files update --folder type=string +FLAG basecamp files update --force type=bool FLAG basecamp files update --format type=string FLAG basecamp files update --help type=bool FLAG basecamp files update --hints type=bool FLAG basecamp files update --ids-only type=bool +FLAG basecamp files update --if-unmodified-since type=string FLAG basecamp files update --in type=string FLAG basecamp files update --jq type=string FLAG basecamp files update --json type=bool @@ -10944,10 +10984,12 @@ FLAG basecamp folders new-version --cache-dir type=string FLAG basecamp folders new-version --count type=bool FLAG basecamp folders new-version --description type=string FLAG basecamp folders new-version --folder type=string +FLAG basecamp folders new-version --force type=bool FLAG basecamp folders new-version --format type=string FLAG basecamp folders new-version --help type=bool FLAG basecamp folders new-version --hints type=bool FLAG basecamp folders new-version --ids-only type=bool +FLAG basecamp folders new-version --if-unmodified-since type=string FLAG basecamp folders new-version --in type=string FLAG basecamp folders new-version --jq type=string FLAG basecamp folders new-version --json type=bool @@ -10970,10 +11012,12 @@ FLAG basecamp folders replace --cache-dir type=string FLAG basecamp folders replace --count type=bool FLAG basecamp folders replace --description type=string FLAG basecamp folders replace --folder type=string +FLAG basecamp folders replace --force type=bool FLAG basecamp folders replace --format type=string FLAG basecamp folders replace --help type=bool FLAG basecamp folders replace --hints type=bool FLAG basecamp folders replace --ids-only type=bool +FLAG basecamp folders replace --if-unmodified-since type=string FLAG basecamp folders replace --in type=string FLAG basecamp folders replace --jq type=string FLAG basecamp folders replace --json type=bool @@ -11069,10 +11113,12 @@ FLAG basecamp folders update --cache-dir type=string FLAG basecamp folders update --content type=string FLAG basecamp folders update --count type=bool FLAG basecamp folders update --folder type=string +FLAG basecamp folders update --force type=bool FLAG basecamp folders update --format type=string FLAG basecamp folders update --help type=bool FLAG basecamp folders update --hints type=bool FLAG basecamp folders update --ids-only type=bool +FLAG basecamp folders update --if-unmodified-since type=string FLAG basecamp folders update --in type=string FLAG basecamp folders update --jq type=string FLAG basecamp folders update --json type=bool @@ -11791,9 +11837,11 @@ FLAG basecamp gauges update --agent type=bool FLAG basecamp gauges update --cache-dir type=string FLAG basecamp gauges update --count type=bool FLAG basecamp gauges update --description type=string +FLAG basecamp gauges update --force type=bool FLAG basecamp gauges update --help type=bool FLAG basecamp gauges update --hints type=bool FLAG basecamp gauges update --ids-only type=bool +FLAG basecamp gauges update --if-unmodified-since type=string FLAG basecamp gauges update --in type=string FLAG basecamp gauges update --jq type=string FLAG basecamp gauges update --json type=bool @@ -12603,10 +12651,12 @@ FLAG basecamp messages update --body type=string FLAG basecamp messages update --cache-dir type=string FLAG basecamp messages update --category type=string FLAG basecamp messages update --count type=bool +FLAG basecamp messages update --force type=bool FLAG basecamp messages update --format type=string FLAG basecamp messages update --help type=bool FLAG basecamp messages update --hints type=bool FLAG basecamp messages update --ids-only type=bool +FLAG basecamp messages update --if-unmodified-since type=string FLAG basecamp messages update --in type=string FLAG basecamp messages update --jq type=string FLAG basecamp messages update --json type=bool @@ -13069,10 +13119,12 @@ FLAG basecamp msgs update --body type=string FLAG basecamp msgs update --cache-dir type=string FLAG basecamp msgs update --category type=string FLAG basecamp msgs update --count type=bool +FLAG basecamp msgs update --force type=bool FLAG basecamp msgs update --format type=string FLAG basecamp msgs update --help type=bool FLAG basecamp msgs update --hints type=bool FLAG basecamp msgs update --ids-only type=bool +FLAG basecamp msgs update --if-unmodified-since type=string FLAG basecamp msgs update --in type=string FLAG basecamp msgs update --jq type=string FLAG basecamp msgs update --json type=bool @@ -13116,10 +13168,12 @@ FLAG basecamp notes set --agent type=bool FLAG basecamp notes set --cache-dir type=string FLAG basecamp notes set --count type=bool FLAG basecamp notes set --file type=string +FLAG basecamp notes set --force type=bool FLAG basecamp notes set --format type=string FLAG basecamp notes set --help type=bool FLAG basecamp notes set --hints type=bool FLAG basecamp notes set --ids-only type=bool +FLAG basecamp notes set --if-unmodified-since type=string FLAG basecamp notes set --in type=string FLAG basecamp notes set --jq type=string FLAG basecamp notes set --json type=bool @@ -14281,9 +14335,11 @@ FLAG basecamp project update --agent type=bool FLAG basecamp project update --cache-dir type=string FLAG basecamp project update --count type=bool FLAG basecamp project update --description type=string +FLAG basecamp project update --force type=bool FLAG basecamp project update --help type=bool FLAG basecamp project update --hints type=bool FLAG basecamp project update --ids-only type=bool +FLAG basecamp project update --if-unmodified-since type=string FLAG basecamp project update --in type=string FLAG basecamp project update --jq type=string FLAG basecamp project update --json type=bool @@ -14586,9 +14642,11 @@ FLAG basecamp projects update --agent type=bool FLAG basecamp projects update --cache-dir type=string FLAG basecamp projects update --count type=bool FLAG basecamp projects update --description type=string +FLAG basecamp projects update --force type=bool FLAG basecamp projects update --help type=bool FLAG basecamp projects update --hints type=bool FLAG basecamp projects update --ids-only type=bool +FLAG basecamp projects update --if-unmodified-since type=string FLAG basecamp projects update --in type=string FLAG basecamp projects update --jq type=string FLAG basecamp projects update --json type=bool @@ -15250,10 +15308,12 @@ FLAG basecamp schedule update --desc type=string FLAG basecamp schedule update --description type=string FLAG basecamp schedule update --end type=string FLAG basecamp schedule update --ends-at type=string +FLAG basecamp schedule update --force type=bool FLAG basecamp schedule update --format type=string FLAG basecamp schedule update --help type=bool FLAG basecamp schedule update --hints type=bool FLAG basecamp schedule update --ids-only type=bool +FLAG basecamp schedule update --if-unmodified-since type=string FLAG basecamp schedule update --in type=string FLAG basecamp schedule update --jq type=string FLAG basecamp schedule update --json type=bool @@ -16099,9 +16159,11 @@ FLAG basecamp templates update --cache-dir type=string FLAG basecamp templates update --count type=bool FLAG basecamp templates update --desc type=string FLAG basecamp templates update --description type=string +FLAG basecamp templates update --force type=bool FLAG basecamp templates update --help type=bool FLAG basecamp templates update --hints type=bool FLAG basecamp templates update --ids-only type=bool +FLAG basecamp templates update --if-unmodified-since type=string FLAG basecamp templates update --in type=string FLAG basecamp templates update --jq type=string FLAG basecamp templates update --json type=bool @@ -16283,11 +16345,13 @@ FLAG basecamp timesheet entry update --count type=bool FLAG basecamp timesheet entry update --date type=string FLAG basecamp timesheet entry update --description type=string FLAG basecamp timesheet entry update --end type=string +FLAG basecamp timesheet entry update --force type=bool FLAG basecamp timesheet entry update --from type=string FLAG basecamp timesheet entry update --help type=bool FLAG basecamp timesheet entry update --hints type=bool FLAG basecamp timesheet entry update --hours type=string FLAG basecamp timesheet entry update --ids-only type=bool +FLAG basecamp timesheet entry update --if-unmodified-since type=string FLAG basecamp timesheet entry update --in type=string FLAG basecamp timesheet entry update --jq type=string FLAG basecamp timesheet entry update --json type=bool @@ -17101,9 +17165,11 @@ FLAG basecamp todolist update --agent type=bool FLAG basecamp todolist update --cache-dir type=string FLAG basecamp todolist update --count type=bool FLAG basecamp todolist update --description type=string +FLAG basecamp todolist update --force type=bool FLAG basecamp todolist update --help type=bool FLAG basecamp todolist update --hints type=bool FLAG basecamp todolist update --ids-only type=bool +FLAG basecamp todolist update --if-unmodified-since type=string FLAG basecamp todolist update --in type=string FLAG basecamp todolist update --jq type=string FLAG basecamp todolist update --json type=bool @@ -17811,9 +17877,11 @@ FLAG basecamp todolists update --agent type=bool FLAG basecamp todolists update --cache-dir type=string FLAG basecamp todolists update --count type=bool FLAG basecamp todolists update --description type=string +FLAG basecamp todolists update --force type=bool FLAG basecamp todolists update --help type=bool FLAG basecamp todolists update --hints type=bool FLAG basecamp todolists update --ids-only type=bool +FLAG basecamp todolists update --if-unmodified-since type=string FLAG basecamp todolists update --in type=string FLAG basecamp todolists update --jq type=string FLAG basecamp todolists update --json type=bool @@ -18206,10 +18274,12 @@ FLAG basecamp todos update --cache-dir type=string FLAG basecamp todos update --count type=bool FLAG basecamp todos update --description type=string FLAG basecamp todos update --due type=string +FLAG basecamp todos update --force type=bool FLAG basecamp todos update --format type=string FLAG basecamp todos update --help type=bool FLAG basecamp todos update --hints type=bool FLAG basecamp todos update --ids-only type=bool +FLAG basecamp todos update --if-unmodified-since type=string FLAG basecamp todos update --in type=string FLAG basecamp todos update --jq type=string FLAG basecamp todos update --json type=bool @@ -19399,10 +19469,12 @@ FLAG basecamp vault new-version --cache-dir type=string FLAG basecamp vault new-version --count type=bool FLAG basecamp vault new-version --description type=string FLAG basecamp vault new-version --folder type=string +FLAG basecamp vault new-version --force type=bool FLAG basecamp vault new-version --format type=string FLAG basecamp vault new-version --help type=bool FLAG basecamp vault new-version --hints type=bool FLAG basecamp vault new-version --ids-only type=bool +FLAG basecamp vault new-version --if-unmodified-since type=string FLAG basecamp vault new-version --in type=string FLAG basecamp vault new-version --jq type=string FLAG basecamp vault new-version --json type=bool @@ -19425,10 +19497,12 @@ FLAG basecamp vault replace --cache-dir type=string FLAG basecamp vault replace --count type=bool FLAG basecamp vault replace --description type=string FLAG basecamp vault replace --folder type=string +FLAG basecamp vault replace --force type=bool FLAG basecamp vault replace --format type=string FLAG basecamp vault replace --help type=bool FLAG basecamp vault replace --hints type=bool FLAG basecamp vault replace --ids-only type=bool +FLAG basecamp vault replace --if-unmodified-since type=string FLAG basecamp vault replace --in type=string FLAG basecamp vault replace --jq type=string FLAG basecamp vault replace --json type=bool @@ -19524,10 +19598,12 @@ FLAG basecamp vault update --cache-dir type=string FLAG basecamp vault update --content type=string FLAG basecamp vault update --count type=bool FLAG basecamp vault update --folder type=string +FLAG basecamp vault update --force type=bool FLAG basecamp vault update --format type=string FLAG basecamp vault update --help type=bool FLAG basecamp vault update --hints type=bool FLAG basecamp vault update --ids-only type=bool +FLAG basecamp vault update --if-unmodified-since type=string FLAG basecamp vault update --in type=string FLAG basecamp vault update --jq type=string FLAG basecamp vault update --json type=bool @@ -20429,10 +20505,12 @@ FLAG basecamp vaults new-version --cache-dir type=string FLAG basecamp vaults new-version --count type=bool FLAG basecamp vaults new-version --description type=string FLAG basecamp vaults new-version --folder type=string +FLAG basecamp vaults new-version --force type=bool FLAG basecamp vaults new-version --format type=string FLAG basecamp vaults new-version --help type=bool FLAG basecamp vaults new-version --hints type=bool FLAG basecamp vaults new-version --ids-only type=bool +FLAG basecamp vaults new-version --if-unmodified-since type=string FLAG basecamp vaults new-version --in type=string FLAG basecamp vaults new-version --jq type=string FLAG basecamp vaults new-version --json type=bool @@ -20455,10 +20533,12 @@ FLAG basecamp vaults replace --cache-dir type=string FLAG basecamp vaults replace --count type=bool FLAG basecamp vaults replace --description type=string FLAG basecamp vaults replace --folder type=string +FLAG basecamp vaults replace --force type=bool FLAG basecamp vaults replace --format type=string FLAG basecamp vaults replace --help type=bool FLAG basecamp vaults replace --hints type=bool FLAG basecamp vaults replace --ids-only type=bool +FLAG basecamp vaults replace --if-unmodified-since type=string FLAG basecamp vaults replace --in type=string FLAG basecamp vaults replace --jq type=string FLAG basecamp vaults replace --json type=bool @@ -20554,10 +20634,12 @@ FLAG basecamp vaults update --cache-dir type=string FLAG basecamp vaults update --content type=string FLAG basecamp vaults update --count type=bool FLAG basecamp vaults update --folder type=string +FLAG basecamp vaults update --force type=bool FLAG basecamp vaults update --format type=string FLAG basecamp vaults update --help type=bool FLAG basecamp vaults update --hints type=bool FLAG basecamp vaults update --ids-only type=bool +FLAG basecamp vaults update --if-unmodified-since type=string FLAG basecamp vaults update --in type=string FLAG basecamp vaults update --jq type=string FLAG basecamp vaults update --json type=bool diff --git a/docs/body-conflict-guard.md b/docs/body-conflict-guard.md new file mode 100644 index 000000000..420dcc677 --- /dev/null +++ b/docs/body-conflict-guard.md @@ -0,0 +1,45 @@ +# Opt-in conflict checks for replacements + +Fetch the record before preparing an edit. Keep the `updated_at` from the representation actually used, then pass it unchanged as `--if-unmodified-since ` to the typed command. Do not fetch a new timestamp merely to make an old replacement pass. + +```sh +basecamp comments show 789 --json +basecamp comments update 789 - --if-unmodified-since '2026-11-08T18:10:58.123Z' --json < revised.md +``` + +The baseline is optional. **Without it, including the first write from this CLI, current unprotected behavior is unchanged.** There is no automatic first-use protection, remembered read version, or local ledger. + +With a baseline the CLI performs a server-revalidated GET and requires equal parsed timestamp instants, not equal text spellings. Equivalent UTC offsets compare equal; different fractional seconds or a future baseline do not. Equality is deliberately conservative: an unrelated field change can also refuse a body edit. Invalid/zero input, missing/zero/unparseable live timestamps, and failed reads refuse without uploading attachments or mutating the target. `--force` overrides only a version mismatch; it does not waive invalid input or unavailable live state. `--force` requires a baseline. + +Re-fetch and reconcile on conflict. Only deliberately use `--force` with the supplied baseline when you intend to overwrite intervening changes. A creator is not necessarily the latest editor; the CLI does not invent an editor identity. + +## Exact command coverage + +These commands accept the opt-in, **whole-record** version check, including their non-body edits. Guard flags on a title-only edit therefore check that record's version rather than being ignored: + +- `comments update` +- `messages update` +- `todos update` (description changes/clears and every other update through this command) +- `cards update` (including attachment-only replacements) +- `todolists update` +- `schedule update` (including attachment-only updates) +- `checkins answer update` +- `chat update` (including a Ping line addressed through this command) +- `files update` (document/upload/vault, explicit type or autodetection, including title-only document writes and explicit clears) +- `files replace` (including description replacements/clears and file-only replacements) +- `doors update` (including description replacements/clears) +- `projects update` +- `templates update` +- `notes set` (an unwritten note has no version and refuses a supplied baseline) +- `gauges update` +- `timesheet entry update` + +The `files update` and `files replace` guards also apply through the file-group aliases: `file`, `docs`, `documents`, `vaults`, `vault`, and `folders`. + +The guard is **not global middleware**. Raw `api put`, MCP/TUI and SDK callers, creation commands, other commands that carry a preserved body (for example to-do assignment operations), and other update verbs do not gain protection. **Boost editing is explicitly excluded from this first opt-in safeguard.** `boost update` continues to replace content without this protection and does not accept these guard flags. SDK go/v0.35.0 exposes only `created_at`, not `updated_at`, on Boost; the API representation likewise omits `updated_at`. An ETag is a different baseline contract and is not substituted here. Do not substitute creation time or a parent recording's timestamp. Boost editing is unchanged; adding its version support is separate work. Never treat unguarded paths as protected merely because a guarded typed command exists. Use guarded typed commands for body edits rather than bypassing them with raw API writes. + +## Limits + +The timestamp is an API-supplied record version signal, not a cryptographic or necessarily unique per-edit token. SDK HTTP cache hits still contact the server for validation; they do not supply an acknowledged caller baseline. + +**GET then PUT is not atomic.** An edit after the guard's GET can still be overwritten. Some SDK composite updates (notably to-dos and documents) perform another GET and send the full writable representation; this neither removes the race nor protects other command paths automatically. No conditional-write support or server changes are implied by the flag name. Ledger, append mode, default protection and server atomicity are separate features, not part of this change. diff --git a/e2e/smoke/smoke_comments.bats b/e2e/smoke/smoke_comments.bats index 37f488760..246540704 100644 --- a/e2e/smoke/smoke_comments.bats +++ b/e2e/smoke/smoke_comments.bats @@ -110,6 +110,49 @@ setup_file() { assert_json_value '.ok' 'true' } +@test "comments guarded replacement refuses stale versions before writing" { + local todo_out todo_id comment_out comment_id baseline unchanged + todo_out=$(basecamp todos create "Guard target $(date +%s)" --list "$QA_TODOLIST" -p "$QA_PROJECT" --json) + todo_id=$(echo "$todo_out" | jq -r '.data.id // empty') + [[ -n "$todo_id" ]] || fail "No synthetic target returned" + comment_out=$(basecamp comments create "$todo_id" "Original synthetic comment" -p "$QA_PROJECT" --json) + comment_id=$(echo "$comment_out" | jq -r '.data.id // empty') + baseline=$(echo "$comment_out" | jq -r '.data.updated_at // empty') + [[ -n "$comment_id" && -n "$baseline" ]] || fail "Missing comment/version" + + run_smoke basecamp comments update "$comment_id" "Matching version writes" \ + --if-unmodified-since "$baseline" -p "$QA_PROJECT" --json + assert_success + assert_json_value '.ok' 'true' + run_smoke basecamp comments show "$comment_id" -p "$QA_PROJECT" --json + assert_success + assert_json_value '.ok' 'true' + assert_json_not_null '.data.content' + assert_json_not_null '.data.updated_at' + unchanged=$(echo "$output" | jq -c '.data | {content,updated_at}') + + run_smoke basecamp comments update "$comment_id" "Must not replace human text" \ + --if-unmodified-since '2000-01-01T00:00:00Z' -p "$QA_PROJECT" --json + assert_failure + assert_json_value '.ok' 'false' + assert_json_value '.error | contains("update conflict")' 'true' + run_smoke basecamp comments show "$comment_id" -p "$QA_PROJECT" --json + assert_success + assert_json_value '.ok' 'true' + assert_json_not_null '.data.content' + assert_json_not_null '.data.updated_at' + [[ "$(echo "$output" | jq -c '.data | {content,updated_at}')" == "$unchanged" ]] || fail "Refusal changed the comment" + + run_smoke basecamp comments update "$comment_id" "Explicit override writes" \ + --if-unmodified-since '2000-01-01T00:00:00Z' --force -p "$QA_PROJECT" --json + assert_success + assert_json_value '.ok' 'true' + run_smoke basecamp comments show "$comment_id" -p "$QA_PROJECT" --json + assert_success + assert_json_value '.ok' 'true' + assert_json_value '.data.content | contains("Explicit override writes")' 'true' +} + @test "comments trash trashes a comment" { local id_file="$BATS_FILE_TMPDIR/direct_comment_id" [[ -f "$id_file" ]] || mark_unverifiable "No comment created in prior test" diff --git a/internal/commands/body_guard.go b/internal/commands/body_guard.go new file mode 100644 index 000000000..cc01fd6a4 --- /dev/null +++ b/internal/commands/body_guard.go @@ -0,0 +1,54 @@ +package commands + +import ( + "fmt" + "time" + + "github.com/spf13/cobra" + + "github.com/basecamp/basecamp-cli/internal/output" +) + +// The timestamp belongs to the record the caller used to prepare the replacement, +// not a fresh read performed merely to make an old body pass. +func addBodyGuardFlags(cmd *cobra.Command) { + cmd.Flags().String("if-unmodified-since", "", "Require the record's last-seen updated_at (RFC3339); no baseline means no conflict protection") + cmd.Flags().Bool("force", false, "Override a version conflict with --if-unmodified-since (not invalid or missing timestamps)") + cmd.Long += "\n\nOptional conflict guard: pass the updated_at from the record used to prepare your edit\nwith --if-unmodified-since. This checks the whole record, including non-body edits\nthrough this command. A different live timestamp refuses before uploads or writes;\n--force explicitly overrides a conflict. Invalid or missing timestamps still refuse.\nWithout a baseline, including first use, writes remain unprotected. The live GET is\nserver-revalidated, but GET then PUT is not atomic: edits in between can still be lost." + run := cmd.RunE + cmd.RunE = func(cmd *cobra.Command, args []string) error { + if cmd.Flags().Changed("if-unmodified-since") { + value, _ := cmd.Flags().GetString("if-unmodified-since") + baseline, err := time.Parse(time.RFC3339Nano, value) + if err != nil || baseline.IsZero() { + return output.ErrUsage("--if-unmodified-since requires a nonzero RFC3339 updated_at timestamp") + } + } else if cmd.Flags().Changed("force") { + return output.ErrUsage("--force requires --if-unmodified-since; without a baseline updates are already unprotected") + } + return run(cmd, args) + } +} + +func checkBodyUpdate(cmd *cobra.Command, fetch func() (time.Time, error)) error { + if !cmd.Flags().Changed("if-unmodified-since") { + return nil + } + value, _ := cmd.Flags().GetString("if-unmodified-since") + baseline, err := time.Parse(time.RFC3339Nano, value) + if err != nil || baseline.IsZero() { + return output.ErrUsage("--if-unmodified-since requires a nonzero RFC3339 updated_at timestamp") + } + live, err := fetch() + if err != nil { + return convertSDKError(err) + } + if live.IsZero() { + return fmt.Errorf("cannot verify updated_at: live timestamp is missing; refusing update") + } + force, _ := cmd.Flags().GetBool("force") + if !live.Equal(baseline) && !force { + return fmt.Errorf("update conflict: live updated_at %s differs from your last read %s; re-fetch and reconcile, or pass --force to overwrite (GET then PUT is not atomic)", live.Format(time.RFC3339Nano), baseline.Format(time.RFC3339Nano)) + } + return nil +} diff --git a/internal/commands/body_guard_test.go b/internal/commands/body_guard_test.go new file mode 100644 index 000000000..c08f23578 --- /dev/null +++ b/internal/commands/body_guard_test.go @@ -0,0 +1,246 @@ +package commands + +import ( + "fmt" + "io" + "net/http" + "strings" + "testing" + + "github.com/spf13/cobra" + "github.com/stretchr/testify/require" +) + +type bodyGuardTransport struct { + live string + writes int + gets int + getStatus int + detectedType string + emptyRecord bool + paths []string +} + +func (tr *bodyGuardTransport) RoundTrip(r *http.Request) (*http.Response, error) { + if r.Method != http.MethodGet { + tr.writes++ + } else { + tr.gets++ + } + status := http.StatusOK + if r.Method == http.MethodGet { + tr.paths = append(tr.paths, r.URL.Path) + if tr.getStatus != 0 { + status = tr.getStatus + } else if tr.detectedType != "" { + if strings.Contains(r.URL.Path, "/documents/") || (tr.detectedType == "upload" && strings.Contains(r.URL.Path, "/vaults/")) { + status = http.StatusNotFound + } + } + } + body := fmt.Sprintf(`{"id":789,"name":"Synthetic","title":"Synthetic","subject":"Synthetic","content":"preserved human body","description":"preserved human body","updated_at":%s,"completion_subscribers":[],"assignees":[]}`, tr.live) + if r.Method == http.MethodGet && tr.emptyRecord { + body = "null" + } + return &http.Response{StatusCode: status, Header: http.Header{"Content-Type": []string{"application/json"}}, Body: io.NopCloser(strings.NewReader(body)), Request: r}, nil +} + +func bodyGuardCommands() []struct { + name string + newCmd func() *cobra.Command + args []string +} { + project, room, contentType := "123", "456", "text/plain" + return []struct { + name string + newCmd func() *cobra.Command + args []string + }{ + {"comments", newCommentsUpdateCmd, []string{"789", "replacement ![image](./does-not-exist.png)"}}, + {"messages", newMessagesUpdateCmd, []string{"789", "--body", "replacement ![image](./does-not-exist.png)"}}, + {"todos", newTodosUpdateCmd, []string{"789", "--description", "replacement ![image](./does-not-exist.png)"}}, + {"cards", newCardsUpdateCmd, []string{"789", "--body", "replacement ![image](./does-not-exist.png)"}}, + {"todolists", func() *cobra.Command { return newTodolistsUpdateCmd(&project) }, []string{"789", "--description", "replacement"}}, + {"schedule", func() *cobra.Command { return newScheduleUpdateCmd(&project) }, []string{"789", "--description", "replacement ![image](./does-not-exist.png)"}}, + {"answers", func() *cobra.Command { return newCheckinsAnswerUpdateCmd(&project) }, []string{"789", "replacement ![image](./does-not-exist.png)"}}, + {"chat", func() *cobra.Command { return newChatLineUpdateCmd(&project, &room, &contentType) }, []string{"789", "replacement"}}, + {"files", func() *cobra.Command { return newFilesUpdateCmd(&project) }, []string{"789", "--type", "document", "--content", "replacement ![image](./does-not-exist.png)"}}, + {"projects", newProjectsUpdateCmd, []string{"789", "--description", "replacement"}}, + {"templates", newTemplatesUpdateCmd, []string{"789", "--description", "replacement"}}, + {"gauges", newGaugesUpdateCmd, []string{"789", "--description", "replacement"}}, + {"timesheet", newTimesheetEntryUpdateCmd, []string{"789", "--description", "replacement"}}, + {"notes", newNotesSetCmd, []string{"replacement"}}, + {"files autodetect", func() *cobra.Command { return newFilesUpdateCmd(&project) }, []string{"789", "--content", "replacement"}}, + {"files upload", func() *cobra.Command { return newFilesUpdateCmd(&project) }, []string{"789", "--type", "upload", "--content", "replacement"}}, + {"files vault nonbody", func() *cobra.Command { return newFilesUpdateCmd(&project) }, []string{"789", "--type", "vault", "--title", "replacement"}}, + {"doors", func() *cobra.Command { return newDoorsUpdateCmd(&project) }, []string{"789", "--description", "replacement"}}, + {"doors clear", func() *cobra.Command { return newDoorsUpdateCmd(&project) }, []string{"789", "--description", ""}}, + {"files replace", func() *cobra.Command { return newFilesReplaceCmd(&project) }, []string{"789", "../../go.mod", "--description", "replacement ![image](./does-not-exist.png)"}}, + {"files replace clear", func() *cobra.Command { return newFilesReplaceCmd(&project) }, []string{"789", "../../go.mod", "--description", ""}}, + {"files replace attachment only", func() *cobra.Command { return newFilesReplaceCmd(&project) }, []string{"789", "../../go.mod"}}, + {"cards attachment only", newCardsUpdateCmd, []string{"789", "--attach", "../../go.mod"}}, + {"schedule attachment only", func() *cobra.Command { return newScheduleUpdateCmd(&project) }, []string{"789", "--attach", "../../go.mod"}}, + {"todos clear", newTodosUpdateCmd, []string{"789", "--description", ""}}, + {"files document clear", func() *cobra.Command { return newFilesUpdateCmd(&project) }, []string{"789", "--type", "document", "--content", ""}}, + {"todo nonbody full record", newTodosUpdateCmd, []string{"789", "--title", "replacement"}}, + } +} + +func TestBodyGuardRefusesBeforeUploadsAndMutations(t *testing.T) { + for _, tc := range bodyGuardCommands() { + t.Run(tc.name, func(t *testing.T) { + tr := &bodyGuardTransport{live: `"2026-11-08T18:10:58Z"`} + app, _ := newTestAppWithTransport(t, tr) + err := executeCommand(tc.newCmd(), app, append(tc.args, "--if-unmodified-since", "2026-11-08T18:00:00Z")...) + require.Error(t, err) + require.Contains(t, err.Error(), "conflict") + require.Zero(t, tr.writes) + require.Positive(t, tr.gets) + }) + } +} + +func TestBodyGuardTimestampFailures(t *testing.T) { + for _, live := range []string{`null`, `"0001-01-01T00:00:00Z"`, `"invalid"`} { + t.Run(live, func(t *testing.T) { + tr := &bodyGuardTransport{live: live} + app, _ := newTestAppWithTransport(t, tr) + err := executeCommand(newCommentsUpdateCmd(), app, "789", "replacement", "--if-unmodified-since", "2026-11-08T18:00:00Z") + require.Error(t, err) + require.Zero(t, tr.writes) + }) + } + for _, tc := range []struct { + name string + value string + flags []string + }{ + {"missing even with force", `null`, []string{"--force"}}, + {"future is not equality", `"2026-11-08T18:00:00Z"`, nil}, + {"different nanoseconds", `"2026-11-08T18:10:58.000000001Z"`, nil}, + } { + t.Run(tc.name, func(t *testing.T) { + tr := &bodyGuardTransport{live: tc.value} + app, _ := newTestAppWithTransport(t, tr) + args := append([]string{"789", "replacement", "--if-unmodified-since", "2026-11-08T18:10:58Z"}, tc.flags...) + err := executeCommand(newCommentsUpdateCmd(), app, args...) + require.Error(t, err) + require.Zero(t, tr.writes) + }) + } + for _, tc := range bodyGuardCommands() { + t.Run(tc.name, func(t *testing.T) { + tr := &bodyGuardTransport{live: `"2026-11-08T18:00:00Z"`} + app, _ := newTestAppWithTransport(t, tr) + err := executeCommand(tc.newCmd(), app, append(tc.args, "--if-unmodified-since", "invalid", "--force")...) + require.Error(t, err) + require.Contains(t, err.Error(), "RFC3339") + require.Zero(t, tr.writes) + require.Zero(t, tr.gets) + }) + } +} + +func TestBodyGuardUnavailableLiveState(t *testing.T) { + for _, tc := range bodyGuardCommands() { + for _, state := range []struct { + name, live string + status int + }{ + {"missing", `null`, 0}, + {"zero", `"0001-01-01T00:00:00Z"`, 0}, + {"malformed", `"invalid"`, 0}, + {"failed GET", `"2026-11-08T18:00:00Z"`, http.StatusForbidden}, + } { + for _, force := range []bool{false, true} { + t.Run(fmt.Sprintf("%s/%s/force=%t", tc.name, state.name, force), func(t *testing.T) { + tr := &bodyGuardTransport{live: state.live, getStatus: state.status} + app, _ := newTestAppWithTransport(t, tr) + args := append(append([]string{}, tc.args...), "--if-unmodified-since", "2026-11-08T18:00:00Z") + if force { + args = append(args, "--force") + } + err := executeCommand(tc.newCmd(), app, args...) + require.Error(t, err) + require.Zero(t, tr.writes) + require.Positive(t, tr.gets) + }) + } + } + } +} + +func TestBodyGuardFilesAutodetection(t *testing.T) { + project := "123" + for _, kind := range []string{"vault", "upload"} { + for _, force := range []bool{false, true} { + t.Run(fmt.Sprintf("%s/force=%t", kind, force), func(t *testing.T) { + tr := &bodyGuardTransport{live: `"2026-11-08T18:10:58Z"`, detectedType: kind} + app, _ := newTestAppWithTransport(t, tr) + args := []string{"789", "--title", "replacement", "--if-unmodified-since", "2026-11-08T18:00:00Z"} + if force { + args = append(args, "--force") + } + err := executeCommand(newFilesUpdateCmd(&project), app, args...) + require.Contains(t, strings.Join(tr.paths, " "), "/"+kind+"s/789") + if force { + require.NoError(t, err) + require.Equal(t, 1, tr.writes) + } else { + require.ErrorContains(t, err, "conflict") + require.Zero(t, tr.writes) + } + }) + } + } +} + +func TestBodyGuardEmptyLiveRecordRefuses(t *testing.T) { + for _, tc := range bodyGuardCommands() { + for _, status := range []int{http.StatusOK, http.StatusNoContent} { + t.Run(fmt.Sprintf("%s/%d", tc.name, status), func(t *testing.T) { + tr := &bodyGuardTransport{live: `null`, emptyRecord: true, getStatus: status} + app, _ := newTestAppWithTransport(t, tr) + args := append(append([]string{}, tc.args...), "--if-unmodified-since", "2026-11-08T18:00:00Z", "--force") + require.NotPanics(t, func() { + require.Error(t, executeCommand(tc.newCmd(), app, args...)) + }) + require.Zero(t, tr.writes) + }) + } + } +} + +func TestBodyGuardBoostExplicitlyExcluded(t *testing.T) { + project := "123" + cmd := newBoostUpdateCmd(&project) + require.Nil(t, cmd.Flags().Lookup("if-unmodified-since")) + require.Nil(t, cmd.Flags().Lookup("force")) + tr := &bodyGuardTransport{live: `null`} + app, _ := newTestAppWithTransport(t, tr) + err := executeCommand(cmd, app, "789", "replacement") + require.NoError(t, err) + require.Equal(t, 1, tr.writes) + require.Zero(t, tr.gets) +} + +func TestBodyGuardMatchingOverrideAndUnprotected(t *testing.T) { + for _, tc := range []struct { + name string + flags []string + gets int + }{ + {"same instant", []string{"--if-unmodified-since", "2026-11-08T13:10:58-05:00"}, 1}, + {"override", []string{"--if-unmodified-since", "2026-11-08T18:00:00Z", "--force"}, 1}, + {"first use no baseline", nil, 0}, + } { + t.Run(tc.name, func(t *testing.T) { + tr := &bodyGuardTransport{live: `"2026-11-08T18:10:58Z"`} + app, _ := newTestAppWithTransport(t, tr) + err := executeCommand(newCommentsUpdateCmd(), app, append([]string{"789", "replacement"}, tc.flags...)...) + require.NoError(t, err) + require.Equal(t, 1, tr.writes) + require.Equal(t, tc.gets, tr.gets) + }) + } +} diff --git a/internal/commands/cards.go b/internal/commands/cards.go index d2dec904c..ad9bfe9f9 100644 --- a/internal/commands/cards.go +++ b/internal/commands/cards.go @@ -8,6 +8,7 @@ import ( "net/http" "strconv" "strings" + "time" "github.com/spf13/cobra" @@ -1226,6 +1227,16 @@ You can pass either a card ID or a Basecamp URL: return err } + if err := checkBodyUpdate(cmd, func() (time.Time, error) { + live, err := app.Account().Cards().Get(cmd.Context(), cardID) + if err != nil { + return time.Time{}, err + } + return live.UpdatedAt, nil + }); err != nil { + return err + } + req := &basecamp.UpdateCardRequest{} if title != "" { req.Title = &title @@ -1308,6 +1319,7 @@ You can pass either a card ID or a Basecamp URL: allowDash(cmd, "flag:body") addRichTextFormatFlag(cmd) + addBodyGuardFlags(cmd) return cmd } diff --git a/internal/commands/chat.go b/internal/commands/chat.go index 387696c53..0150a0507 100644 --- a/internal/commands/chat.go +++ b/internal/commands/chat.go @@ -9,6 +9,7 @@ import ( "slices" "strconv" "strings" + "time" "github.com/basecamp/basecamp-sdk/go/pkg/basecamp" "github.com/spf13/cobra" @@ -1084,6 +1085,16 @@ edit to rich text.`, return output.ErrUsage("Invalid line ID") } + if err := checkBodyUpdate(cmd, func() (time.Time, error) { + live, err := app.Account().Campfires().GetLine(cmd.Context(), chatIDInt, lineIDInt) + if err != nil { + return time.Time{}, err + } + return live.UpdatedAt, nil + }); err != nil { + return err + } + // Resolve the content into the exact rich-text body we PUT. Chat edits // always render as rich text server-side, so: // - unset (default): Markdown → HTML unconditionally, then resolve @@ -1181,6 +1192,7 @@ edit to rich text.`, allowDash(cmd, "arg:1", "flag:content") + addBodyGuardFlags(cmd) return cmd } diff --git a/internal/commands/checkins.go b/internal/commands/checkins.go index 7972ab55b..9c8313117 100644 --- a/internal/commands/checkins.go +++ b/internal/commands/checkins.go @@ -1481,6 +1481,16 @@ You can pass either an answer ID or a Basecamp URL: return output.ErrUsage("Invalid answer ID") } + if err := checkBodyUpdate(cmd, func() (time.Time, error) { + live, err := app.Account().Checkins().GetAnswer(cmd.Context(), answerID) + if err != nil { + return time.Time{}, err + } + return live.UpdatedAt, nil + }); err != nil { + return err + } + answerHTML := richTextToHTML(cmd, content) answerHTML, resolveErr := resolveLocalImages(cmd, app, answerHTML) if resolveErr != nil { @@ -1528,6 +1538,7 @@ You can pass either an answer ID or a Basecamp URL: allowDash(cmd, "arg:1+") addRichTextFormatFlag(cmd) + addBodyGuardFlags(cmd) return cmd } diff --git a/internal/commands/comment.go b/internal/commands/comment.go index e1ae7c354..e22ead245 100644 --- a/internal/commands/comment.go +++ b/internal/commands/comment.go @@ -1038,6 +1038,16 @@ as backslash-n.`, return err } + if err := checkBodyUpdate(cmd, func() (time.Time, error) { + live, err := app.Account().Comments().Get(cmd.Context(), commentID) + if err != nil { + return time.Time{}, err + } + return live.UpdatedAt, nil + }); err != nil { + return err + } + // Convert Markdown content to HTML for Basecamp's rich text fields html := richTextToHTML(cmd, content) @@ -1084,6 +1094,7 @@ as backslash-n.`, allowDash(cmd, "arg:1+") addRichTextFormatFlag(cmd) + addBodyGuardFlags(cmd) return cmd } diff --git a/internal/commands/doors.go b/internal/commands/doors.go index b59a451f6..c7f680989 100644 --- a/internal/commands/doors.go +++ b/internal/commands/doors.go @@ -5,6 +5,7 @@ import ( "net/url" "strconv" "strings" + "time" "github.com/basecamp/basecamp-sdk/go/pkg/basecamp" "github.com/spf13/cobra" @@ -443,6 +444,16 @@ link private to the team. return err } + if err := checkBodyUpdate(cmd, func() (time.Time, error) { + live, err := app.Account().Doors().Get(cmd.Context(), doorID) + if err != nil { + return time.Time{}, err + } + return live.UpdatedAt, nil + }); err != nil { + return err + } + req := &basecamp.UpdateDoorRequest{ Service: service, URL: linkURL, @@ -486,6 +497,7 @@ link private to the team. }, } + addBodyGuardFlags(cmd) cmd.Flags().StringVar(&linkURL, "url", "", "New address") cmd.Flags().StringVar(&title, "title", "", "New title") cmd.Flags().StringVar(&service, "service", "", "New service code (figma, github, notion, other, ...)") diff --git a/internal/commands/files.go b/internal/commands/files.go index 236423134..0633d88f9 100644 --- a/internal/commands/files.go +++ b/internal/commands/files.go @@ -13,6 +13,7 @@ import ( "slices" "strconv" "strings" + "time" "github.com/basecamp/basecamp-sdk/go/pkg/basecamp" "github.com/spf13/cobra" @@ -1824,6 +1825,16 @@ You can pass either an upload ID or a Basecamp URL: return output.ErrUsage(fmt.Sprintf("URL is for account %s, but this session uses account %s", parsedURL.AccountID, app.Config.AccountID)) } + if err := checkBodyUpdate(cmd, func() (time.Time, error) { + live, err := app.Account().Uploads().Get(cmd.Context(), uploadID) + if err != nil { + return time.Time{}, err + } + return live.UpdatedAt, nil + }); err != nil { + return err + } + // Resolve the description first: its local-image references can // fail deterministically, and staging a large replacement before // finding that out wastes the whole transfer. A nil Description @@ -1892,6 +1903,7 @@ You can pass either an upload ID or a Basecamp URL: }, } + addBodyGuardFlags(cmd) cmd.Flags().StringVar(&description, "description", "", "New description (Markdown); omit to carry the current one forward; use - to read from stdin") cmd.Flags().StringVar(&baseName, "base-name", "", "Rename the file (without extension); omit to keep the uploaded file's name") @@ -2058,6 +2070,15 @@ You can pass either an item ID or a Basecamp URL: switch itemType { case "vault", "folder": req := &basecamp.UpdateVaultRequest{Title: title} + if err := checkBodyUpdate(cmd, func() (time.Time, error) { + live, err := app.Account().Vaults().Get(cmd.Context(), itemID) + if err != nil { + return time.Time{}, err + } + return live.UpdatedAt, nil + }); err != nil { + return err + } vault, err := app.Account().Vaults().Update(cmd.Context(), itemID, req) if err != nil { return convertSDKError(err) @@ -2073,6 +2094,15 @@ You can pass either an item ID or a Basecamp URL: detectedType = "document" case "upload", "file": req := &basecamp.UpdateUploadRequest{} + if err := checkBodyUpdate(cmd, func() (time.Time, error) { + live, err := app.Account().Uploads().Get(cmd.Context(), itemID) + if err != nil { + return time.Time{}, err + } + return live.UpdatedAt, nil + }); err != nil { + return err + } if nonDocTitleSet { req.BaseName = title } @@ -2121,6 +2151,15 @@ You can pass either an item ID or a Basecamp URL: return noChanges(cmd) } req := &basecamp.UpdateVaultRequest{Title: title} + if err := checkBodyUpdate(cmd, func() (time.Time, error) { + live, err := app.Account().Vaults().Get(cmd.Context(), itemID) + if err != nil { + return time.Time{}, err + } + return live.UpdatedAt, nil + }); err != nil { + return err + } vault, err := app.Account().Vaults().Update(cmd.Context(), itemID, req) if err != nil { return convertSDKError(err) @@ -2135,6 +2174,15 @@ You can pass either an item ID or a Basecamp URL: return noChanges(cmd) } req := &basecamp.UpdateUploadRequest{} + if err := checkBodyUpdate(cmd, func() (time.Time, error) { + live, err := app.Account().Uploads().Get(cmd.Context(), itemID) + if err != nil { + return time.Time{}, err + } + return live.UpdatedAt, nil + }); err != nil { + return err + } if nonDocTitleSet { req.BaseName = title } @@ -2186,10 +2234,20 @@ You can pass either an item ID or a Basecamp URL: allowDash(cmd, "flag:content") addRichTextFormatFlag(cmd) + addBodyGuardFlags(cmd) return cmd } func updateDocument(cmd *cobra.Command, app *appctx.App, itemID int64, existingDoc *basecamp.Document, setTitle, setContent bool, title, content string) (*basecamp.Document, error) { + if err := checkBodyUpdate(cmd, func() (time.Time, error) { + live, err := app.Account().Documents().Get(cmd.Context(), itemID) + if err != nil { + return time.Time{}, err + } + return live.UpdatedAt, nil + }); err != nil { + return nil, err + } // setTitle/setContent are caller-computed effective flags: they're true when // the user provided either a non-whitespace value or an explicit empty // string. Whitespace-only values arrive as setTitle=false/setContent=false diff --git a/internal/commands/gauges.go b/internal/commands/gauges.go index ff5a2958d..966d7b6f6 100644 --- a/internal/commands/gauges.go +++ b/internal/commands/gauges.go @@ -3,6 +3,7 @@ package commands import ( "fmt" "strconv" + "time" "github.com/basecamp/basecamp-sdk/go/pkg/basecamp" "github.com/spf13/cobra" @@ -295,6 +296,15 @@ func newGaugesUpdateCmd() *cobra.Command { req := &basecamp.UpdateGaugeNeedleRequest{ Description: basecamp.Ptr(description), } + if err := checkBodyUpdate(cmd, func() (time.Time, error) { + live, err := app.Account().Gauges().GetNeedle(cmd.Context(), needleID) + if err != nil { + return time.Time{}, err + } + return live.UpdatedAt, nil + }); err != nil { + return err + } needle, err := app.Account().Gauges().UpdateNeedle(cmd.Context(), needleID, req) if err != nil { @@ -318,6 +328,7 @@ func newGaugesUpdateCmd() *cobra.Command { allowDash(cmd, "flag:description") + addBodyGuardFlags(cmd) return cmd } diff --git a/internal/commands/messages.go b/internal/commands/messages.go index d6346a5e9..f8f2e799c 100644 --- a/internal/commands/messages.go +++ b/internal/commands/messages.go @@ -8,6 +8,7 @@ import ( "sort" "strconv" "strings" + "time" "github.com/spf13/cobra" @@ -710,6 +711,16 @@ anything else is a name matched against the message's project. List a project's return err } + if err := checkBodyUpdate(cmd, func() (time.Time, error) { + live, err := app.Account().Messages().Get(cmd.Context(), messageID) + if err != nil { + return time.Time{}, err + } + return live.UpdatedAt, nil + }); err != nil { + return err + } + var categoryID int64 if categoryChanged { categoryID, err = resolveUpdatedMessageCategory(cmd.Context(), app, messageID, category) @@ -773,6 +784,7 @@ anything else is a name matched against the message's project. List a project's allowDash(cmd, "flag:body") addRichTextFormatFlag(cmd) + addBodyGuardFlags(cmd) return cmd } diff --git a/internal/commands/notes.go b/internal/commands/notes.go index 7ad1852b8..2ee515efd 100644 --- a/internal/commands/notes.go +++ b/internal/commands/notes.go @@ -5,6 +5,7 @@ import ( "io" "os" "strings" + "time" "github.com/spf13/cobra" @@ -143,6 +144,18 @@ a destructive verb deserves its own review, not a rider on a bump.`, } // The note is rich text (my_notes.md: content | HTML), so Markdown + if err := checkBodyUpdate(cmd, func() (time.Time, error) { + live, err := app.Account().MyNotes().Get(cmd.Context()) + if err != nil { + return time.Time{}, err + } + if live.UpdatedAt == nil { + return time.Time{}, nil + } + return *live.UpdatedAt, nil + }); err != nil { + return err + } // is converted like every other content-writing command. Sending the // raw string would store escaped or malformed markup. note, err := app.Account().MyNotes().Update(cmd.Context(), richTextToHTML(cmd, content)) @@ -168,6 +181,7 @@ a destructive verb deserves its own review, not a rider on a bump.`, allowDash(cmd, "arg:0", "flag:file") addRichTextFormatFlag(cmd) + addBodyGuardFlags(cmd) return cmd } diff --git a/internal/commands/projects.go b/internal/commands/projects.go index 54b0e6e02..b17387484 100644 --- a/internal/commands/projects.go +++ b/internal/commands/projects.go @@ -9,6 +9,7 @@ import ( "sort" "strconv" "strings" + "time" "github.com/spf13/cobra" @@ -352,6 +353,16 @@ Examples: return err } + if err := checkBodyUpdate(cmd, func() (time.Time, error) { + live, err := app.Account().Projects().Get(cmd.Context(), projectID) + if err != nil { + return time.Time{}, err + } + return live.UpdatedAt, nil + }); err != nil { + return err + } + // For update, we need to provide name (required by SDK) // If only description is provided, we need to fetch current name first updateName := name @@ -394,6 +405,7 @@ Examples: allowDash(cmd, "flag:description") + addBodyGuardFlags(cmd) return cmd } diff --git a/internal/commands/schedule.go b/internal/commands/schedule.go index e43b19b0c..da1d68b26 100644 --- a/internal/commands/schedule.go +++ b/internal/commands/schedule.go @@ -692,6 +692,16 @@ You can pass either an entry ID or a Basecamp URL: return err } + if err := checkBodyUpdate(cmd, func() (time.Time, error) { + live, err := app.Account().Schedules().GetEntry(cmd.Context(), entryIDInt) + if err != nil { + return time.Time{}, err + } + return live.UpdatedAt, nil + }); err != nil { + return err + } + // Resolve project - use URL > flag > config, with interactive fallback projectID := *project if projectID == "" && urlProjectID != "" { @@ -839,6 +849,7 @@ You can pass either an entry ID or a Basecamp URL: allowDash(cmd, "flag:description", "flag:desc") addRichTextFormatFlag(cmd) + addBodyGuardFlags(cmd) return cmd } diff --git a/internal/commands/templates.go b/internal/commands/templates.go index b10876490..c1f57fca5 100644 --- a/internal/commands/templates.go +++ b/internal/commands/templates.go @@ -523,6 +523,16 @@ func newTemplatesUpdateCmd() *cobra.Command { return err } + if err := checkBodyUpdate(cmd, func() (time.Time, error) { + live, err := app.Account().Templates().Get(cmd.Context(), templateID) + if err != nil { + return time.Time{}, err + } + return live.UpdatedAt, nil + }); err != nil { + return err + } + // SDK requires name for update, fetch current if not provided updateName := name if updateName == "" { @@ -562,6 +572,7 @@ func newTemplatesUpdateCmd() *cobra.Command { allowDash(cmd, "flag:description", "flag:desc") + addBodyGuardFlags(cmd) return cmd } diff --git a/internal/commands/timesheet_entries.go b/internal/commands/timesheet_entries.go index 3b74899e5..17f5af0fb 100644 --- a/internal/commands/timesheet_entries.go +++ b/internal/commands/timesheet_entries.go @@ -234,6 +234,15 @@ cleared through the API, only replaced. } } + if err := checkBodyUpdate(cmd, func() (time.Time, error) { + live, err := app.Account().Timesheet().Get(cmd.Context(), entryID) + if err != nil { + return time.Time{}, err + } + return live.UpdatedAt, nil + }); err != nil { + return err + } entry, err := app.Account().Timesheet().Update(cmd.Context(), entryID, req) if err != nil { return convertSDKError(err) @@ -251,6 +260,7 @@ cleared through the API, only replaced. cmd.Flags().StringVar(&description, "description", "", "Note about the work") cmd.Flags().StringVar(&person, "person", "", `Person the time is for: ID, name, email or "me"`) + addBodyGuardFlags(cmd) return cmd } diff --git a/internal/commands/todolists.go b/internal/commands/todolists.go index d28f98290..9be2d9e87 100644 --- a/internal/commands/todolists.go +++ b/internal/commands/todolists.go @@ -6,6 +6,7 @@ import ( "fmt" "strconv" "strings" + "time" "github.com/spf13/cobra" @@ -421,6 +422,16 @@ You can pass either a todolist ID or a Basecamp URL: return err } + if err := checkBodyUpdate(cmd, func() (time.Time, error) { + live, err := app.Account().Todolists().Get(cmd.Context(), todolistID) + if err != nil { + return time.Time{}, err + } + return live.UpdatedAt, nil + }); err != nil { + return err + } + // Resolve project - use URL > flag > config, with interactive fallback projectID := *project if projectID == "" && urlProjectID != "" { @@ -474,6 +485,7 @@ You can pass either a todolist ID or a Basecamp URL: allowDash(cmd, "flag:description") + addBodyGuardFlags(cmd) return cmd } diff --git a/internal/commands/todos.go b/internal/commands/todos.go index 3bbfb4a35..927a9d69f 100644 --- a/internal/commands/todos.go +++ b/internal/commands/todos.go @@ -1636,6 +1636,16 @@ Set or clear the people notified when the todo is completed: return err } + if err := checkBodyUpdate(cmd, func() (time.Time, error) { + live, err := app.Account().Todos().Get(cmd.Context(), todoID) + if err != nil { + return time.Time{}, err + } + return live.UpdatedAt, nil + }); err != nil { + return err + } + // Pre-Edit validation and resolution — no todo HTTP happens here. // Image uploads are deferred into the Edit closure so a missing // todo can't orphan uploaded attachments. @@ -1756,6 +1766,7 @@ Set or clear the people notified when the todo is completed: allowDash(cmd, "flag:description") addRichTextFormatFlag(cmd) + addBodyGuardFlags(cmd) return cmd } diff --git a/skills/basecamp/SKILL.md b/skills/basecamp/SKILL.md index 8864dc2ed..ce1546d34 100644 --- a/skills/basecamp/SKILL.md +++ b/skills/basecamp/SKILL.md @@ -409,13 +409,9 @@ operation and the API path and payload are known. ## Mutations -Before changing Basecamp: - -1. Resolve the account, project, container, and item unambiguously. -2. Inspect leaf help for required positional arguments and visibility or - notification behavior. -3. Make the smallest requested change. -4. Return the resulting ID/URL and summarize what changed. - -For destructive or broad operations, preview when the command offers a dry-run -and do not expand the user's requested scope. +Resolve account/project/container/item; inspect help, visibility and notifications. +For guarded updates, fetch the record's `updated_at`; pass it as +`--if-unmodified-since`. No baseline: unprotected, even first use; no memory. +GET→PUT races. Boost stays unguarded, as do raw API/MCP/TUI/SDK/other paths. +Use typed guards, not `api put`. Change only requested items; return ID/URL. +Preview broad/destructive work.