https://github.com/eze-kiel/bd
Manage a database of birthday dates from the terminal !
https://github.com/eze-kiel/bd
birthday cli go golang json
Last synced: 3 months ago
JSON representation
Manage a database of birthday dates from the terminal !
- Host: GitHub
- URL: https://github.com/eze-kiel/bd
- Owner: eze-kiel
- License: mit
- Created: 2021-02-11T00:19:07.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-07T15:09:30.000Z (almost 4 years ago)
- Last Synced: 2025-01-05T11:43:47.563Z (4 months ago)
- Topics: birthday, cli, go, golang, json
- Language: Go
- Homepage:
- Size: 535 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bd
Manage a database of birthday dates from the terminal !
- [Demo](#demo)
- [Gettin' started](#gettin-started)
- [Get the binary](#get-the-binary)
- [Setup the files](#setup-the-files)
- [Usage](#usage)
- [Integration ideas](#integration-ideas)
- [Completion](#completion)
- [Bash](#bash)
- [Zsh](#zsh)
- [Fish](#fish)
- [License](#license)
- [Credits](#credits)## Demo
[](https://asciinema.org/a/wrCm3ZEcBpDuLpIxwDSMo27jh)
## Gettin' started
### Get the binary
You can get the program on your machine...
* ...using Golang:
```
$ git clone github.com/eze-kiel/bd.git
$ cd bd/
$ go build
```* ...from the [releases](https://github.com/eze-kiel/bd/releases)
I highly recommend you to move the freshly installed binary into your `$PATH` scope.
### Setup the files
Once `bd` is installed, you have one command to initialize everything:
```
$ bd init
```This will create `$HOME/.bd/dates.json`.
## Usage
From the help menu:
```
Usage:
bd [command]Available Commands:
coming Display coming birthdays
completion Generate completion script
delete Delete an entry from the birthday database
help Help about any command
init Initialize bd components
insert Insert a birthday date into the base
list List all the saved birthdays
search Search a specific birthdayFlags:
-h, --help help for bd
```## Integration ideas
The nicest way I found to use it is to create `/etc/apt/apt.conf.d/100update` which will contain:
```bash
APT::Update::Pre-Invoke {"runuser -u root -- /home/ezekiel/.bin/bd coming 2>&1 | /usr/games/lolcat";};
```And then linking your local database with root's one:
```
# mkdir /root/.bd
# ln -s /home/username/.bd/dates.json /root/.bd/dates.json
```
Now each time you will execute `sudo apt update`, it will display a flashy colored banner at the top of the output with the incoming birthdays.[](https://asciinema.org/a/IZGQb4wvlNdmVThLKl25gMfeU)
## Completion
### Bash
You can add the courcing command to your `.bashrc`:
```
$ echo "source <(bd completion bash)" > .bashrc
```Or exectute the following:
```
$ bd completion bash > /etc/bash_completion.d/bd
```### Zsh
If shell completion is not already enabled in your environment, you will need to enable it. You can execute the following once:
```
$ echo "autoload -U compinit; compinit" >> ~/.zshrc
```Then to load completion for each session, execute once:
```
$ bd completion zsh > "${fpath[1]}/_bd"
```### Fish
To load completions for each session, execute once:
```
$ bd completion fish > ~/.config/fish/completions/bd.fish
```## License
MIT
## Credits
Gopher from [Maria Letta](https://github.com/MariaLetta/free-gophers-pack)