synix/docs/modules/home/gemini-cli.md
sid 95a533c876
All checks were successful
Deploy docs / build-and-deploy (push) Successful in 3s
initial commit
2026-02-23 20:34:35 +01:00

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 abc123 with 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.