SPOUT Scripting
The scripting system allows you to create complex text generation pipelines by combining SPOUT's modules. This guide will help you get started with setting up and running script examples.
Scripting Directory Structure
The scripting directory is organized as follows:
scripting/
├── example_novel_writer/ # Book generation pipeline
├── example_phrase_factory/ # Marketing phrase generator
├── example_text_factory/ # Test content generator
├── example_evolution_pipeline/# Text evolution system
└── output/ # Generated content output
└── package.json # Node.js dependencies
Each example folder contains:
- Main script file (
.mjs
) - README with detailed documentation
Any folder starting with
example_
will be tracked by Git, so if you want to add your own scripts just make sure they have a different name or prefix to avoid conflicts when SPOUT updates.Setup
- Install Dependencies First, ensure you have Node.js installed, then:
# Navigate to scripting directory
cd scripting
# Install required packages
npm install
# Verify SPOUT CLI is accessible
spout -h
- Configure Environment Make sure your environment has:
- SPOUT CLI with all modules installed
- Write access to output directory
- Sufficient memory for parallel processing
Running Scripts
All examples can be run using npm script shortcuts:
npm run example_name:quick
or Run an example directly
cd example_text_factory && zx text_factory.mjs --threads 2
Available Examples
📚 Novel Writer
- Generates complete books using ⬠I Imagine and ⬠Σ Expand
- Creates chapter-based narratives with dialogue
- Supports multiple genres and styles
🏭 Phrase Factory
- Multi-threaded phrase generation with ⬠Μ Mutate
- Tournament-style evaluation using ⬠Ε Evaluate
- Perfect for marketing content
📝 Text Factory
- Generates varied test content
- Uses theme-based generation
- Supports multi-threaded processing
🔄 Evolution Pipeline
- Evolves text through multiple iterations
- Uses ⬠Μ Mutate and ⬠Ε Evaluate
- Maintains context with ⬠Δ Describe
Table of Contents