diff --git a/templates/run_details.html b/templates/run_details.html
index 7e105da..9f2c435 100644
--- a/templates/run_details.html
+++ b/templates/run_details.html
@@ -10,6 +10,9 @@
+
+ Download Bible
+
diff --git a/web/routes/run.py b/web/routes/run.py
index 5fb5116..117b2e9 100644
--- a/web/routes/run.py
+++ b/web/routes/run.py
@@ -393,6 +393,27 @@ def revise_book(run_id, book_folder):
return redirect(url_for('run.view_run', id=new_run.id))
+@run_bp.route('/run//download_bible')
+@login_required
+def download_bible(id):
+ run = db.session.get(Run, id)
+ if not run: return "Run not found", 404
+ if run.project.user_id != current_user.id: return "Unauthorized", 403
+
+ bible_path = os.path.join(run.project.folder_path, "bible.json")
+ if not os.path.exists(bible_path):
+ return "Bible file not found", 404
+
+ safe_name = utils.sanitize_filename(run.project.name or "project")
+ download_name = f"bible_{safe_name}.json"
+ return send_from_directory(
+ os.path.dirname(bible_path),
+ os.path.basename(bible_path),
+ as_attachment=True,
+ download_name=download_name
+ )
+
+
@run_bp.route('/project//regenerate_artifacts', methods=['POST'])
@login_required
def regenerate_artifacts(run_id):