This guide explains how to compile gemini.c into an executable and install it in your local/bin directory.
Prerequisites:
- C Compiler: You need a C compiler like GCC.
- Libjson: Download and install the libjson library. You can find it at https://github.com/json-c/json-c.
- Libcurl: Download and install the libcurl library. You can find it at https://curl.se/.
- glow
Steps: 0. get a api key form https://aistudio.google.com/app/apikey replace line no 7 with the api key
-
Compile with libjson:
gcc gemini.c -o gemini -I/path/to/libjson/include -L/path/to/libjson/lib -ljson -lcurl
- Replace
/path/to/libjson/includewith the actual path to the libjson include directory. - Replace
/path/to/libjson/libwith the actual path to the libjson lib directory.
- Replace
-
Copy to local/bin:
cp gemini /local/bin
-
For Better Text Display
Create or edit the function:
nano ~/.config/fish/functions/gemini.fishAdd the following code:
function gemini command gemini $argv | glow end
Save and exit, then reload the functions:
functions --no-reload
Open your Bash configuration file (
.bashrcor.bash_profile):nano ~/.bashrcor
nano ~/.bash_profileAdd the following function:
gemini() { command gemini "$@" | glow }
Save and exit, then apply the changes:
source ~/.bashrc # or source ~/.bash_profile
Open your Zsh configuration file (
.zshrc):nano ~/.zshrcAdd the following function:
gemini() { command gemini "$@" | glow }
Save and exit, then apply the changes:
source ~/.zshrc
Important:
- You may need to adjust the paths to libjson and libcurl depending on where you installed them.
- If you encounter errors during compilation, ensure you have correctly configured the paths and installed the necessary libraries.
Now you should have a gemini executable in your local/bin directory, ready to use.
ai auto completion for terminal