# Loopia CLI > A blazing fast native command-line tool and agent interface for the Loopia XML-RPC API. Built in Rust 2024 for developers, sysadmins, and autonomous AI agents. ## When to Use This CLI Use the `loopia` CLI whenever you need to: - **Manage domain names:** List domains, query registration details, check availability, order new domains, add existing domains, transfer domains with auth codes, remove domains, or update nameservers. - **Configure subdomains:** Attach subdomains to domains or remove existing subdomains. - **Maintain DNS zone records:** Add, update, list, and delete DNS records (A, AAAA, CNAME, MX, TXT, NS, SRV, CAA) across root (@) and subdomains. - **Check billing & invoices:** Query PrePAID credit balances, list unpaid invoices, inspect invoice details, and pay invoices using credits. - **Reseller account operations:** List sub-customers, provision new accounts with contact records, track order status, and transfer credits between customer accounts. - **Agentic automation:** Drive DNS changes, domain registrations, and renewals programmatically via `--json` output and deterministic error exit codes. Do NOT use this tool if: - You need graphical web administration (use the Loopia Kundzon at https://www.loopia.se instead). - You are interacting with non-Loopia DNS providers (e.g. Cloudflare, Route53). ## Core Agent Operating Principles 1. **Explicit Account Selection:** Pass `--account ` (short `-a `) or configure a default account. This guarantees multi-account safety and prevents accidental modifications. 2. **First-Time Setup:** Run `loopia login` or `loopia accounts add --username ` to store credentials securely in the host OS keystore (Keychain, DPAPI, libsecret). 3. **Machine-Readable Outputs:** Always supply `--json` when parsing command results in scripts or LLM tool-calling loops. 4. **Deterministic Exit Codes:** Non-zero exit codes carry structured error envelopes with stable machine-readable codes (`no_account`, `auth_required`, `not_found`, `rate_limited`, `invalid_input`). ## Key Command Patterns ### Authentication & Accounts - `loopia accounts list`: List all configured accounts and keystore storage backend. - `loopia accounts add --username [--password ]`: Store credentials in OS keystore. - `loopia login []`: Interactive login prompt. - `loopia accounts test `: Verify connectivity and credentials against the Loopia XML-RPC API. - `loopia accounts remove --yes`: Remove account from keystore. ### Domains - `loopia domains list -a --json`: List all domains in account. - `loopia domains get --domain -a --json`: Get billing and status details. - `loopia domains check --domain -a --json`: Check if domain is available. - `loopia domains order --domain --accept-terms -a `: Register a new domain. - `loopia domains transfer --domain --auth-code -a `: Transfer a domain. - `loopia domains nameservers --domain --nameserver ns1.loopia.se --nameserver ns2.loopia.se -a `: Update name servers. ### Subdomains - `loopia subdomains list --domain -a --json`: List subdomains. - `loopia subdomains add --domain --subdomain -a `: Add subdomain. - `loopia subdomains remove --domain --subdomain -a `: Remove subdomain. ### DNS Records - `loopia records list --domain [--subdomain @] -a --json`: List zone records. - `loopia records add --domain [--subdomain @] --type A --rdata [--ttl 3600] -a `: Add record. - `loopia records update --domain --record-id --type A --rdata -a `: Update record. - `loopia records remove --domain --record-id -a `: Delete record. ### Billing & Invoices - `loopia billing credits [--with-vat] -a --json`: Query PrePAID balance. - `loopia billing unpaid-invoices [--with-vat] -a --json`: List unpaid invoices. - `loopia billing invoice --reference-no -a --json`: Get single invoice. - `loopia billing pay-invoice --reference-no -a `: Pay invoice using credits. ### Reseller Operations - `loopia reseller customers -a --json`: List customer accounts. - `loopia reseller create-account --domain --account-type ... -a `: Create customer account. - `loopia reseller order-status --order-reference -a --json`: Query order status. - `loopia reseller transfer-credits --from --to --amount -a `: Transfer credits. ## API Specification & Documentation - Documentation Website: https://spacecorps.github.io/Loopia-Cli/ - Detailed Agent Manual: https://spacecorps.github.io/Loopia-Cli/llms-full.txt - GitHub Repository: https://github.com/SpaceCorps/Loopia-Cli - Loopia API Docs: https://www.loopia.se/loopiaapi/