bard-cli

command module
v0.0.0-...-6bcf4b5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2024 License: BSD-2-Clause Imports: 20 Imported by: 0

README

Bard CLI

Use Google Bard in your CLI!

Installation

go install github.com/pedrohgmacedo/bard-cli@latest

or download the binary from releases

In order to use Bard CLI, you first need to gain access to Bard in your browser, and then copy the cookie "__Secure-1PSID" using developer tools. If you don't know how, follow this guide

IMPORTANT NOTE: never share your cookies with anyone, as they can be used to impersonate you and steal your data.

Then create the default configuration file using the following command:

$ bard-cli --defaultconfig
# 2023-05-15T21:06:42+12:00 INF wrote default config to /home/USER/.bardcli.yaml

and then edit the file to add your cookie.

$ cat ~/.bardcli.yaml
cookie: YOURLONG-COOKIE.
log_level: warn

then just start using it!

$ bard-cli "what is the meaning of life?"
The meaning of life is a question that has been asked by philosophers and theologians for centuries. There is no one answer that will satisfy everyone, but some possible answers include:

* To find happiness and fulfillment.
* To make a difference in the world.
* To learn and grow as a person.
* To connect with others and build relationships.
* To experience the beauty of the world.
* To leave a legacy behind.

Ultimately, the meaning of life is up to each individual to decide. There is no right or wrong answer, and what matters most is that you find something that gives your life meaning.

Here are some additional thoughts on the meaning of life:

* The meaning of life is not something that is given to us, but something that we create.
* The meaning of life is not something that we find once and for all, but something that we discover and rediscover throughout our lives.
* The meaning of life is not something that is the same for everyone, but something that is unique to each individual.

If you are searching for the meaning of life, I encourage you to explore your own values, beliefs, and experiences. What is important to you? What makes you happy? What do you want to achieve in your life? The answers to these questions may help you to find your own meaning in life.

Use a Proxy

To use a HTTP(s) or SOCKS4/5 proxy to access bard, set HTTP_PROXY as well as HTTPS_PROXY environment variables before running bard-cli.

Screenshots

single question

interactive

Use as a neovim plugin

in your neovim config, add the following plugin

Plug 'pedrohgmacedo/bard-cli', {'rtp': 'nvim'}

by default, the plugin looks for bard-cli in $HOME/go/bin/bard-cli and the configuration file at $HOME/.bardcli.yaml

to change that, run the setup function of bard using the following

lua require('bard').setup({bardcli_path="$HOME/go/bin/bard-cli", bardcli_config_path="$HOME/.bardcli.yaml"})

Usage

:Askbard "write hello world in javascript"

the above will open a new vsplit and return the results in the new buffer

interactive

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL