> For the complete documentation index, see [llms.txt](/llms.txt)

# Getting started

Glotto turns a single API spec into idiomatic SDKs across 13 languages (mobile-first), a docs
site you own, and a multi-mode MCP server — provably correct and in lockstep with your spec. You describe your API and outputs in a
`glotto.yml`, point it at an OpenAPI / AsyncAPI / GraphQL spec, and run the `glotto` CLI.

## A minimal project

A Glotto project is a `glotto.yml` plus a spec file:

```yaml
organization:
  name: Petstore
  contact: api@petstore.example
openapi:
  source: ./petstore.openapi.yaml
environments:
  production: https://api.petstore.example
targets:
  typescript: {}
resources:
  pets:
    methods:
      listPets: get /pets
```

## The workflow

> **Glotto is in private beta.** `@glotto/cli` is not on the public npm registry yet, and sign-in is
> by invitation, so the install below will not resolve for you today. The workflow is real and is
> what shipping looks like once you have access — it is written out here so you can see what you are
> signing up for, not so you can run it this afternoon. Ask for an invitation at
> [hello@glotto.dev](mailto:hello@glotto.dev).

The published `@glotto/cli` is a **thin client** — code generation runs server-side in the
Glotto control plane, so you authenticate once, then generate. A fresh install to first SDKs:

```sh
npm install -g @glotto/cli   # the thin client (engines run server-side)
glotto login                 # authenticate to the control plane (device flow)
glotto init                  # scaffold glotto.yml + spec/openapi.yaml
# …edit glotto.yml and spec/openapi.yaml to describe your API…
glotto generate              # validate the config, then generate SDKs into ./sdks
```

- **`glotto login`** authenticates to the control plane and stores a token under `~/.glotto/`.
  `glotto generate` needs it because generation runs server-side.
- **`glotto init`** scaffolds a starter `glotto.yml` and `spec/openapi.yaml`.
- **`glotto generate`** first validates your `glotto.yml`, then writes SDKs for every
  configured target into `./sdks` (override with `--out`, or limit with `--target typescript`).
  Because it validates first, there is no separate check step in the happy path — a config
  error stops generation with the same diagnostics.

Prefer to keep your editor honest? `glotto schema` prints the `glotto.yml` JSON Schema you can
wire into a `# yaml-language-server: $schema=…` header. These four commands — `login`, `init`,
`schema`, `generate` (plus `logout` and `mcp`) — are what the published CLI ships.

See the [CLI reference](/docs/cli) for every command, its flags, and which distribution
provides it, and the [glotto.yml reference](/docs/glotto-yml) for the full configuration schema.
