npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

seshat-scribe

v3.0.1

Published

AI-powered blog content generation for Sanity CMS using Google Gemini

Readme

Seshat

AI-powered automatic content generation for Sanity CMS. Seshat analyzes your existing content, generates new blog posts using Google Gemini, and publishes directly to Sanity. Automatic generation and publication via GitHub Actions on a schedule.

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
  • Sanity Integration: Automatic image upload and document creation in Portable Text format
  • Smart Generation: Creates complete articles as Portable Text with optional hero images
  • GitHub Actions Integration: Automate content creation on a schedule
  • Type-Safe: Built with TypeScript and Zod for runtime validation

Installation

npm install -g seshat-scribe

Or use directly:

npx seshat-scribe init

Quick Start

1. Initialize

cd your-blog-project
seshat init

The interactive wizard will guide you through Sanity CMS configuration:

  • Choose between quick setup (recommended defaults) or custom configuration
  • Enter your Sanity project ID, dataset, and API version
  • Configure content generation options (optional)

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

Sanity Write Token (required):

export SANITY_WRITE_TOKEN="your_sanity_token_here"

3. Generate Content

seshat write

Preview without saving:

seshat write --dry-run

Configuration

Seshat uses seshat.config.json for configuration. The wizard creates this automatically, but you can also edit it manually.

Example Configuration

{
  "topic": "Software Engineering and Technology",
  "tone": "Professional yet approachable",
  "sanity": {
    "projectId": "your-project-id",
    "dataset": "production",
    "apiVersion": "2024-01-01",
    "documentType": "post"
  },
  "generation": {
    "enableImageGeneration": true,
    "targetWordCount": 1500
  }
}

Core Settings

  • topic: Global topic constraint for content generation
  • tone: Writing style and voice
  • sanity: Sanity CMS configuration (required)
    • projectId: Your Sanity project ID
    • dataset: Dataset name (default: "production")
    • apiVersion: API version (default: "2024-01-01")
    • documentType: Document type to create (default: "post")

Content Generation

  • generation.enableImageGeneration: Enable/disable AI image generation (default: true). Set to false for text-only posts if using free Gemini API tier
  • generation.targetWordCount: Target word count (optional)
  • generation.includeCodeExamples: Emphasize code examples
  • generation.seoOptimized: Generate SEO-optimized content
  • generation.customInstructions: Additional instructions for AI

Example for free tier (text-only):

{
  "generation": {
    "enableImageGeneration": false,
    "targetWordCount": 1500,
    "includeCodeExamples": true
  }
}

Image Format

  • imageFormat: png, jpg, or svg (default: png)

GitHub Actions Automation

Automate content generation on a schedule:

Setup

seshat setup-workflow

This 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 key (required)
  • SANITY_WRITE_TOKEN: Your Sanity write token (required)

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 init

seshat write

Generate a new blog post:

seshat write
seshat write --dry-run  # Preview without saving
seshat write -t "Custom Topic"  # Override topic for this post

seshat setup-workflow

Create or update GitHub Actions workflow:

seshat setup-workflow

How It Works

  1. Analysis: Scans existing content from 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 as Portable Text
  4. Illustration (optional): Creates a hero image using Gemini's image generation (if enabled and API supports it)
  5. Publishing: Uploads content and images to Sanity CMS

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 (required)
  • Sanity CMS project

Migrating from 0.x

Version 1.0.0 is a breaking change that removes local file support and focuses exclusively on Sanity CMS.

If you're upgrading from 0.x:

  1. Run seshat init to create a new Sanity-only configuration
  2. Remove old config fields: outputMode, contentDir, assetsDir, publicAssetPath, framework, fileExtension, fileNameTemplate, nestedDirectories, frontmatter
  3. Ensure sanity configuration is present and valid
  4. Set SANITY_WRITE_TOKEN environment variable

License

MIT