opensourceprojects.dev

A broadsheet for software that doesn't ask for your email

Infinite Bookshelf generates full nonfiction books from a one-line prompt in sec...
GitHub RepoImpressions4

Project Description

View on GitHub

Infinite Bookshelf: Turn One Line Into a Full Nonfiction Book in Seconds

You know that feeling when a single idea could be a whole book, but writing it would take months? Infinite Bookshelf is a tool that does exactly the opposite: it starts with one line and outputs a complete, structured nonfiction book in seconds.

It’s not sci-fi. It’s a clever GitHub repo that chains together an LLM (like GPT or Claude) with a structured generation loop to build chapters, references, and even a table of contents. No hand-holding, no endless prompting weights. Just one prompt, one output.

What It Does

Infinite Bookshelf takes a single line of text (like “A beginner’s guide to quantum computing for coffee lovers”) and generates a full nonfiction book. We’re talking chapters, section headings, and coherent narratives — not just a wall of text. The output is structured, readable, and formatted like a real book.

Under the hood, it uses an LLM to first expand your one-liner into a detailed outline. Then it iteratively writes each chapter, using the outline and previous chapters as context. The result is a complete book in a single text file, ready to be edited, published, or used as a first draft.

Why It’s Cool

Speed is the obvious win. Generating a full book draft in seconds means you can iterate on ideas without committing to a month of writing. Pitched a book to a publisher? Need a quick prototype for a client? Explore dozens of book concepts in an afternoon.

The structure is actually good. Because Infinite Bookshelf first produces an outline, the final book has logical flow. It’s not just a stream of consciousness — it’s organized, with chapters that build on each other. For a tool that works with one line, that’s impressive.

It’s open source. You control the model, the API key, and the output format. No vendor lock-in, no pay-per-book nonsense. Fork it, tweak it, run it locally with your own model.

Use cases outside books. The core pattern — expand a short prompt into a structured multi-section document — applies to proposals, course outlines, technical manuals, even long-form blog posts. Infinite Bookshelf is a template for generative long-form content, not just books.

How to Try It

  1. Clone the repo:
    git clone https://github.com/Bklieger/infinite-bookshelf

  2. Install dependencies (Python, likely pip install -r requirements.txt)

  3. Set your OPENAI_API_KEY (or whichever model you’re using)

  4. Run:
    python generate_book.py --prompt "Your one line here"

That’s it. The book output will appear in a text file in the same directory.

Or skip the code and try the live demo linked in the repo README. It’s web-based, so you can test a few prompts before committing to local setup.

Final Thoughts

Infinite Bookshelf isn’t going to replace authors. But for developers, it’s a neat demonstration of what structured LLM prompting can do. If you’ve ever wanted to quickly prototype a nonfiction book — for a client, for a side project, or just to see what happens — this is the fastest path I’ve seen.

The code is clean, the design is smart, and the result is genuinely useful. Give it a prompt, see what comes out, and maybe use it as a skeleton for something bigger. At worst, you’ll waste a few API cents. At best, you’ll have a first draft in your hands before your coffee gets cold.


Follow @githubprojects for more dev-friendly project highlights.

Back to Projects
Project ID: f1ef42d0-dcbf-4e13-8b99-c26391b6dd52Last updated: July 22, 2026 at 02:45 AM