# `alta schemas`

> alta schemas: writes the JSON Schemas (default docs/standards/schemas/).

Writes the JSON Schemas (default docs/standards/schemas/).

*Les descriptions et les sorties sont en anglais, comme la CLI.*

## Usage

```text
alta schemas [--out <dir>] [--check]
```

## Options

| Nom | Type | Défaut | Description |
|---|---|---|---|
| `--out` | *string* | *Défaut: docs/standards/schemas/* | Where to write the schemas. |
| `--check` | *flag* |  | Write nothing; exit 1 if a schema on disk is out of date. |

## Codes de sortie

| Nom | Description |
|---|---|
| `0` | ok |
| `1` | problèmes trouvés |
| `2` | mauvais usage |
| `3` | pas dans cette version |

## Exemples

*Write the schemas for your editor*

```sh [Terminal]
alta schemas --out schemas
```

```text [Sortie]
wrote 10 schemas to schemas
```

**TypeScript SDK:**

*La même chose en TypeScript, avec `schemas` de `@altasystem/sdk` ; lance-le avec `node example.mjs`.*

```js [example.mjs]
// The JSON Schema of a document, and its problems against it (what an editor underlines).
import { schemaFields, schemaFor, validateSchema } from "@altasystem/sdk";

const schema = schemaFor("alta.quests/0.3");
console.log(schema.$id);
console.log(schemaFields(schema).length > 50);
console.log(validateSchema(schema, { schema: "alta.quests/0.3", id: "my-pack", branch: "core", quests: "none" }));
```

```text [Sortie]
alta.quests.schema.json
true
[ 'quests: must be array' ]
```

## Voir aussi

- [Autocomplétion dans ton éditeur](https://docs.altasystem.ai/fr/recipes/editor-schemas)
- [`schemas` (SDK)](https://docs.altasystem.ai/fr/reference/sdk/schemas)
