AI Glot websiteOpen AI Glot
CLICLI automation and output

CLI automation and output

Run the AI Glot CLI safely in scripts and CI using JSON or NDJSON, environment credentials, profiles, exit codes and bounded retries.

The CLI prints readable tables to a terminal and JSON when output is piped, so the same command works interactively and in automation.

Terminal
aiglot batches list                    # table on a terminal
aiglot batches list | jq '.data[0].id' # JSON when piped
aiglot batches list --output ndjson    # one object per line
aiglot account --json                  # explicit JSON

Failures go to standard error. Standard output therefore remains safe to pipe into another program.

CI authentication

Create a dedicated, minimum-scope API key and store it in the CI provider’s secret manager:

Terminal
export AIGLOT_API_KEY="aig_live_…"
aiglot account --json

The CLI checks credentials in this order: AIGLOT_API_KEY, OS keychain, then its protected config file.

Exit codes

CodeMeaning
0Success
1API or server error
2Invalid command or arguments
3Authentication or permission failure
4Resource not found
5Rate limited
6Resource state conflict

Scripts should branch on the exit code or structured error.code, not error-message text.

Retries

The CLI retries 429 and temporary server failures with bounded backoff. Use --no-retry when the caller owns retry policy. Destructive commands never wait forever for an interactive prompt: non-interactive use must pass --force.

Profiles

Use named profiles to keep credentials for different workspaces or environments separate:

Terminal
aiglot --profile client-a auth login --key "$CLIENT_A_KEY"
aiglot --profile client-a account
export AIGLOT_PROFILE=client-a

Environment variables

VariablePurpose
AIGLOT_API_KEYAPI key; overrides stored credentials
AIGLOT_API_URLREST base URL
AIGLOT_MCP_URLMCP base URL
AIGLOT_AUTH_URLOAuth authorization-server URL
AIGLOT_PROFILENamed credential profile
AIGLOT_NO_TUIForce machine-readable output
AIGLOT_NO_KEYCHAINSkip the operating-system keychain
NO_COLORDisable colour and force JSON output

Use these docs with your AI tools

An AI agent can read this documentation directly. You do not need an account or an API key. Everything here is public and read-only.

Query these docs via MCP

Recommended

Add this server to Claude, Claude Code, Cursor, Mistral, or any tool that supports MCP. Your agent can then search AI Glot Docs documentation and read it in full, instead of answering from memory.

https://ai-glot.com/docs/mcp
  • searchFind the passages that answer a question.
  • fetchRead one page in full, as Markdown.
  • list_pagesSee every page in this documentation.

Query these docs over HTTP

The same tools also work as plain web requests. Use this for scripts, or for any tool that does not support MCP. There is one endpoint per tool. Arguments go in the query string, and the answer comes back as JSON.

https://ai-glot.com/docs/api/docs/search?query=custom+domain

Read the OpenAPI description. It is built from the same definitions as the tools, so it always matches what the endpoints do.

Read these docs as Markdown

Add .md to any page URL to get its Markdown source. You can also send the headerAccept: text/markdown to the page URL itself.

To read the whole documentation in one file, open llms-full.txt. For a short index of every page, open llms.txt.