Your AI Content Partner, Right in Telegram
You ship code. You follow thought leaders. You have ideas.
Muse turns all of that into polished, ready-to-publish content for X/Twitter and Instagram β tweets, threads, images, carousels, stories, reels, quote-tweets, even AI avatar videos β and puts you in control through a slick Telegram dashboard.
No browser tabs. No copy-pasting. No context switching. Just push code, review in Telegram, publish with a tap.
Muse analyzes your X/Twitter history to build an "Identity Document" β a comprehensive profile of your writing style, tone spectrum, vocabulary patterns, and humor. Every piece of content Muse generates is shaped by this identity, so your posts sound like you, not a generic AI.
- One-tap identity analysis: During onboarding or anytime from Settings, Muse fetches your last 100 tweets and builds your voice profile
- First-person skills architecture: 9 specialized AI skills (work-progress, refine, quote, video, etc.) all write in your authentic voice
- Editable identity: View and tweak your Identity Document anytime β it's yours to shape
- Three-layer prompt assembly: Skill prompt + Identity Document + task protocol = content that nails your voice every time
Connect your GitHub repositories. Every time you merge a PR or push to main, Muse picks it up, understands the change in context, and drafts tweets with AI-generated images β ready for your review.
- Thread-aware: Big PRs with 3+ commits become Twitter threads, not a single cramped tweet
- Project-aware: Muse maintains a persistent understanding of your project (tech stack, audience, brand voice) and uses it to write content that actually sounds like it belongs to your project
- Smart images: AI generates original artwork for your posts β not stock photos, not screenshots β real visual content with structured art direction (style, mood, lighting, color palette)
- Configurable per repo: Language, hashtag style, branch filters, image probability, thread thresholds
Follow any X/Twitter account. Muse polls for new tweets with smart backoff and scores each one for relevance using AI.
- Relevance scoring: Gemini AI evaluates each tweet (1-10 scale) against the account's persona and your audience
- Smart polling backoff: Active accounts poll every 15 minutes; quiet accounts automatically back off (30min β 1hr β 2hr β 4hr cap), resetting instantly when new tweets appear
- Batch notifications: Paginated cards in Telegram β see score, preview, reason β tap to generate
- 6 tone personalities: Professional, Casual, Analytical, Enthusiastic, Witty, or Sarcastic β pick the voice that fits
- Media-aware: Muse fetches and analyzes images and video thumbnails from tweets before generating, so the AI actually "sees" what the original post is about
- Thread detection: Multi-tweet threads are consolidated and analyzed as a whole
- Auto-approve mode: Set a threshold and let Muse auto-generate reposts for the highest-scoring tweets
- Persona analysis: AI builds a profile of each account you follow β their topics, communication style, recurring themes β for better repost context
Every draft supports configurable publish targets. Publish to X/Twitter, Instagram (feed posts, stories, reels), or any combination β each platform independently handled with partial failure support.
- Instagram Feed Posts: Single images publish as photo posts; multi-tweet threads become carousels
- Instagram Stories: Images rendered at 9:16 aspect ratio with blurred background treatment
- Instagram Reels: Video media published as reels
- Tweet Card Rendering: When no image exists, Muse renders your tweet content as styled card images (via Satori) β with thread connecting lines, quote-tweet layouts, and author profile images
- Default platform settings: Configure which platforms new drafts target by default
- Per-draft overrides: Toggle platforms on/off for any individual draft before publishing
- Repost from published: Re-publish existing content to additional platforms
- Multi-image display: Draft detail shows all attached images β albums displayed in Telegram
Have an idea? Write it yourself. Muse gives you a live compose mode with character counts, optional AI text refinement, and image generation.
- Multi-tweet threads: Send multiple messages, Muse buffers them into a thread
- Per-tweet images: Attach photos to any tweet in the thread β all displayed in draft detail
- AI refine toggle: Let Gemini polish your writing while keeping your voice
- Image toggle: Generate an AI image or skip it β your call
Queue content for the perfect moment. Visual date picker (next 30 days) and hour/minute selector, all respecting your configured timezone.
- 15-minute cron: Muse checks every 15 minutes and publishes anything that's due
- Failure recovery: If a publish fails, the draft goes back to draft status for retry
- Dashboard preview: Home screen shows your next scheduled post at a glance
Turn your commits into narrated video updates with AI-generated avatars. Script generation, character management, emotion control, and multi-platform publishing.
- AI script generation: Gemini writes narration + scene descriptions from your commit history
- Avatar customization: Choose characters, looks, voices, emotions (Excited, Friendly, Serious, Soothing, Broadcaster)
- Flexible formats: 9:16 (Reels/Shorts), 16:9 (YouTube), 1:1 (Feed)
- Multi-platform: Publish to X/Twitter, Instagram, or both
- Presets: Save video configs as reusable templates
Video generation is currently powered by HeyGen and will be transitioning to Seedance 2.0 for a fully integrated experience.
Muse supports multiple users on a single bot instance. Each user goes through a guided onboarding flow and provides their own API keys, which are encrypted at rest with AES-256-GCM.
- Guided onboarding: Step-by-step setup β X/Twitter first (unlocks repost, handwrite, identity), then identity analysis, then Gemini, then optional GitHub
- Language selection: English or Hebrew, auto-detected from Telegram and selectable on the welcome screen
- Feature unlock framing: Each onboarding step shows what it unlocks, not just dry instructions
- Identity analysis during onboarding: After connecting X, Muse analyzes your tweets and shows a preview of your Identity Document
- Per-user encryption: All API keys are encrypted individually per user in D1
- Settings UI: Manage and update keys anytime via Settings > API Keys
- Optional integrations: HeyGen and Instagram keys can be added later
- Isolated data: Each user's repos, drafts, accounts, and videos are scoped to their chat ID
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β YOUR WORKFLOW β
β β
β GitHub Push/PR βββ β
β βΌ β
β ββββββββββββββ βββββββββββββ ββββββββββββββββ β
β β Cloudflare βββββΆβ Gemini βββββΆβ Telegram β β
β β Worker β β AI β β Dashboard β β
β β (content- β β (content β β (review, β β
β β bot) β β + images) β β approve, β β
β βββββββ¬βββββββ βββββββββββββ β schedule) β β
β β ββββββββ¬ββββββββ β
β X Account ββββββββ€ Cron: every 15 min β β
β Tweets β β’ Poll followed accounts βΌ β
β β (smart backoff) βββββββββββββββββ β
β Your Identity ββββ€ β’ Score with AI β X/Twitter β β
β Document β β’ Send notifications β Instagram β β
β β β’ Publish scheduled β Published! β β
β β β’ Check stale videos βββββββββββββββββ β
β β β
β User Keys ββββββββ Per-user encrypted in D1 β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Muse runs as two Cloudflare Workers. The main content-bot Worker holds all the bot
logic and has a */15 * * * * cron trigger; a dedicated render-worker holds the heavy
Satori/resvg image stack and is invoked over a service binding (RPC), so its ~3.4 MB of
code + WASM stays out of content-bot's cold-start path:
| Component | What it does |
|---|---|
content-bot β HTTP routes |
Telegram webhook, GitHub webhook, HeyGen webhook, media serving, setup, migrations |
content-bot β Cron (every 15 min) |
Polls X accounts (with smart backoff), scores tweets, publishes scheduled drafts, checks stale videos, publishes scheduled videos β all users processed in parallel via Promise.allSettled |
render-worker β RPC |
Renders tweet cards / threads / quote cards / 9:16 stories (Satori β resvg PNG). Internal-only; cold-starts only when an image is actually rendered |
content-bot has zero runtime dependencies β pure Cloudflare Workers API, ~267 KB gzip,
compiled to ES modules. The Satori/resvg npm packages live only in render-worker.
| Feature | Description |
|---|---|
| Identity-aware AI | Analyzes your tweets to write in your authentic voice |
| Auto-generate from commits | GitHub webhook triggers AI content + image |
| Multi-platform publish | X/Twitter + Instagram (feed, stories, reels) |
| Tweet card renderer | Styled tweet images via Satori for Instagram |
| Smart repost | Follow accounts, AI scores & generates quote-tweets |
| Smart polling backoff | Quiet accounts polled less frequently (30min β 4hr cap) |
| Handwrite mode | Compose tweets manually with per-tweet images and optional AI assist |
| Thread detection | Big PRs become multi-tweet threads automatically |
| AI image generation | Structured art direction (style, mood, palette) |
| Media analysis | Analyzes images/video thumbnails in source tweets |
| 6 tone modes | Professional, Casual, Analytical, Enthusiastic, Witty, Sarcastic |
| Scheduling | Calendar + time picker with timezone support |
| Project context | Persistent overview that learns your codebase |
| Persona analysis | AI profiles for followed accounts |
| Auto-approve | Hands-free mode for high-scoring tweets |
| Video Studio | AI avatar videos from commit history |
| Multi-tenant | Multiple users, per-user encrypted API keys |
| Multi-language | English and Hebrew support (auto-detected) |
| Per-entity config | Different settings per repo and per account |
| Default platform targets | Configure which platforms new drafts target |
Before you start, you'll need:
- Cloudflare account β Sign up free (Workers free tier: 100K requests/day)
- Telegram bot β Create one via @BotFather and get the token
- Node.js 18+ and npm (for deployment tooling)
Each user provides their own API keys during onboarding:
- X/Twitter API credentials β Apply at the Developer Portal (OAuth 1.0a with read+write)
- Google Gemini API key β Get one here
- (Optional) GitHub personal access token β Create one with
reposcope - (Optional) HeyGen API key β For Video Studio (heygen.com)
- (Optional) Instagram Business Account β For publishing to Instagram feed, stories, and reels
git clone https://github.com/amitayks/Muse.git
cd Musecd cloudflare-bot
npm install# Create D1 database
npx wrangler d1 create content-bot-db
# Create R2 bucket
npx wrangler r2 bucket create content-bot-imagesTake note of the database ID returned by the D1 create command.
Update cloudflare-bot/wrangler.toml with your database ID:
name = "content-bot"
main = "src/index.ts"
compatibility_date = "2024-12-18"
[triggers]
crons = ["*/15 * * * *"] # Every 15 minutes
[[d1_databases]]
binding = "DB"
database_name = "content-bot-db"
database_id = "YOUR_DATABASE_ID_HERE"
[[r2_buckets]]
binding = "IMAGES"
bucket_name = "content-bot-images"Only infrastructure secrets are set as Worker secrets. Per-user API keys (X, Gemini, GitHub, etc.) are provided by each user during onboarding and stored encrypted in D1.
cd cloudflare-bot
# Required
npx wrangler secret put TELEGRAM_BOT_TOKEN
npx wrangler secret put TELEGRAM_CHAT_ID # Admin's Telegram user ID
npx wrangler secret put ENCRYPTION_KEY # openssl rand -base64 32
npx wrangler secret put ADMIN_SECRET # openssl rand -hex 32
npx wrangler secret put WORKER_URL # https://content-bot.YOUR_SUBDOMAIN.workers.dev
# Optional
npx wrangler secret put MAX_USERS # Default: 50Finding your Telegram Chat ID: Send any message to your bot, then visit
https://api.telegram.org/bot<YOUR_TOKEN>/getUpdatesβ your chat ID will be in the response.
cd cloudflare-bot
npx wrangler deployHit the setup endpoint to register the Telegram webhook and bot commands. The
secret goes in the X-Admin-Secret header (not a ?secret= query param β the
route reads the header, so a query param returns Unauthorized):
curl -H "X-Admin-Secret: YOUR_ADMIN_SECRET" \
"https://content-bot.YOUR_SUBDOMAIN.workers.dev/setup"curl -H "X-Admin-Secret: YOUR_ADMIN_SECRET" \
"https://content-bot.YOUR_SUBDOMAIN.workers.dev/migrate"GitHub webhooks are configured per-user per-repo through the Telegram dashboard. When a user adds a repo via /watch owner/repo, Muse auto-generates a unique webhook secret and provides setup instructions. Each repo has its own webhook secret stored in D1.
In your GitHub repository settings:
- Go to Settings > Webhooks > Add webhook
- Payload URL:
https://content-bot.YOUR_SUBDOMAIN.workers.dev/github-webhook - Content type:
application/json - Secret: The secret shown by the bot when you added the repo
- Events: Select "Pull requests" and "Pushes"
These are the only secrets stored as Cloudflare Worker secrets. All per-user API keys are encrypted in D1.
| Secret | Required | Description |
|---|---|---|
TELEGRAM_BOT_TOKEN |
Yes | Bot token from @BotFather |
TELEGRAM_CHAT_ID |
Yes | Admin's Telegram user ID |
ENCRYPTION_KEY |
Yes | 32-byte base64 key for AES-256-GCM encryption (openssl rand -base64 32) |
ADMIN_SECRET |
Yes | Protects /setup and /migrate endpoints |
WORKER_URL |
Yes | Full URL of this worker (e.g., https://content-bot.your-subdomain.workers.dev) |
MAX_USERS |
No | Maximum registered users (default: 50) |
Each user provides these through the onboarding flow or Settings > API Keys:
| Key | Required | Description |
|---|---|---|
| X API key + secret | Yes | X/Twitter OAuth 1.0a consumer credentials |
| X access token + secret | Yes | X/Twitter OAuth 1.0a access credentials |
| Gemini API key | Yes | Google Gemini for AI content + image generation |
| GitHub token | No | PAT with repo scope (for auto-generate from commits) |
| HeyGen API key | No | For Video Studio |
| Instagram token + account ID | No | For publishing to Instagram feed, stories, and reels |
Each watched repo has independent configuration, adjustable via the Telegram dashboard:
| Setting | Default | Options |
|---|---|---|
| Language | English | EN / HE |
| Hashtags | On | Toggle |
| Watch PRs | On | Toggle |
| Watch Pushes | Off | Toggle |
| Branches | main |
Configurable |
| Min commits for thread | 3 | Number |
| Max tweets per thread | 10 | Number |
| Always generate image | On (threads) | Toggle |
| Single tweet image probability | 70% | 0-100% |
Each followed X account has independent configuration:
| Setting | Default | Options |
|---|---|---|
| Language | English | EN / HE |
| Tone | Professional | Professional, Casual, Analytical, Enthusiastic, Witty, Sarcastic |
| Hashtags | On | Toggle |
| Relevance threshold | 6/10 | 1-10 |
| Auto-approve | Off | Toggle |
| Batch page size | 5 | Number |
| Media AI | On | Toggle |
| Always generate image | Off | Toggle |
| Image probability | 30% | 0-100% |
| Command | Description |
|---|---|
/start |
Open the dashboard |
/help |
Show help and workflow guide |
/generate <sha> |
Generate content from a commit SHA or PR number |
/repost <url> |
Create a quote-tweet from any X post URL |
/handwrite |
Enter compose mode to write tweets manually |
/drafts |
Browse all drafts by category |
/approve |
Publish all approved drafts now |
/schedule |
Schedule a draft for later |
/repos |
Manage watched GitHub repositories |
/watch <owner/repo> |
Start watching a new repository |
/overview <owner/repo> |
Bootstrap project context from README + recent PRs |
/delete <sha> |
Delete a published post |
Muse/
βββ cloudflare-bot/ # Main Cloudflare Worker (bot logic; calls render-worker via RENDER binding)
β βββ src/
β β βββ index.ts # HTTP router + cron entry point
β β βββ types.ts # Shared type definitions
β β βββ core/
β β β βββ router.ts # Command/callback/input dispatcher
β β β βββ publish.ts # Multi-platform publish pipeline
β β β βββ respond.ts # Telegram response helper
β β βββ ai/
β β β βββ gemini.ts # Gemini AI content + image generation
β β β βββ identity.ts # Identity analysis & skill assembly
β β βββ commands/ # /slash command handlers
β β βββ handlers/
β β β βββ cron.ts # Cron coordinator + per-user tasks
β β β βββ callback.ts # Telegram callback query handler
β β β βββ message.ts # Telegram message handler
β β β βββ github-webhook.ts # GitHub webhook processing
β β βββ actions/ # Callback button handlers
β β β βββ platform-toggle.ts # Multi-platform target toggles
β β β βββ ...
β β βββ inputs/ # Text input state handlers
β β βββ views/ # Telegram UI templates
β β β βββ home.ts # Dashboard home screen
β β β βββ onboarding.ts # New user onboarding flow
β β β βββ settings.ts # API keys & settings UI
β β β βββ platform-toggle.ts # Platform target UI
β β β βββ ... # Drafts, repos, accounts, video views
β β βββ integrations/
β β β βββ telegram.ts # Telegram Bot API
β β β βββ x.ts # X/Twitter API (OAuth 1.0a)
β β β βββ github.ts # GitHub API
β β βββ services/
β β β βββ instagram-publish.ts # Instagram feed/story/reel publishing
β β β βββ tweet-card.ts # Thin client β render-worker (RENDER binding) + R2 card storage
β β β βββ render-contract.ts # Shared render RPC types (mirrors render-worker/src/contract.ts)
β β β βββ poller.ts # Twitter polling with smart backoff
β β β βββ auto-approve.ts # Auto-generate + approve
β β β βββ video-publish.ts # Multi-platform video publishing
β β β βββ ...
β β βββ data/
β β β βββ draft-db.ts # Drafts & published records
β β β βββ user-db.ts # Users, keys, settings
β β β βββ twitter-db.ts # X accounts & tweets
β β β βββ persona-db.ts # Persona cache
β β β βββ ...
β β βββ infra/
β β β βββ crypto.ts # AES-256-GCM encryption
β β β βββ security.ts # Rate limiting, validation
β β β βββ ...
β β βββ routes/ # HTTP route handlers
β β βββ webhook.ts # Telegram webhook endpoint
β β βββ media.ts # R2 media serving
β β βββ ...
β βββ migrations/ # D1 SQL migrations
β βββ schema.sql # Full database schema
β βββ wrangler.toml
β
βββ render-worker/ # Internal-only Worker: Satori/resvg image rendering (RPC)
β βββ src/
β β βββ index.ts # RenderService (WorkerEntrypoint) β RPC methods
β β βββ renderer.ts # Satori/resvg tweet-card/thread/quote/story rendering
β β βββ contract.ts # Render RPC types + RenderEnv
β βββ wrangler.toml
β
βββ openspec/ # Specification-driven development
β βββ specs/ # Capability specifications
β βββ changes/ # Change artifacts (proposals, designs, tasks)
β
βββ README.md
| Layer | Technology |
|---|---|
| Runtime | Cloudflare Workers (ES modules) |
| Database | Cloudflare D1 (SQLite) |
| Object Storage | Cloudflare R2 |
| AI | Google Gemini (text + image generation) |
| Image Rendering | Satori (JSXβSVG) + resvg-wasm (SVGβPNG), in a dedicated render-worker (service binding) |
| Bot Interface | Telegram Bot API |
| Social Platforms | X/Twitter API v2 + v1.1, Instagram Graph API |
| Video | HeyGen API v2 (transitioning to Seedance 2.0) |
| Encryption | AES-256-GCM (Web Crypto API) |
| Language | TypeScript 5.7 |
| Build | Wrangler |
Indexed tables across 6 domains:
- Users:
users(identity, encrypted keys, settings, UI state) - Content:
drafts,published,repos,repo_overviews - Twitter:
twitter_accounts,twitter_tweets,twitter_account_overviews - Video:
video_drafts,video_published,video_presets - Prompts:
default_prompts,user_prompts - System:
persona_cache
Muse is designed to be your bot, on your infrastructure:
- Users own their API keys β each user provides and manages their own credentials, encrypted at rest with AES-256-GCM
- You own your data β everything lives in your D1 database and R2 bucket
- You control the costs β Cloudflare's free tier is generous (100K Worker requests/day, 5GB D1, 10GB R2)
- You decide what publishes β nothing goes live without approval
- Zero vendor lock-in on content β tweets, drafts, images, all accessible in your database
- Multi-tenant by design β one bot instance serves multiple users, each with isolated data
- Smart resource usage β polling backs off automatically for quiet accounts, reducing API calls by 70-90%
MIT