v0.2.2 · MIT

gandi-cli

A modern CLI for the Gandi v5 REST API. Manage your domains and DNS records from the terminal — fast, scriptable, and beautifully rendered.

npm install -g @kud/gandi-cli
v0.2.2
Latest
6
Commands
2
APIs
MIT
Licence
Why gandi-cli

Features

Everything you need to manage your Gandi domains and DNS from the command line — no browser required.

🌐
Domain Management
List all your registered domains and renew them for one or more years — all from a single command.
🔧
Full DNS Control
List, create, update, and delete DNS records with support for custom TTLs and all standard record types.
🔐
Flexible Authentication
Use the GANDI_API_KEY environment variable or a ~/.config/gandi/config.toml file — whatever fits your workflow.
Rich Terminal UI
Built with Ink and React, gandi-cli renders interactive terminal output with spinners, tables, and formatted results.
🎯
Minimal Permissions
Fine-grained API token scoping — only grant the permissions each command actually needs. No broad access required.
📦
Zero Config to Start
Install globally, export your API key, and you're ready. A single binary entry point, one command prefix: gandi.
Get going fast

Quick Start

From zero to managing your domains in under a minute.

# 1. Install globally
npm install -g @kud/gandi-cli

# 2. Export your Gandi personal access token
#    Generate one at: gandi.net → Account → Partage → Créer un jeton d'accès personnel
export GANDI_API_KEY="your-token-here"

# 3. Check your token permissions
gandi doctor
  Gandi CLI · Expires in 29 days · 1 entity

  ✓  domain:view   gandi domain list
  ✗  domain:renew  gandi domain renew
  ✓  domain:tech   gandi dns list / set / delete

# 4. List your domains
gandi domain list
  DOMAIN        EXPIRES     STATUS  NAMESERVER
  ────────────  ──────────  ──────  ──────────
  example.com   2026-08-14  locked  —
  mysite.net    2027-03-01  locked  —

# 5. List DNS records
gandi dns list example.com
  NAME  TYPE  TTL    VALUE
  ────  ────  ─────  ───────────────────
  @     A     1800   1.2.3.4
  @     MX    10800  10 spool.mail.gandi.net.
  www   CNAME 10800  webredir.gandi.net.

# 6. Add or update a DNS record
gandi dns set example.com A www 5.6.7.8 --ttl 300
  ✓ Record updated successfully
Commands

CLI Reference

Commands are grouped under gandi doctor, gandi domain, and gandi dns.

gandi doctor Check your Personal Access Token info — shows which scopes are granted and which commands are unlocked.
gandi domain list List all domains registered in your Gandi account with their expiry dates.
gandi domain renew <domain> Renew a domain for 1 year (default). Requires the Gérer le renouvellement token permission.
gandi domain renew <domain> --duration <years> Renew a domain for a specified number of years (e.g. --duration 2).
gandi dns list <domain> List all DNS records for a domain — type, name, value, and TTL.
gandi dns set <domain> <type> <name> <value> Create or replace a DNS record. Type is the record type (A, AAAA, CNAME, MX, TXT, etc.).
gandi dns set <domain> <type> <name> <value> --ttl <seconds> Set a DNS record with a custom TTL in seconds (e.g. --ttl 300).
gandi dns delete <domain> <type> <name> Delete a DNS record by type and name.
Configuration

Configuration

gandi-cli reads credentials from the environment or a TOML config file. The environment variable takes precedence.

Key Type Default Description
GANDI_API_KEY env var Your Gandi personal access token. Takes precedence over the config file.
api_key string Token stored in ~/.config/gandi/config.toml. Used when the env var is not set.
# ~/.config/gandi/config.toml
api_key = "your-token-here"