Bible

Table of contents

Description

This is a program I’ve been wanting for awhile, which is just a basic bible in the command line. Can get exact verses, search terms, or just read from any point.
As of now (v0.2.4) it only contains the English KJV.


Install

To install:

(If your go environment is set up)

$ go install github.com/unclassedpenguin/bible@latest

Update

Manually update

If you manually cloned the repo and installed the program with go install just pull the changes with git pull and then run go install again.


Usage

Option Description
-e Exact search. Use with -s, ie bible -s -e 'term'
-f List favorites
-i Enable interactive mode
-l List info. with no arguments, will give all books. With a book will give number of chapters. With a book and chapter will give number of verses.
-r Print random verse
-s Search for term ie bible -s 'hope' (“hope” would match hopeful or hopefully or anything containing hope. If you want to match for only “hope” then use -s -e)
-v Print version

Examples

Basic usage for showing a specific verse is:

$ bible Book chapter verse

If the Book has multiples, it needs to be in quotations. Ie:

$ bible "1 Corinthians" 1 1

Basic Usage Examples

$ bible     # with no other arguments, will merely print all the books of the bible in order.  
$ bible Genesis     # will print the number of chapters in the book Genesis.  
$ bible Genesis 1   # will print the entirety of chapter 1 of the book Genesis.  
$ bible Genesis 1 1     # will print verse 1 of chapter 1 of the book Genesis.  

You can do ranges on verses:

$ bible Genesis 1 1-10  # will print the first 10 verses

You can also do ranges on chapters, which will print the chapters in their entireties

$ bible Genesis 1-3 

This works well with piping it into less ie:

$ bible Genesis 1-3 | less

Search Examples

If you want to search for a term, for example “hope”, then you can use -s

$ bible -s hope

If the search term is only a single word, no quotations are required. However, if you want to search for a phrase, you need quotations.

$ bible -s "love thy neighbour"

These will return all verses that contain the search term.

If you want to match only exact matches, use -e

$ bible -s -e hope    # will ONLY return verses where the word hope is found

(On a side note, this is kind of broken right now, because if the word is found at the end of a sentence, ie “hope.” or with a comma ie “hope,”, it will NOT match. More research is needed to figure this out! Probably need to use regex or something…)

Interactive mode

To enter interactive mode:

bible -i

Interactive mode has several commands:

Command Action
b bookmark
f favorite
n next verse
p previous verse
r random verse
q quit

As well you can enter a Specific verse:

: Galatians 6 5

So once you have entered that verse, you will continue to have the “command line” that you can enter the previous commands to traverse the bible. Or at anytime put in another specific book chapter verse.

To bookmark, when in interactive mode you can hit b. It will ask if you want to save or load the bookmark. First, save it, by hitting “s” when it asks, and then you can quit with “q”. The next time you open interactive mode, on the initial line hitting “b” will immediately take you to the bookmarked verse where you can continue on. If you enter beyond the initial command line of interactive mode when you hit “b”, it will again ask if you want to load or save, so hit “l” to load, and go to the bookmark.

To add a verse to favorites, go into interactive mode, and then go to the verse you’d like to favorite, and hit “f”. This will add the verse to your favorites. If you hit f again, it will notify you that you already have the verse in your favorites, and ask if you want to remove it or keep it. Hit “y” to remove it, or any other key to keep it in your favorites. To see all of your favorites, exit interactive mode and use bible -f

Bookmark and favorites are saved to your computer at the location of ~/.local/share/bible/bible-data.json. You can edit this file, if you wish. Although it is a little bit obscure because it merely saves the verse based on their “id” which is just the integer of the verse in the database. So Genesis 1:1 has an id of “1” and Revelation 22:21 has an id of “31102”.