Skip to content

Repository files navigation

POST!

🌐 See how it works → https://veinsystem.github.io/post/

Every day, an AI picks a product from your Shopify catalog, writes the caption, you approve it, and it posts to Instagram & Threads — automatically.

POST! is a self-hosted engine that picks a product from your Shopify catalog every day, builds the carousel, and writes the caption — then waits. Nothing ships to Instagram or Threads until you click approve.

POST! approval UI — review the AI-written post and approve it in one click

POST! approval screen — AI-written posts with product carousels waiting for review POST! approval screen — a post approved and queued, nothing posted yet

The local approval screen (http://localhost:8782) — real UI, shown here with demo (Sample Store) products.

Self-hosted. Single-tenant. You own your data and your tokens. No SaaS in the loop except the Anthropic API for caption writing.

日本語版はこちら → README.ja.md

Disclaimer: This is an unofficial tool not affiliated with Meta, Instagram, or Threads. Use it in compliance with the Meta Platform Policy and Instagram's Terms of Use. The author is not responsible for any account suspension or API access revocation.


How it works (1 minute)

Each day the tool:

  1. Picks a product from your Shopify catalog (rotating, so you don't repeat the same item for weeks).
  2. Builds a carousel from the product's images.
  3. Writes a caption with Claude (Anthropic).
  4. Runs guards (dedup, burst limits, safety checks).
  5. Shows you a preview at http://localhost:8782 for one-click approval.
  6. Publishes to Instagram and/or Threads only after you approve.
  7. Records everything to an append-only ledger.

Nothing goes live without your explicit approval.

Architecture

Shopify catalog
      │
      ▼
   select        ← rotates products (cooldown so items don't repeat)
      │
      ▼
  carousel        ← assembles image slides
      │
      ▼
  caption (Claude) ← writes the post text
      │
      ▼
   guard          ← dedup / burst / safety checks
      │
      ▼
  preview (approval UI :8782)  ← YOU approve here
      │
      ▼
  publish (IG / Threads)       ← only fires after approval
      │
      ▼
   ledger          ← append-only record of what posted
flowchart TD
  A[Shopify catalog] --> B[select]
  B --> C[carousel]
  C --> D["caption (Claude)"]
  D --> E[guard]
  E --> F["preview / approval UI :8782"]
  F -->|you approve| G["publish (IG / Threads)"]
  G --> H[ledger]
Loading

Quick start

0. Clone

git clone https://github.com/veinsystem/post.git
cd post

1. Configure

Run the setup wizard — it writes .env and config.json for you:

node bin/init.js

It asks for your Shopify domain + Admin token, brand name, IG handle, IG/Threads tokens, your Anthropic key, and Cloudflare R2 settings (for public image URLs). See docs/setup_meta_tokens.md for how to obtain the Meta (Instagram/Threads) tokens.

Non-interactive smoke test (CI / trying it out): node bin/init.js --defaults --dry writes files with dummy values and skips any network calls.

2. Run with Docker (recommended)

# Build the image
docker compose build

# Generate today's post plan (dry-run — safe, writes nothing live)
docker compose run --rm daily

# Start the approval UI at http://localhost:8782
docker compose up -d preview

Open http://localhost:8782, review the post, and approve. The publish service (started with docker compose up -d publish) dispatches approved posts every 15 minutes. Actual posting only happens when you run publish.js --live and have approved a post — see the comments in docker-compose.yml.

3. Or run with plain Node

npm ci
DRY_RUN=1 node run-daily.js --dry-run    # generate a dry-run plan
node gen-preview.js                       # serve the approval UI (:8782)

Scheduling

See docs/cron.example for cron entries that generate the daily plan and poll the publish queue.


FAQ

Q: My tokens keep expiring. Why? A: Instagram Graph and Threads long-lived tokens expire after 60 days. Refresh them before they lapse with node modules/cli/token-refresh.js (Threads) — the tool warns you when fewer than 7 days remain. Check status any time with node modules/cli/token-check.js. See docs/setup_meta_tokens.md.

Q: What is R2 and why do I need it? A: Instagram and Threads APIs require publicly reachable HTTPS image URLs — they fetch your images by URL, so localhost won't work. Cloudflare R2 is object storage with a free 10 GB tier that gives you those URLs. The tool signs uploads itself (no extra dependency). If you already run a public static server, you can use HOSTING_MODE=local_static instead.

Q: How does the approval flow work? A: The tool generates a plan and a preview page but never posts on its own. You open http://localhost:8782, see exactly how the post will look, and click approve. Only approved posts enter the publish queue, and live posting requires the --live flag. Two gates keep you in control.

Q: How do I get a different product every day? A: select tracks a rotation cursor and a cooldown (default 14 days in config.json), so it advances through your catalog and won't repeat an item until the cooldown passes.

Q: Do I have to use both Instagram and Threads? A: No. Configure at least one. config.json's media block toggles channels; the wizard defaults to Threads on. Provide a token for whichever channel(s) you want.


Built by @masanorimutomk2 — AI秘書 (AI Chief-of-Staff): DM me on X → https://x.com/masanorimutomk2

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages