The purpose of Beekeeper is to relieve anxiety by remembering things using a simple command-line interface. Currently, the things it can remember for you are bookmarks to locations of files + directories and aliases of commands. Then you can easily recall your bookmarks or run your aliases by using the label you create for them. The following video illustrates Beekeeper's features:
Installing Beekeeper takes two steps: build and install the bk executable,
then run bk init once to set it up.
You will need Stack a project management tool for the Haskell programming language. Then clone this repository and run the following to install Beekeeper:
stack build
stack installMake sure the directory stack install copies bk into (usually
~/.local/bin) is on your PATH.
Before using Beekeeper for the first time run:
bk initThis does the following:
-
It creates
~/.bkand an empty bookmarks file,~/.bk/bookmarks.csv. If the bookmarks file already exists it is left untouched, so your bookmarks and aliases are never lost. -
Beekeeper detects your shell from the
SHELLenvironment variable and installs a completion script for it. Completions cover Beekeeper's commands and the labels of your bookmarks and aliases. Bash, zsh, and fish are supported; any other shell are currently unsupported.Shell Completion script Startup file updated bash ~/.bk/completions/bk.bash~/.bash_profileon macOS,~/.bashrcelsewherezsh ~/.bk/completions/_bk$ZDOTDIR/.zshrc(~/.zshrcifZDOTDIRis unset)fish $XDG_CONFIG_HOME/fish/completions/bk.fish(~/.config/fish/...if unset)none, fish loads it automatically
Restart your shell afterwards to turn on completions.
It is safe to run bk init again, for example after upgrading Beekeeper or
switching shells. It regenerates the completion script, never overwrites your
bookmarks file, and only asks about the startup file if the Beekeeper block is
not already there.
Beekeeper saves all of its data to ~/.bk. We strive to keep all of
Beekeeper's data human readable and not dependent on any heavy external
libraries or tools. This is the reason we chose
CSV as Beekeeper's
underlying data format.
The following sections give examples of every feature Beekeeper supports.
To add a bookmark use the following command:
bk bookmark LABEL=TARGETthe string LABEL is the name of the bookmark and its value is TARGET. For
example, bk bookmark math-proj="path/to/math/project" will add a bookmark
with label math-proj whose target is path/to/math/project.
Adding an alias is very similar to adding a bookmark:
bk alias code-proj="code path/to/project"The labels of bookmarks must begin with an alphabet symbol and then only consist of alphanumeric symbols or underscore or hyphen. Targets are not allowed to be empty.
The main difference between bk bookmark and bk alias is that when we
ask Beekeeper to run a bookmark its target is output to the terminal, but when
we ask Beekeeper to run an alias it will execute its target as a command.
To run a bookmark or alias we simply give bk the label of the bookmark:
bk LABELThen if LABEL is a bookmark its target is output to the terminal, but if its
an alias its target is executed as a command.
The above is the same as bk run LABEL.
Aliases run in your own shell (the one named by SHELL), started as an
interactive shell with your full environment. So an alias can use anything
you'd use at your prompt: environment variables, pipes, and the functions and
aliases defined in your shell's startup file. bk exits with the same status
as the command it ran.
Any extra arguments after the label are passed on to the alias's command, with their quoting kept:
bk alias greet="echo hello"
bk greet "big world" # runs: echo hello "big world"Having the bookmark target simply output to the terminal means that we can use it with other commands. For example,
cd `bk LABEL`will change directory into the target of LABEL. This makes it easy to inject
Beekeeper into your workflow on the command line.
Use:
bk find LABELto search for the target whose label is LABEL. A more sophisticated search is
underdevelopment.
Use:
bk rename OLD_LABEL NEW_LABELUse:
bk remove LABELto remove a bookmark or alias.
If you run Beekeeper with no arguments at all:
bkthen it will list recent bookmarks. This is the list of all bookmarks and aliases that were created within the last 10 days.
You can list just bookmarks using:
bk bookmarksand just aliases using:
bk aliasesUse:
bk listto see a list of all bookmarks and aliases.
Use:
bk --helpfor the help menu and use:
bk --versionto show the currently installed version.
Shell integration tests live in test/shell. They run bk init, bookmarks, and
aliases against real bash, zsh, and fish shells, each starting from a fresh,
empty HOME. The easiest way to run them is in Docker, which builds bk and
installs all three shells for you:
cd test
docker compose run --rm bk # all shells
docker compose run --rm bk fish # just fish
docker compose run --rm bk zsh bash # a subset, in that orderTo run them without Docker, put bk on your PATH and run
test/shell/run.sh [SHELL...]. Set KEEP_HOMES=1 to keep each shell's
temporary HOME afterwards for inspection.
