# Export all maps in a directory

**URL:** <https://discourse.mapeditor.org/t/export-all-maps-in-a-directory/4755>\
**Category:** Questions\
**Created:** [October 2, 2020, 5:49pm UTC](https://discourse.mapeditor.org/t/export-all-maps-in-a-directory/4755 "2020-10-02T17:49:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhughson](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/mhughson/32/2566_2.png) [@mhughson](https://discourse.mapeditor.org/u/mhughson)\
**Post date:** [October 2, 2020, 5:49pm UTC](https://discourse.mapeditor.org/t/export-all-maps-in-a-directory/4755/1 "2020-10-02T17:49:14Z")

</div>

Is it possible to run Tiled from command line (ideally in a headless form) and export a map (to json in my case)?

Essentially I want to add a step to my game’s build pipeline to export every TMX map in a directory to JSON (rather than having to do it manually map, by map).

Thanks!

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [October 2, 2020, 6:31pm UTC](https://discourse.mapeditor.org/t/export-all-maps-in-a-directory/4755/2 "2020-10-02T18:31:56Z")

</div>

Yeah, you can do this with the `--export-map` command-line parameter. It’s briefly mentioned [here](https://doc.mapeditor.org/en/stable/manual/export/), but I should document the command-line properly sometime.

```nohighlight
tiled --export-map [format] <inputfile> <outputfile>

```

The `format` is optional and will be auto-detected by the file extension, it generally only needs to be used when the file extension is ambiguous (.json generally isn’t, unless you enabled both the “json” plugin and the “json1” plugin). You can get the list of formats using:

```nohighlight
tiled --export-formats

```
