1.4 KiB
1.4 KiB
Gemini CLI
An open-source AI agent that brings the power of Gemini directly into your terminal.
View the synix Home Manager module on Forgejo.
References
Setup
The package must be set by you. Easiest option is to use the synix overlay:
{ inputs, pkgs, ... }:
{
imports = [
inputs.synix.homeModules.gemini-cli
];
programs.gemini-cli = {
enable = true;
package = pkgs.synix.gemini-cli;
};
}
Gemini CLI reads environment variables, such as your API key, from ~/.gemini/.env. You can manage it with sops-nix:
{ config, ... }:
{
sops.secrets.gemini-api-key = { };
sops.templates.gemini-cli-env = {
content = ''
GEMINI_API_KEY=${config.sops.placeholder.gemini-api-key}
'';
path = config.home.homeDirectory + "/.gemini/.env";
};
}
Set gemini-api-key in your secrets.yaml:
Replace
abc123with your Gemini API key.
gemini-api-key: abc123
Troubleshooting
These are some common warnings and errors you might encounter when using Gemini CLI:
Error saving user settings file
Error saving user settings file: Error: EROFS: read-only file system, open '/home/you/.gemini/settings.json'
This is intended behavior.