# Parsers

Not familiar with parsers? Head over to the existing parsers documentation and learn more about why you need them and how to use them.

{% hint style="info" %}
We're currently working on making [our existing parsers](/v1/concepts/parsers.md#all-parsers-available) compatible with the SDTF. We'll update this page accordingly.
{% endhint %}

## General properties

You must set a name and your desired output for each parser:

1. The `name` is the name of the parser
2. The `output` property indicates which type of output you want the parser to produce

### Output types

Parsers support none, some or more output types, please refer to dedicated parser pages for details.

#### File

Use case: the parser is expected to produce exactly one file.

```typescript
type FileOutput = {
  type: 'file';
  filePath: string;
}
```

**Directory**

Use case: the parser is expected to produce 0 to N files, all placed in the given `directoryPath`.

```typescript
type DirectoryOutput = {
  type: 'directory';
  directoryPath: string;
}
```

Example with the `to-css-custom-properties` parser:

```json
"parsers": [
  {
    "name": "to-css-custom-properties",
    "output": {
      "type": "file",
      "filePath": "style.css"
    }
  }
  // ...
]
```

## Available parsers

<table data-full-width="true"><thead><tr><th width="264">Parser</th><th width="586.3333333333334">Description</th><th>Usage example</th></tr></thead><tbody><tr><td><a href="/pages/e5uwdxyZlD0XnMxcVee3">change-case</a></td><td>This parser helps you change the case of names or modes over a SDTF graph.</td><td><a href="/pages/e5uwdxyZlD0XnMxcVee3#basic-usage">Example</a></td></tr><tr><td><a href="/pages/IVkVaCy2A4f0lx2PUy4y">convert-color</a></td><td>This parser helps you convert the color formats of color compatible tokens over a SDTF graph.</td><td><a href="/pages/IVkVaCy2A4f0lx2PUy4y#basic-usage">Example</a></td></tr><tr><td><a href="/pages/oqdCIpt4DdE4H4rvtVO6">filter</a></td><td>This parser helps you filter a SDTF graph.</td><td><a href="/pages/oqdCIpt4DdE4H4rvtVO6#basic-usage-select-all-tokens-from-a-group-in-a-collection">Example</a></td></tr><tr><td><a href="/pages/QW4LJy8o0fvrJffcQpRm">select-modes</a></td><td>This parser helps you select design tokens from specific mode(s).</td><td><a href="/pages/QW4LJy8o0fvrJffcQpRm#basic-usage-select-all-tokens-from-a-mode-named-light">Example</a></td></tr><tr><td><a href="/pages/n4yvurscwVNuXhoOj4XM">to-css-custom-properties</a></td><td>This parser helps you transform design tokens in CSS Custom Properties.</td><td><a href="/pages/n4yvurscwVNuXhoOj4XM#basic-usage">Example</a></td></tr><tr><td><a href="/pages/wPZbDOxCIubSYJULjdAw">to-sdtf</a></td><td>This parser helps you get your design tokens as a SDTF graph in JSON.</td><td><a href="/pages/wPZbDOxCIubSYJULjdAw#basic-usage">Example</a></td></tr><tr><td><a href="/pages/dEJsBhLw7B3C1A7gfbkz">to-style-dictionary</a></td><td>This parser helps you generate <a href="https://amzn.github.io/style-dictionary/#/">Style Dictionary</a> raw token files for all your design tokens coming from Specify.</td><td><a href="/pages/dEJsBhLw7B3C1A7gfbkz#basic-usage">Example</a></td></tr><tr><td><a href="/pages/Fx8MtL3f0Vij7cSFnVEx">to-tailwind</a></td><td>This parser helps you generate a Tailwind theme from all your design tokens coming from Specify.</td><td><a href="/pages/Fx8MtL3f0Vij7cSFnVEx#basic-usage">Example</a></td></tr><tr><td><a href="/pages/3lmR8Y6YbnbG6HSN38Vv">to-javascript</a></td><td>This parser helps you pull design tokens as JavaScript objects for all token types and their respective getter functions.</td><td><a href="/pages/3lmR8Y6YbnbG6HSN38Vv#basic-usage">Example</a></td></tr><tr><td><a href="/pages/lzXST2v3gJWglQXGwS4b">to-json</a></td><td>This parser helps you pull design tokens in JSON with token values in JSON or CSS.</td><td><a href="/pages/lzXST2v3gJWglQXGwS4b#basic-usage-json-token-values">Example</a></td></tr><tr><td><a href="/pages/IsknWBnzRZUW4knGXgyT">to-typescript</a></td><td>This parser helps you pull design tokens as TypeScript objects for all token types and their respective getter functions.</td><td><a href="/pages/IsknWBnzRZUW4knGXgyT#basic-usage">Example</a></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.specifyapp.com/v1/advanced-repository/parsers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
