seshat-scribe
v0.7.3
Published
The Autonomous Scribe for Static Blogs - AI-powered content generation using Google Gemini
Maintainers
Readme
Seshat
AI-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.
Features
- 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
Installation
npm install -g seshat-scribeOr use directly:
npx seshat-scribe initQuick Start
1. Initialize
cd your-blog-project
seshat initThe 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
2. Configure API Keys
Get a free Google Gemini API key and add to your environment:
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:
export SANITY_WRITE_TOKEN="your_sanity_token_here"3. Generate Content
seshat writePreview without saving:
seshat write --dry-runConfiguration
Seshat uses seshat.config.json for configuration. The wizard creates this automatically, but you can also edit it manually.
Core Settings
{
"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 ofremix,next,astro, orcustomfor manual configuration. Framework presets configure frontmatter fields automatically, but are not requiredoutputMode:localorsanity
Local File Output
Required when outputMode is local:
{
"contentDir": "app/routes/blog",
"assetsDir": "public/images/generated",
"publicAssetPath": "/images/generated"
}Sanity CMS Output
Required when outputMode is sanity:
{
"sanity": {
"projectId": "your-project-id",
"dataset": "production",
"apiVersion": "2024-01-01",
"documentType": "post"
}
}Advanced Options
File Structure
fileExtension:mdxormdimageFormat:png,jpg, orsvgfileNameTemplate: 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 tofalsefor 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):
{
"generation": {
"enableImageGeneration": false,
"targetWordCount": 1500,
"includeCodeExamples": true
}
}GitHub Actions Automation
Automate content generation on a schedule:
Setup
seshat setup-workflowThis creates .github/workflows/seshat.yml based on your configuration.
Configure Secrets
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)
Customize Schedule
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:
{
"schedule": "0 9 * * 1"
}Then run seshat setup-workflow again to update the workflow file.
CLI Commands
seshat init
Initialize configuration with interactive wizard:
seshat initseshat write
Generate a new blog post:
seshat write
seshat write --dry-run # Preview without savingseshat setup-workflow
Create or update GitHub Actions workflow:
seshat setup-workflowHow It Works
- Analysis: Scans existing content (local MDX files or Sanity CMS) to understand what you've written
- Planning: Uses Google Gemini to propose a new, non-duplicate topic
- Writing: Generates complete article with frontmatter (or Portable Text for Sanity)
- Illustration (optional): Creates a hero image using Gemini's image generation (if enabled and API supports it)
- Publishing: Saves to local files, uploads to Sanity CMS, or both
Requirements
- 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)
