Skip to content

Commit ddd15b8

Browse files
authored
docs: warn against bash ANSI-C quoting for multiline comment content (#517)
Under a POSIX /bin/sh (dash, busybox-ash — common in agent sandboxes), $'...' is not ANSI-C quoting: the $ is passed through literally and \n stays a backslash-n. This posts a stray leading $ on comment content, as reported in #459. Document the stdin ('-') pattern as the safe alternative in both the comments create/update help text and the Basecamp skill. Refs #459
1 parent 937d97e commit ddd15b8

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

‎internal/commands/comment.go‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,11 @@ You can pass either a comment ID or a Basecamp URL:
202202
basecamp comments update https://3.basecamp.com/123/buckets/456/todos/111#__recording_789 "new text"
203203
204204
Use - as the content argument to read the updated content from stdin:
205-
basecamp comments update 789 - < body.md`,
205+
basecamp comments update 789 - < body.md
206+
207+
For multiline or non-ASCII content, prefer stdin over bash ANSI-C quoting
208+
($'...') — under a POSIX /bin/sh it posts a literal leading $ and keeps \n
209+
as backslash-n.`,
206210
RunE: func(cmd *cobra.Command, args []string) error {
207211
if len(args) == 0 {
208212
return missingArg(cmd, "<id|url>")
@@ -301,7 +305,12 @@ Content supports Markdown and @mentions (@Name or @First.Last):
301305
basecamp comments create 789 "Hey @Jane.Smith, **please review**"
302306
303307
Use - as the content argument to read content from stdin:
304-
basecamp comments create 789 - < body.md`,
308+
basecamp comments create 789 - < body.md
309+
310+
For multiline or non-ASCII content, prefer stdin over bash ANSI-C quoting
311+
($'...'). $'...' is a bash/zsh extension; under a POSIX /bin/sh (dash,
312+
busybox-ash) it posts a literal leading $ and keeps \n as backslash-n:
313+
printf '%s\n' 'First line' '' '<bc-attachment ...>' | basecamp comments create 789 -`,
305314
Annotations: map[string]string{"agent_notes": "Comments are flat — reply to parent item, not to other comments\nURL fragments (#__recording_456) are comment IDs — comment on the parent recording_id, not the comment_id\nComments are on items (todos, messages, cards, etc.) — not on other comments"},
306315
RunE: func(cmd *cobra.Command, args []string) error {
307316
app := appctx.FromContext(cmd.Context())

‎skills/basecamp/SKILL.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ Full CLI coverage: 155 endpoints across todos, cards, messages, files, schedule,
9191
- **`@sgid:VALUE`** — inline SGID embed for pipeline composability
9292
- **`@Name` / `@First.Last`** — fuzzy name resolution (may be ambiguous)
9393
For todos, documents, and cards, content is sent as-is — use plain text or HTML directly.
94+
95+
**Multiline / non-ASCII content:** do not rely on bash ANSI-C quoting (`$'...\n...'`) — it is a bash/zsh extension. Under a POSIX `/bin/sh` (dash, busybox-ash, common in sandboxes) the `$` is passed through literally and posts a stray leading `$`, and `\n` stays a literal backslash-n. Pipe the content via stdin instead, using `-` as the content argument:
96+
```bash
97+
printf '%s\n' '海报 mockup 方向稿:' '' '<bc-attachment ...>' | basecamp comments create <recording_id> - --in <project> --json
98+
```
9499
6. **Project scope is mandatory for most commands** — via `--in <project>` or `.basecamp/config.json`. Cross-project exceptions: `basecamp reports assigned` for assigned work, `basecamp assignments` for structured assignment views, `basecamp reports overdue` for overdue todos, `basecamp reports schedule` for upcoming schedule across all projects, `basecamp recordings <type>` for browsing by type, `basecamp notifications` for notifications, `basecamp gauges list` for account-wide gauges.
95100

96101
### Output Modes

0 commit comments

Comments
 (0)