Loading repository data…
Loading repository data…
raestrada / repository
StoryCraftr is an open-source AI-powered tool that helps writers craft stories, generate worldbuilding details, and create book outlines and chapters seamlessly through a simple CLI. Empower your creativity with AI!
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
Welcome to StoryCraftr, the open-source project designed to revolutionize how books are written. With the power of AI and a streamlined command-line interface (CLI), StoryCraftr helps you craft your story, manage worldbuilding, structure your book, and generate chapters — all while keeping you in full control.
AI Craftr is now available as a powerful suite for AI-assisted writing, featuring specialized tools like StoryCraftr for novelists and PaperCraftr for researchers. Each tool is designed to simplify your writing process with unique features catered to different types of content. Explore PaperCraftr for structuring academic papers, or stay tuned as we add more tools to the AI Craftr suite, such as LegalCraftr for legal documents and EduCraftr for educational materials.
You can find the release notes for version v0.12.0-beta10 here.
First, install StoryCraftr using pipx, a tool to help you install and run Python applications in isolated environments. It works on most platforms, including macOS, Linux, and Windows. Using pipx ensures that StoryCraftr runs in its own virtual environment, keeping your system's Python installation clean.
To install StoryCraftr, run the following command:
pipx install git+https://github.com/raestrada/storycraftr.git@v0.12.0-beta10
Alternatively, if you have uv and uvx installed on your system, you can run storycraftr without installing it first:
uvx --from git+https://github.com/raestrada/storycraftr.git@v0.12.0-beta10 storycraftr
StoryCraftr now uses LangChain and supports OpenAI, OpenRouter, and Ollama out of the box. Credentials are discovered automatically from environment variables or text files inside ~/.storycraftr/ or ~/.papercraftr/.
# OpenAI
mkdir -p ~/.storycraftr
echo "sk-your-openai-secret" > ~/.storycraftr/openai_api_key.txt
# OpenRouter
echo "or-your-openrouter-secret" > ~/.storycraftr/openrouter_api_key.txt
# Ollama usually runs locally and does not require a key.
export OLLAMA_BASE_URL="http://localhost:11434"
You can also set the variables directly (OPENAI_API_KEY, OPENROUTER_API_KEY, OLLAMA_API_KEY) before invoking the CLI.
Each project stores its configuration in storycraftr.json or papercraftr.json. New projects include LangChain-centric settings:
{
"llm_provider": "openai",
"llm_model": "gpt-4o",
"llm_endpoint": "",
"llm_api_key_env": "",
"temperature": 0.7,
"request_timeout": 120,
"embed_model": "BAAI/bge-large-en-v1.5",
"embed_device": "auto",
"embed_cache_dir": ""
}
llm_provider accepts openai, openrouter, or ollama.llm_endpoint lets you target custom bases (e.g., https://openrouter.ai/api/v1).embed_model defaults to BAAI/bge-large-en-v1.5 for OpenAI-quality local embeddings. Use a lighter model (e.g., sentence-transformers/all-MiniLM-L6-v2) on constrained hardware.ChatOpenAI via OPENAI_API_KEY; set llm_provider=openai.OPENROUTER_API_KEY and optionally OPENROUTER_BASE_URL; use llm_provider=openrouter.ollama serve; set llm_provider=ollama and optionally OLLAMA_BASE_URL.Here are a few ways to get started with StoryCraftr:
storycraftr init "La purga de los dioses" \
--primary-language "es" \
--alternate-languages "en" \
--author "Rodrigo Estrada" \
--genre "science fiction" \
--behavior "behavior.txt" \
--llm-provider "openrouter" \
--llm-model "meta-llama/llama-3.1-70b-instruct" \
--embed-model "BAAI/bge-large-en-v1.5"
storycraftr outline general-outline "Summarize the overall plot of a dystopian science fiction where advanced technology, resembling magic, has led to the fall of humanity’s elite and the rise of a manipulative villain who seeks to destroy both the ruling class and the workers."
Whether you're brainstorming ideas, refining your story, or just need a little creative spark, Chat!!! is here to help. It's a straightforward, easy-to-use feature that lets you dive deep into meaningful discussions, unlock new insights, and get your thoughts flowing effortlessly.
🚀 Sometimes, all you need is a little chat to get the gears turning! Try it out and watch your creativity soar!

For a complete guide, including more examples and instructions on how to fully leverage StoryCraftr, visit our Getting Started page:
Writing a book is a journey that involves not only creativity but also structure, consistency, and planning. StoryCraftr is here to assist you with:
With StoryCraftr, you'll never feel stuck again. Let AI guide your creative process, generate ideas, and help you bring your world and characters to life.
The StoryCraftr Chat feature allows users to engage directly with an AI assistant, helping to brainstorm, refine, and improve your book in real time. The chat supports various commands for outlining, iterating, and world-building, making it a powerful tool for writers to create and enhance their stories interactively.
Iterate: Refine character names, motivations, and even insert new chapters mid-book.
Example:
!iterate insert-chapter 3 "Add a flashback between chapters 2 and 3."
Outline: Generate the general plot, chapter summaries, or key plot points.
Example:
!outline general-outline "Summarize the overall plot of a dystopian sci-fi novel."
Worldbuilding: Build the world’s history, geography, and technology, or develop the magic system.
Example:
!worldbuilding magic-system "Describe the 'magic' system based on advanced technology."
Chapters: Write new chapters or adjust existing ones and generate cover text.
Example:
!chapters chapter 1 "Write chapter 1 based on the synopsis."
You can start a chat session with the assistant using:
storycraftr chat --book-path /path/to/your/book
For help with available commands during the session, simply type:
help()
We are excited to introduce the StoryCraftr VSCode extension, designed to seamlessly integrate the StoryCraftr CLI into your development environment. This extension allows you to interact with StoryCraftr directly from VSCode, offering powerful tools for novel writing and AI-assisted creativity.
storycraftr.json is present in the project root, ensuring the project is ready to use.You can install the StoryCraftr VSCode extension directly from the Visual Studio Marketplace.
Once installed, the extension will:
storycraftr.json exists in the root of your project.chat command using:
Start StoryCraftr Chat.Explore more about the StoryCraftr CLI and see how it can boost your storytelling workflow.
Let your creativity flow with the power of AI! ✨
We welcome contributions of all kinds! Whether you’re a developer, writer, or simply interested in improving the tool, you can help. Here’s how you can contribute:
git checkout -b feature/YourFeature
Make your changes, ensuring all tests pass.
Submit a pull request detailing your changes.
Join us on this journey to create an amazing open-source tool for writers everywhere. Together, we can make StoryCraftr the go-to AI writing assistant! 💡
StoryCraftr is part of the AI Craftr suite, an open-source set of tools designed to assist with creative and academic writing. AI Craftr enhances the productivity of writers, researchers, and educators, providing advanced tools for content creation.

You can learn more about AI Craftr and discover other tools like PaperCraftr for academic writing at https://aicraftr.app.