The Autonomous Scribe for Static Blogs - AI-powered content generation using Google Gemini
npm install seshat-scribeAI-powered automatic content generation for blogs and headless CMS platforms. Seshat analyzes your existing content, generates new blog posts using Google Gemini, and publishes. Automatic generation and publication via Github Actions run on a schedule. Currently support local MDX files and Sanity CMS.
- Free to Use: Works with Google's free Gemini API tier for text generation, use paid tier for image generation
- AI-Powered Planning: Analyzes existing content to generate unique, non-duplicate topics
- BYOK - Bring Your Own Key, it will use your Gemini key to generate posts
- Flexible Output: Commit local MDX files or publish to Sanity CMS automatically
- Smart Generation: Creates complete articles with frontmatter and optional hero images
- Framework Support: Optional presets for Remix, Next.js, and Astro (or custom configuration)
- Flexible Configuration: Customizable frontmatter, file naming, and content generation options
- GitHub Actions Integration: Automate content creation on a schedule
- Type-Safe: Built with TypeScript and Zod for runtime validation
``bash`
npm install -g seshat-scribe
Or use directly:
`bash`
npx seshat-scribe init
`bash`
cd your-blog-project
seshat init
The interactive wizard will guide you through setup:
- Choose between quick setup (recommended defaults) or custom configuration
- Select output mode: local files or Sanity CMS
- Select framework preset (Remix, Next.js, Astro) or custom configuration
- Auto-detect existing blog structure if available
Get a free Google Gemini API key and add to your environment:
`bash`
export GEMINI_API_KEY="your_api_key_here"
Free vs Paid API Keys:
- Free tier: Generates text-only blog posts (no images)
- Paid tier: Generates blog posts with AI-generated hero images
By default, Seshat will attempt to generate images. To create text-only posts (for free tier), set enableImageGeneration: false in your config (see Configuration below).
For Sanity CMS, also set:
`bash`
export SANITY_WRITE_TOKEN="your_sanity_token_here"
`bash`
seshat write
Preview without saving:
`bash`
seshat write --dry-run
Seshat uses seshat.config.json for configuration. The wizard creates this automatically, but you can also edit it manually.
`json`
{
"topic": "Software Engineering and Technology",
"tone": "Professional yet approachable",
"framework": "remix",
"outputMode": "local"
}
- topic: Global topic constraint for content generationtone
- : Writing style and voiceframework
- : Optional preset - one of remix, next, astro, or custom for manual configuration. Framework presets configure frontmatter fields automatically, but are not requiredoutputMode
- : local or sanity
Required when outputMode is local:
`json`
{
"contentDir": "app/routes/blog",
"assetsDir": "public/images/generated",
"publicAssetPath": "/images/generated"
}
Required when outputMode is sanity:
`json`
{
"sanity": {
"projectId": "your-project-id",
"dataset": "production",
"apiVersion": "2024-01-01",
"documentType": "post"
}
}
File Structure
- fileExtension: mdx or mdimageFormat
- : png, jpg, or svgfileNameTemplate
- : e.g., {{slug}} or {{date}}-{{slug}}nestedDirectories
- : Use date-based nested directories
Frontmatter Customization
- frontmatter.dateField: Field name for date (e.g., date, pubDate)frontmatter.dateFormat
- : iso, date-only, or custom formatfrontmatter.imageField
- : Field name for imagefrontmatter.additionalFields
- : Custom metadata as key-value pairs
Content Generation
- generation.enableImageGeneration: Enable/disable AI image generation (default: true). Set to false for text-only posts if using free Gemini API tiergeneration.targetWordCount
- : Target word count (optional)generation.includeCodeExamples
- : Emphasize code examplesgeneration.seoOptimized
- : Generate SEO-optimized contentgeneration.customInstructions
- : Additional instructions for AI
Example for free tier (text-only):
`json`
{
"generation": {
"enableImageGeneration": false,
"targetWordCount": 1500,
"includeCodeExamples": true
}
}
Automate content generation on a schedule:
`bash`
seshat setup-workflow
This creates .github/workflows/seshat.yml based on your configuration.
Add these to your repository secrets (Settings → Secrets and Variables → Actions):
- GEMINI_API_KEY: Your Google Gemini API keySANITY_WRITE_TOKEN
- : Your Sanity write token (if using Sanity CMS)
This will run the Github action workflow to generate and publish posts automatically according to the defined schedule.
Edit the schedule field in seshat.config.json:
`json`
{
"schedule": "0 9 1"
}
Then run seshat setup-workflow again to update the workflow file.
Initialize configuration with interactive wizard:
`bash`
seshat init
Generate a new blog post:
`bash`
seshat write
seshat write --dry-run # Preview without saving
Create or update GitHub Actions workflow:
`bash``
seshat setup-workflow
1. Analysis: Scans existing content (local MDX files or Sanity CMS) to understand what you've written
2. Planning: Uses Google Gemini to propose a new, non-duplicate topic
3. Writing: Generates complete article with frontmatter (or Portable Text for Sanity)
4. Illustration (optional): Creates a hero image using Gemini's image generation (if enabled and API supports it)
5. Publishing: Saves to local files, uploads to Sanity CMS, or both
- Node.js v20+
- Free Google Gemini API key (Get one here - no credit card required)
- Free tier: Text generation only
- Paid tier: Text + AI image generation
- Sanity write token (if using Sanity CMS)