davidandClaude Opus 5.5 4d304cd65b Stop committing credentials; fix posting length, partial posts, and data safety
- Untrack config.yaml (now gitignored) and add config.example.yaml with
  blank credentials; install.sh copies the example and sets mode 600
- Reserve room for the appended source link when asking Claude for a
  post, count length the way X does, and refuse over-length tweets
  before posting
- Return https://x.com/i/status/<id> for posted tweets
- Track which platforms each queued post reached so a partial failure
  can be retried without double-posting
- Write config, state, posts and dismissed files atomically with 0600
- Keep refreshed Twitter tokens in memory if saving them fails, and log
  the failure instead of writing to the hidden stderr
- Exit with a clear message on corrupt data files instead of panicking
- Surface save errors in the UI; show status/error messages on home
- Add tests for X length counting, the post store, and token updates

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 06:14:40 -07:00
2026-04-29 13:18:32 -06:00
2026-04-29 06:55:00 -06:00
2026-04-29 06:55:00 -06:00

CoreMarketing Social Curator

A terminal UI app that monitors open source SaaS applications across X.com, YouTube, and Instagram, then uses Claude AI to generate posts in the voice of a product manager.

Prerequisites

  • Go 1.22 or later
  • A Claude API key
  • API credentials for whichever platforms you want to monitor (all are optional except Claude)

Setup

1. Configure credentials

./install.sh copies config.example.yaml to ~/.local/state/coremarketing/config.yaml (the default location the app reads). Fill in your API keys there:

Never commit real credentials. config.yaml is gitignored; only config.example.yaml, with blank credentials, belongs in the repo.

credentials:
  claude:
    api_key: "sk-ant-..."        # Required

  twitter:
    bearer_token: ""             # Required for reading (X Basic plan, $100/mo)
    client_id: ""                # Required for posting (OAuth 2.0 client ID)
    client_secret: ""            # Confidential clients only — leave blank otherwise
    oauth2_access_token: ""      # Set automatically by `coremarketing auth twitter`

  youtube:
    api_key: ""                  # Free — get one at console.cloud.google.com

  instagram:
    access_token: ""             # Requires Facebook App review
    business_account_id: ""

posting:
  twitter_handle: "youraccount" # The @handle you post FROM

Missing credentials are skipped gracefully — the app works with only Claude plus whichever sources you have set up.

2. Add your applications

In config.yaml, list the open source SaaS apps you want to track:

applications:
  - name: "Nextcloud"
    description: "Self-hosted file storage and collaboration platform"
    twitter_handle: "nextcloud"
    youtube_channel_id: "UCQGgrx2pSXQ2r0fk2cbQIFQ"
    instagram_handle: ""
    hashtags:
      - "nextcloud"
      - "selfhosted"

2b. Authorize Twitter/X posting

Once client_id is set, run the one-time auth flow to obtain a posting token:

coremarketing auth twitter

This opens a browser, handles the OAuth 2.0 PKCE redirect on localhost:8080, and writes oauth2_access_token directly into config.yaml. Re-run it any time the token expires.

Build & Install

To build and install the binary to ~/.local/bin/:

./install.sh

The script auto-detects your Go installation. If ~/.local/bin is not in your PATH, it will print a reminder to add it to your shell config.

To build locally without installing:

go build -o coremarketing .

Run

coremarketing

Or, if running from the project directory without installing:

./coremarketing

To use a different config file:

coremarketing /path/to/config.yaml

Usage

The app uses a two-stage workflow: first generate posts from curated content, then publish them when ready.

Stage 1 — Research and generate

Screen Keys
App list — pick which application to research ↑↓ navigate, / filter, Enter select, p view post queue, q quit
Fetching — pulls content from all configured sources since last check (automatic)
Content browser — review what was found ↑↓ navigate, Space select/deselect, Enter generate post, Esc back
Post preview — edit the Claude-generated post Enter save to queue, Ctrl+R regenerate, Esc back

Stage 2 — Publish

From the app list, press p to open the post queue. The home screen shows a badge when posts are ready.

Screen Keys
Generated Posts — all saved posts waiting to be published ↑↓ navigate, Space select/deselect, Ctrl+P post selected, d delete selected, Esc back
Result — shows published URLs and any errors Enter return to home

You can queue posts for multiple applications before publishing them all at once.

Data files

All data files are written next to config.yaml, regardless of where you run the binary from.

File Purpose
state.json Tracks when content was last fetched per application
posts.json Stores generated posts waiting to be published

Lookback window

The lookback window always defaults to 7 days. It only advances (per application) when Claude successfully generates a post from that application's content — ensuring you never miss content between runs.

To reset the window for all applications:

rm state.json

To reset a single application, open state.json and delete that app's entry.

Generated posts

Claude writes each post in the voice of a product manager — practical, specific, and helpful rather than promotional. Posts are capped at the max_length set in config.yaml (default: 280 characters for standard X accounts, up to 25,000 for X Premium).

You can edit the generated post in the preview screen before saving it to the queue.

S
Description
Help posting relevant content to Twitter, etc.
Readme MPL-2.0
3.4 MiB
Languages
Go 81.6%
HTML 12.1%
CSS 4%
Shell 1%
PLpgSQL 0.8%
Other 0.4%