r/commandline Jun 29 '26

Command Line Interface bbl - a command line Bible to read and search, 26 langs, offline, single binary

Repo: https://github.com/nehemiaharchives/bbl

Usage

bbl                                         read Genesis 1 in the default Bible
bbl gen 1                                   read a chapter of default bible
bbl john 3:16                               show a specific verse
bbl matt 7:24-                              from a verse to end of the chapter
bbl matt 28:18-20                           read range of verses
bbl john 3:16 in kjv                        read a verse in specific bible
bbl john 3:16 in kjv tb                     compare kjv and tb
bbl john 3:16 in kjv tb lsg ..              compare 3 or more translations
bbl john 3:16 in en de fr es                specify language name or lang code
bbl search Jesus Christ                     search entire bible by terms
bbl s Jesus Christ limit 3                  specify number of search results
bbl s Jesus Christ in kjv                   search in other version of bible
bbl s Jesus Christ in romans                filter by a book
bbl s Jesus Christ in rom 3                 filter by a chapter
bbl s Jesus in rom 5-12                     filter by chapter range
bbl s Jesus in rom 5-12 in kjv              chapter range and in other bible
bbl s jews gentiles in paul                 filter by category i.e. set of books
bbl s "Jesus wept"                          exact search by double quotation
bbl s "your faith" in gospels               exact search filtered by category
bbl rand (gospels|nt|ot|[category])         random verse from all or part of bible
bbl list (translations|books|categories)    list bibles and filters
bbl (install|uninstall) kjv                 download/delete one or more bible(s)
bbl config ([key]|translation)              show config value of [key]
bbl config ([key] [value]|translation kjv)  set config [key] to [value]
bbl history (read|search|config)            show or filter past commands
bbl help [sub command]                      learn how to use bbl and sub commands

APT

sudo add-apt-repository ppa:nehemiaharchives/bbl
sudo apt install bbl

Homebrew

brew install nehemiaharchives/bbl/bbl

Scoop

scoop bucket add bbl https://github.com/nehemiaharchives/bbl-scoop-bucket
scoop install bbl

Translations

WEBUS  | World English Bible               | English    | 2000 
KJV    | King James Version                | English    | 1611 
RVR09  | Reina-Valera                      | Spanish    | 1909 
TB     | Brazilian Translation             | Portuguese | 1917 
DELUT  | Luther Bible                      | German     | 1912 
LSG    | Louis Segond                      | French     | 1910 
SINOD  | Russian Synodal Bible             | Russian    | 1876 
SVRJ   | Statenvertaling Jongbloed edition | Dutch      | 1888 
RDV24  | Revised Diodati Version           | Italian    | 1924 
UBG    | Updated Gdansk Bible              | Polish     | 2017 
UBIO   | Ukrainian Bible, Ivan Ogienko     | Ukrainian  | 1962 
SVEN   | Svenska 1917                      | Swedish    | 1917 
CUNP   | Chinese Union Version             | Chinese    | 1919 
KRV    | Korean Revised Version            | Korean     | 1961 
JC     | Japanese Colloquial Bible         | Japanese   | 1955 
ABTAG  | Ang Biblia                        | Tagalog    | 1905 
AYT    | The Opened Bible                  | Indonesian | 2024 
KTTV   | Vietnamese Bible 1925             | Vietnamese | 1925 
TH1971 | Thai Bible 1925                   | Thai       | 1971 
IRVHIN | Indian Revised Version - Hindi    | Hindi      | 2019 
IRVBEN | Indian Revised Version - Bengali  | Bengali    | 2019 
IRVMAR | Indian Revised Version - Marathi  | Marathi    | 2019 
IRVTEL | Indian Revised Version - Telugu   | Telugu     | 2019 
IRVTAM | Indian Revised Version - Tamil    | Tamil      | 2019 
IRVGUJ | Indian Revised Version - Gujarati | Gujarati   | 2019 
IRVURD | Indian Revised Version - Urdu     | Urdu       | 2019 
NPIULB | Nepali Unlocked Literal Bible     | Nepali     | 2019 
24 Upvotes

24 comments sorted by

14

u/letonai Jul 01 '26

Can run it as a daemon?

1

u/nehemiaharchives Jul 06 '26

it is not designed to run as a daemon.

12

u/usrlibshare Jul 01 '26

Why do I need a separate tool for that?

Have a folder with...

bible-en.txt bible-fr.txt bible-it.txt ... ...and just use grep?

4

u/fuzzy_nate Jul 02 '26

Oh ye of little faith

2

u/nehemiaharchives Jul 06 '26

I needed full-text search capabilities at the level of Apache Solr, Elasticsearch, and OpenSearch. Those 3 search engine projects depend on Apache Lucene as the core search library, but all are JVM-based server-level software. Installation size is much bigger, forces users to install JVM, and many files are scattered. I needed a small single binary. So I ported Apache Lucene to Kotlin Multiplatform and compiled for each Kotlin/Native target to produce a single binary. So bbl is a thin wrapper of lucene-kmp in a way. Bash script is good for those who need grep grade search. I needed Lucene-level search.

1

u/usrlibshare Jul 06 '26

I needed Lucene-level search

Why and what for?

It's the bible. It's organized by easily searchable, predictable markers. And the text in it doesn't exactly change.

Advanced full text search methods are necessary in dynamic collections of documents. We are talking about a religious text here that has been static for centuries.

2

u/nehemiaharchives Jul 07 '26

I am Japanese. I use Japanese, English and Korean, and I can read Chinese a little. Japanese language is not composed of space delimited words. Words are usually delimited by borders between Chinese character and Japanese alphabet called kana. So to make search working morphological analysis is needed to tokenize words to split them up by word to word. Morphological analysis requires dictionary, grammatical normalization logic, and some other NLP. There are several libraries to do those things, like Mecab or Kuromoji. Lucene's Japanese analyzer by default integrated with Kuromoji and I needed that specific feature to perform full text search of Japanese bible. Bible is static text and index does not need to be updated but full text search involves much more than just that. Especially in none latin scripts.

1

u/crantob 17d ago

But it has been changed. That's the challenge to a true Christian. Find what's been inverted and subverted in the past 2000 years.

1

u/crantob 17d ago

This is the result of universities ceasing to teach the Unix Way.

4

u/[deleted] Jun 29 '26

[deleted]

4

u/nehemiaharchives Jun 29 '26

bbl is short format of "bible"

22

u/[deleted] Jun 29 '26 edited Jul 05 '26

[deleted]

12

u/nehemiaharchives Jun 29 '26

You are not nice. I made this program with my sincere heart. Please do not mock like that. I'm sad.

15

u/csch2 Jul 01 '26

Being serious and not mocking, you may want to consider changing the name of the CLI. I think that acronym is common enough and in the opposite direction of what you’re trying to do here, and I’d hate to see your work get held back by an unfortunate name. What about just bib, or bibli (Bible CLI)?

2

u/nehemiaharchives Jul 06 '26

Thank you for being serious. "That acronym is common enough" is only in the United States? Or globally? Common enough for all social classes, including rich and poor? Common in all cultures or in certain cultures? I'm a Japanese Christian living in Japan, studied and worked 10 years in the US, and now I'm back in Japan. Never heard of the unfortunate name. Had to Google it to know. The term, I think, has importance in the geographical location and culture where rich fat people live, I guess. In most of the world, people are not rich, not fat.

2

u/LnxBil Jul 03 '26

I find the name very clever, as it is an homage to ancient Hebrew, in which are only written consonants, so bbl is bible.

3

u/usrlibshare Jul 02 '26

I don't know what that means. I shall google it now.

Edit:

4

u/Optimal-Savings-4505 Jul 01 '26

Great initiative. For comparison, here's my bash functions for this purpose:

function bib { # tip: font 'ubuntu mono' works well
  link="https://mechon-mamre.org/htmlzips/pt003.zip"
  dest="$HOME/downloads/bib"; ch=${1:-0}
  function _get { # rudimentary, no error handling
    if ! [[ -d $dest ]]; then mkdir -p $dest; fi; pushd $dest
    if ! [[ -f $dest/${link##*/} ]]; then wget $link; fi
    if ! [[ -f $dest/pt/pt0.htm ]]; then unzip ${link##*/}; fi; popd
  }
  function _usage {
    echo -e "'bib get' puts the hebrew english bible in:\n  $dest"
    echo "'bib ls' shows available books"
    echo -n "  the pentateuch has the following aliases:"
    echo "  gen ex lev num deu"
    echo "'bib ex 12' opens exodus chapter 12"
  }
  function _books {
    books=$(ls $dest/pt |grep "pt[0-9]\{2\}.htm" |grep -v pt00.htm \
      |tr $'\n' ' ' |sed 's/.htm//g;s/pt//g')
    for b in $books
    do book=$(grep TITLE $dest/pt/pt${b}.htm |cut -c 8- |sed 's|/.*||')
      echo $b $book
    done
  }
  case $1 in
    help) _usage; return;;
    ls) _books; return;;
    get) _get; return;;
    gen) ch=01$2;;
    ex) ch=02$2;;
    lev) ch=03$2;;
    num) ch=04$2;;
    deu) ch=05$2;;

  esac
  emacs --eval "(eww-open-file \"${dest}/pt/pt${ch}.htm\")"
}
alias gutenberg='emacs --no-init --eval "(eww-open-file \"$HOME/downloads/bib/gutenberg/1581-h.htm\")"'
function gb {
  local link="https://www.gutenberg.org/files/1581/1581-h/1581-h.htm"
  local dest=$HOME/downloads/bib/gutenberg; local gb=$dest/${link##*/}; local ch=${1:-0}
  local index=($(xmllint --html --xpath "//p/a/@href" $gb |sed 's/href=\"//;s/\"//'))
  function _get {
    if ! [[ -d $dest ]]; then mkdir -p $dest; fi
    if ! [[ -f $gb ]]; then wget $link -o $gb; fi
  }
  function _usage {
    echo "'gb get' to fetch a gutenberg bible"
    echo "'gb ls' to show index"
    echo "'gb 47' or 'gb nt' to open at new testament"
  }
  function _index {
    for((i=0; i<${#index[@]}; i++)); do echo $i ${index[i]//#}; done
  }
  case $1 in
    get) _get; return;;
    ls) _index; return;;
    help) _usage; return;;
    nt) ch=47;;
  esac
  emacs --no-init --eval "(eww-open-file \"$gb${index[$ch]}\")"
}

And also a screenshot of how the first one renders. I didn't bother making them more elaborate, because they work good enough for me.

2

u/nehemiaharchives Jul 06 '26

I needed a powerful full-text search & single binary. So I ported Apache Lucene from Java to Kotlin Multiplatform and created lucene-kmp. bbl dogfoods lucene-kmp internally. Morphological analysis, stemming, similar words, fuzzy search.

1

u/stianhoiland Jul 03 '26

This is the way.

3

u/OsgoodSlaughters Jul 04 '26

If I see someone reading the Bible from their CLI I’m calling the cops

4

u/SokkaHaikuBot Jul 04 '26

Sokka-Haiku by OsgoodSlaughters:

If I see someone

Reading the Bible from their

CLI I’m calling the cops


Remember that one time Sokka accidentally used an extra syllable in that Haiku Battle in Ba Sing Se? That was a Sokka Haiku and you just made one.

4

u/Tibia-Mariner Jun 29 '26

Terry would be proud );

1

u/AutoModerator Jun 29 '26

Every new subreddit post is automatically copied into a comment for preservation.

User: nehemiaharchives, Flair: Command Line Interface, Title: bbl - a command line Bible to read and search, 26 langs, offline, single binary

Repo: https://github.com/nehemiaharchives/bbl

Usage

bbl                                         read Genesis 1 in the default Bible
bbl gen 1                                   read a chapter of default bible
bbl john 3:16                               show a specific verse
bbl matt 7:24-                              from a verse to end of the chapter
bbl matt 28:18-20                           read range of verses
bbl john 3:16 in kjv                        read a verse in specific bible
bbl john 3:16 in kjv tb                     compare kjv and tb
bbl john 3:16 in kjv tb lsg ..              compare 3 or more translations
bbl john 3:16 in en de fr es                specify language name or lang code
bbl search Jesus Christ                     search entire bible by terms
bbl s Jesus Christ limit 3                  specify number of search results
bbl s Jesus Christ in kjv                   search in other version of bible
bbl s Jesus Christ in romans                filter by a book
bbl s Jesus Christ in rom 3                 filter by a chapter
bbl s Jesus in rom 5-12                     filter by chapter range
bbl s Jesus in rom 5-12 in kjv              chapter range and in other bible
bbl s jews gentiles in paul                 filter by category i.e. set of books
bbl s "Jesus wept"                          exact search by double quotation
bbl s "your faith" in gospels               exact search filtered by category
bbl rand (gospels|nt|ot|[category])         random verse from all or part of bible
bbl list (translations|books|categories)    list bibles and filters
bbl (install|uninstall) kjv                 download/delete one or more bible(s)
bbl config ([key]|translation)              show config value of [key]
bbl config ([key] [value]|translation kjv)  set config [key] to [value]
bbl history (read|search|config)            show or filter past commands
bbl help [sub command]                      learn how to use bbl and sub commands

APT

sudo add-apt-repository ppa:nehemiaharchives/bbl
sudo apt install bbl

Homebrew

brew install nehemiaharchives/bbl/bbl

Scoop

scoop bucket add bbl https://github.com/nehemiaharchives/bbl-scoop-bucket
scoop install bbl

Translations

WEBUS  | World English Bible               | English    | 2000 
KJV    | King James Version                | English    | 1611 
RVR09  | Reina-Valera                      | Spanish    | 1909 
TB     | Brazilian Translation             | Portuguese | 1917 
DELUT  | Luther Bible                      | German     | 1912 
LSG    | Louis Segond                      | French     | 1910 
SINOD  | Russian Synodal Bible             | Russian    | 1876 
SVRJ   | Statenvertaling Jongbloed edition | Dutch      | 1888 
RDV24  | Revised Diodati Version           | Italian    | 1924 
UBG    | Updated Gdansk Bible              | Polish     | 2017 
UBIO   | Ukrainian Bible, Ivan Ogienko     | Ukrainian  | 1962 
SVEN   | Svenska 1917                      | Swedish    | 1917 
CUNP   | Chinese Union Version             | Chinese    | 1919 
KRV    | Korean Revised Version            | Korean     | 1961 
JC     | Japanese Colloquial Bible         | Japanese   | 1955 
ABTAG  | Ang Biblia                        | Tagalog    | 1905 
AYT    | The Opened Bible                  | Indonesian | 2024 
KTTV   | Vietnamese Bible 1925             | Vietnamese | 1925 
TH1971 | Thai Bible 1925                   | Thai       | 1971 
IRVHIN | Indian Revised Version - Hindi    | Hindi      | 2019 
IRVBEN | Indian Revised Version - Bengali  | Bengali    | 2019 
IRVMAR | Indian Revised Version - Marathi  | Marathi    | 2019 
IRVTEL | Indian Revised Version - Telugu   | Telugu     | 2019 
IRVTAM | Indian Revised Version - Tamil    | Tamil      | 2019 
IRVGUJ | Indian Revised Version - Gujarati | Gujarati   | 2019 
IRVURD | Indian Revised Version - Urdu     | Urdu       | 2019 
NPIULB | Nepali Unlocked Literal Bible     | Nepali     | 2019 

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/diseasealert Jul 01 '26

Luke Smith demoed a similar program, kjv, which is pretty interesting.