Skip to content

amitayks/Muse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

52 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎭 Muse

Your AI Content Partner, Right in Telegram

Cloudflare Workers Gemini AI TypeScript Telegram X/Twitter Instagram


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.


What Can Muse Do?

🧬 Identity-Aware AI β€” Content That Sounds Like You

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

πŸ”„ Watch Your Repos β€” Auto-Generate Content from Code

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 X Accounts β€” AI-Powered Smart Reposting

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

πŸ“Έ Multi-Platform Publishing β€” X + Instagram

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

✍️ Handwrite β€” Compose with AI Assistance

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

πŸ“… Schedule β€” Calendar & Time Picker

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

🎬 Video Studio β€” AI Avatar Videos (Experimental)

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.

πŸ‘₯ Multi-Tenant β€” Bring Your Own Keys

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

How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                          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.


Features at a Glance

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

Prerequisites

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 repo scope
  • (Optional) HeyGen API key β€” For Video Studio (heygen.com)
  • (Optional) Instagram Business Account β€” For publishing to Instagram feed, stories, and reels

Installation

1. Clone the Repository

git clone https://github.com/amitayks/Muse.git
cd Muse

2. Install Dependencies

cd cloudflare-bot
npm install

3. Create Cloudflare Resources

# Create D1 database
npx wrangler d1 create content-bot-db

# Create R2 bucket
npx wrangler r2 bucket create content-bot-images

Take note of the database ID returned by the D1 create command.

4. Configure Wrangler

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"

5. Set Secrets

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: 50

Finding 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.

6. Deploy

cd cloudflare-bot
npx wrangler deploy

7. Initialize the Bot

Hit 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"

8. Run Migrations

curl -H "X-Admin-Secret: YOUR_ADMIN_SECRET" \
  "https://content-bot.YOUR_SUBDOMAIN.workers.dev/migrate"

9. Set Up GitHub Webhooks

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:

  1. Go to Settings > Webhooks > Add webhook
  2. Payload URL: https://content-bot.YOUR_SUBDOMAIN.workers.dev/github-webhook
  3. Content type: application/json
  4. Secret: The secret shown by the bot when you added the repo
  5. Events: Select "Pull requests" and "Pushes"

Configuration

Worker Secrets Reference

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)

Per-User API Keys (stored encrypted in D1)

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

Repository Settings

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%

Twitter Account Settings

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%

Commands

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

Architecture

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

Tech Stack

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

Database

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

Self-Hosted Philosophy

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%

License

MIT

About

🎭 Your AI content partner in Telegram. Muse turns code commits, followed X accounts, and your own ideas into ready-to-publish posts for X/Twitter & Instagram β€” with identity-aware AI and generated images. Self-hosted on Cloudflare Workers + Google Gemini.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors