Skip to main content

A command-line interface Bible application for programmers

Project description

Bible CLI

A powerful command-line interface for Bible reading and study, designed specifically for programmers and terminal enthusiasts.

Features

  • ๐Ÿ” Fast Search - Full-text search with regex support and context
  • ๐Ÿ“– Multiple Translations - Support for various Bible translations
  • ๐ŸŽจ Rich Terminal UI - Beautiful ASCII art and interactive TUI
  • ๐Ÿ”– Bookmarks - Save and organize your favorite verses
  • ๐Ÿ“Š Reading History - Track your Bible reading progress
  • ๐Ÿ”ง MCP Integration - Model Context Protocol server for AI tools
  • โš™๏ธ Customizable - Extensive configuration options
  • ๐ŸŽฏ Developer-Friendly - Designed with programmers in mind
  • ๐Ÿ“ˆ Database Statistics - View Bible database information and statistics

Installation

From PyPI (when published)

pip install bibli
# or
pipx install bibli

From Source with UV (Recommended)

git clone https://github.com/guzus/bible-cli
cd bible-cli
uv sync

From Source with pip

git clone https://github.com/guzus/bible-cli
cd bible-cli
pip install -e .

Quick Start

# Read a specific verse
uv run bible read john 3:16

# Read a range of verses
uv run bible read genesis 1:1-5

# Read an entire chapter
uv run bible read psalms 23

# Search for verses
uv run bible search "love your enemies"

# View database information
uv run bible info

# Interactive mode
uv run bible

# Get help
uv run bible --help

Commands

Information Commands

  • bible info - Display Bible database information and statistics with ASCII art

Reading Commands

  • bible read <book> <chapter>:<verse> - Read specific verse(s)
  • bible goto <reference> - Jump directly to a reference
  • bible random - Display a random verse
  • bible daily - Show verse of the day
  • bible nav <book> <reference> - Navigate Bible interactively

Search Commands

  • bible search <query> - Search for words or phrases
    • --exact - Exact phrase matching
    • --case-sensitive - Case-sensitive search
    • --book <name> - Limit search to specific book
    • --testament <old|new> - Limit to testament
    • --context <n> - Show n verses of context
    • --limit <n> - Maximum number of results

Bookmark Commands

  • bible bookmarks - List saved bookmarks
  • bible bookmark add <reference> - Add bookmark
    • --name <name> - Bookmark name
    • --notes <notes> - Bookmark notes
  • bible history - Show reading history

Interactive Mode

Launch the Terminal User Interface:

uv run bible interactive
# or just
uv run bible

Keyboard Shortcuts

  • j/k or โ†“/โ†‘ - Navigate verses
  • h/l or โ†/โ†’ - Previous/Next chapter
  • Space/b - Page down/up
  • g - Go to verse
  • / - Search mode
  • r - Random verse
  • m - Bookmark current verse
  • ? - Help
  • q - Quit

Interactive Reader Navigation

When using --interactive flag with read commands:

  • n or Enter - Next verse
  • p - Previous verse
  • N - Next chapter
  • P - Previous chapter
  • g - Go to specific verse
  • b - Bookmark current verse
  • q - Quit

MCP Server

The Bible CLI includes a Model Context Protocol (MCP) server that allows AI applications like Claude to access Bible functionality directly.

Starting the MCP Server

uv run bibli mcp-server

The server runs using stdio transport and can be connected to by MCP clients.

MCP Capabilities

๐Ÿ”ง Tools (AI can call these functions)

  • search_verses - Search for Bible verses containing specific text
  • get_verse - Get a specific Bible verse by reference (e.g., "John 3:16")
  • get_chapter - Get all verses from a Bible chapter
  • get_random_verse - Get a random Bible verse
  • get_cross_references - Find related verses for cross-referencing

๐Ÿ“š Resources (Contextual data for AI)

  • bible://books - List of all Bible books with metadata
  • bible://book/{book_name} - Information about a specific book

๐Ÿ’ญ Prompts (Templates for Bible study)

  • bible-study - Generate comprehensive Bible study materials
  • verse-explanation - Provide detailed verse explanations and context
  • devotional - Create devotional reflections based on passages
  • sermon-outline - Generate sermon outlines from Bible texts

Connecting to Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "bible-cli": {
      "command": "uvx",
      "args": ["bibli", "mcp-server"],
      "env": {}
    }
  }
}

Testing the MCP Server

# Run the test script
uv run test_mcp.py

Example Usage with MCP

Once connected to an AI application:

  1. Search verses: "Find verses about love"
  2. Get explanations: "Explain John 3:16 in detail"
  3. Bible study: "Create a Bible study for Psalm 23"
  4. Cross-references: "What verses relate to Romans 8:28?"

Configuration

Configuration file: ~/.config/bible-cli/config.toml

[general]
default_translation = "BBE"
theme = "dark"
page_size = 10
show_verse_numbers = true

[ascii_art]
enabled = true
style = "simple"

[mcp]
enabled = false
endpoint = "http://localhost:8000"

[keybindings]
next_verse = ["j", "down"]
prev_verse = ["k", "up"]
search = ["/"]

Data Sources

The application automatically downloads Bible data from:

  • Basic Bible English (BBE) translation from Open Bibles

Additional translations can be imported from:

  • JSON Bible files
  • USFX XML format
  • Custom API endpoints

Development

Setup Development Environment

git clone https://github.com/guzus/bible-cli
cd bible-cli
uv sync --extra dev

Run Tests

uv run pytest
uv run pytest --cov=bibli

Code Quality

uv run black bibli/

Project Structure

bible-cli/
โ”œโ”€โ”€ bibli/
โ”‚   โ”œโ”€โ”€ __init__.py          # Package initialization
โ”‚   โ”œโ”€โ”€ __main__.py          # Main entry point
โ”‚   โ”œโ”€โ”€ cli.py               # Click command definitions
โ”‚   โ”œโ”€โ”€ tui.py               # Textual TUI app
โ”‚   โ”œโ”€โ”€ models.py            # SQLAlchemy models
โ”‚   โ”œโ”€โ”€ search.py            # Search implementation
โ”‚   โ”œโ”€โ”€ mcp_server.py        # FastAPI MCP server
โ”‚   โ”œโ”€โ”€ config.py            # Configuration handling
โ”‚   โ”œโ”€โ”€ ascii_art.py         # ASCII art constants
โ”‚   โ”œโ”€โ”€ data_import.py       # Data import functionality
โ”‚   โ””โ”€โ”€ utils.py             # Helper functions
โ”œโ”€โ”€ tests/                   # Test files
โ”œโ”€โ”€ pyproject.toml          # Project configuration
โ””โ”€โ”€ README.md               # This file

Examples

Basic Usage

# Read John 3:16
uv run bible read john 3:16

# Read Genesis 1:1-10
uv run bible read genesis 1:1-10

# Search for verses about love
uv run bible search love --testament new

# Search with context
uv run bible search "faith without works" --context 2

# View database statistics
uv run bible info

Advanced Search

# Exact phrase search
uv run bible search "in the beginning" --exact

# Case-sensitive search
uv run bible search "God" --case-sensitive

# Limit to specific book
uv run bible search faith --book james

# Limit results
uv run bible search love --limit 5

Interactive Reading

# Read with interactive navigation
uv run bible read john 3:16 --interactive

# Navigate interactively from a specific verse
uv run bible nav john 3:16

# Read with context
uv run bible read john 3:16 --context 3

Bookmarks and History

# Add bookmark
uv run bible bookmark add "john 3:16" --name "God's Love"

# List bookmarks
uv run bible bookmarks

# View reading history
uv run bible history --limit 10

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Run tests and linting
  6. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Bible data from Open Bibles
  • Built with Click, Textual, and Rich
  • Uses UV for fast dependency management
  • Inspired by the need for developer-friendly Bible study tools

Support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bibli-0.1.1.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bibli-0.1.1-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file bibli-0.1.1.tar.gz.

File metadata

  • Download URL: bibli-0.1.1.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for bibli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bf835add70a852842de86c2b097ac8cb37ef20246570bb65c02e9e28482d02af
MD5 9bd136a1f60bccb9f3ad06636126ebb9
BLAKE2b-256 d0bd52f3f6b3c069c7e0db397a682708d72f48be56e1c6d48d6d59cba2386d0d

See more details on using hashes here.

File details

Details for the file bibli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: bibli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for bibli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 27ff27286071c45bf9def41d77eb67a14758f44c34802b6cf964b0856775587a
MD5 e58ec2b907aece8a4a87009047696882
BLAKE2b-256 3e107137a91e632ffe765fedc5cdc3bfcfeeba42201b83006aa5bea56601913f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page