Skip to content

feat(typefully): add LinkedIn first comment support to drafts - #29

Open
frankdilo wants to merge 2 commits into
mainfrom
feat/typefully-linkedin-first-comment
Open

feat(typefully): add LinkedIn first comment support to drafts#29
frankdilo wants to merge 2 commits into
mainfrom
feat/typefully-linkedin-first-comment

Conversation

@frankdilo

@frankdilo frankdilo commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds LinkedIn first comment support to drafts:create and drafts:update — the common "link in the first comment" pattern. Pairs with the API v2 change in typefully/typefully-backend#1770.

./scripts/typefully.js drafts:create --platform linkedin --text "Big launch today!" --linkedin-first-comment "Full details: https://example.com/launch"

CLI behavior

  • New flag --linkedin-first-comment <text> on drafts:create/drafts:update (and the create-draft/update-draft aliases). Flag aliases: --linkedin_first_comment, --first-comment, --first_comment, with conflict detection when several are passed with different values.
  • Sent to the API as platforms.linkedin.settings.first_comment. LinkedIn-only: using it without linkedin in the target platforms errors.
  • On update:
    • literal null clears the comment;
    • omitting the flag preserves the existing comment — the CLI only sends settings when the flag is passed, and the API preserves the first comment when settings are omitted;
    • the flag alone (no --text) works as a settings-only update: the CLI re-sends the draft's existing LinkedIn posts, mirroring the X metadata-only update path.

Docs & tests

  • SKILL.md: flags table, common actions row, LinkedIn-only flags pointer, last-updated bump.
  • references/platforms/linkedin.md: new "First comment" section.
  • CHANGELOG.md: user-facing entry under 2026-07-10.
  • 6 new tests in tests/drafts.test.js (create payload, platform validation, settings-only update, settings omitted on text-only update, null clear, conflicting flags); full suite passes (122 tests).

Merge note: requires typefully/typefully-backend#1770 to be deployed first — the current API schema rejects platforms.linkedin.settings.first_comment with 422.

drafts:create and drafts:update accept --linkedin-first-comment <text>
(aliases: --linkedin_first_comment, --first-comment, --first_comment),
sent to API v2 as platforms.linkedin.settings.first_comment.

On update, a literal null clears the comment and omitting the flag
preserves it: the CLI re-sends the existing comment on text-only
updates because the API clears LinkedIn settings when omitted. A
settings-only update (flag without --text) re-sends the draft's
existing LinkedIn posts, mirroring the X metadata-only update path.
The API now preserves the first comment when LinkedIn settings are
omitted on PATCH (typefully-backend#1770), so drop the workaround that
re-sent the existing comment on text-only updates. Only send settings
when the flag is passed; this also avoids overwriting a comment changed
concurrently in the web editor with a stale value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant