# Bootstrap an XD plugin with xdpm

[Canonical article](https://www.ashryan.io/writing/bootstrap-an-xd-plugin-with-xdpm/)

Published: 2019-11-26

A pull request for bootstrapping XD plugins with the xdpm CLI.

I had a *little* time to unwind by coding during Adobe MAX this year, and pushed a new branch `bootsie` to [xdpm](https://github.com/adobexd/xdpm?ref=ashryan.io), the CLI for XD plugin development utilities. It’s something I started hacking on a bit in May to make the process of getting a basic XD plugin started even easier for those who prefer working in the Terminal.

## Generate your XD plugin

If we merge this branch, you’ll be able to bootstrap XD plugins with xdpm.

Current usage (any of the following):

```plaintext
$ xdpm bootstrap
$ xdpm bootstrap panel
$ xdpm bootstrap my-plugin
$ xdpm bootstrap panel my-plugin
```

Plugin type options:

- headless (default)
- panel
- modal
- react

Each of the bootstrap options is pulled directly from the [XD plugin samples repo on GitHub](https://github.com/AdobeXD/plugin-samples?ref=ashryan.io), which are updated to align with changes as the Plugin API evolves.

## Thanks and acknowledgements

Thanks to [Pablo Klaschka](https://xdplugins.pabloklaschka.de/?ref=ashryan.io) and [Kerri Shotts](https://twitter.com/kerrishotts?ref=ashryan.io) for the feedback and discussion around this pull request.

This option for bootstrapping will join at least two others that are already out there.

- [`generator-xd-plugin` for Yeoman](https://github.com/adobexd/generator-xd-plugin?ref=ashryan.io)
- [`xd-plugin-boilerplate`](https://github.com/pklaschka/xd-plugin-boilerplate?ref=ashryan.io)

Depending on your needs, these may offer features that better align with your workflow.

## Possible future work

I hope others will find this feature useful in its current iteration and that it serves as a solid starting point for more robust bootstrapping options in the future.

Some things that have either been suggested or are otherwise on my mind:

- [Custom template support](https://github.com/AdobeXD/xdpm/pull/31?ref=ashryan.io)
- [Production-oriented instrumentation](https://github.com/AdobeXD/xdpm/pull/31?ref=ashryan.io)
- [Interactive mode](https://github.com/AdobeXD/xdpm/pull/31?ref=ashryan.io)
- A more performant way to pull the default samples (currently all samples are cloned, then all but one are removed)
- Verbose mode with informative stdout/stderr output

Feel free to jump in on the [pull request discussion](https://github.com/AdobeXD/xdpm/pull/31?ref=ashryan.io).
