# Adding a Command to a Beat

**URL:** <https://discuss.elastic.co/t/adding-a-command-to-a-beat/165851>\
**Category:** Beats\
**Created:** [January 26, 2019, 3:15pm UTC](https://discuss.elastic.co/t/adding-a-command-to-a-beat/165851 "2019-01-26T15:15:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andre\_Baskin](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@Andre\_Baskin](https://discuss.elastic.co/u/Andre_Baskin)\
**Post date:** [January 26, 2019, 3:15pm UTC](https://discuss.elastic.co/t/adding-a-command-to-a-beat/165851/1 "2019-01-26T15:15:10Z")

</div>

I am wondering what is the preferred method to add a command (or subcommand) to a Beat. The Beat was created from scratch using the instructions in the [Beats Developer Guide](https://www.elastic.co/guide/en/beats/devguide/current/index.html). The issue I am having is that Cobra library used by libbeat is located under {beat root}/vendor/github.com/elastic/beats/vendor/github.com/spf13/cobra and the library is not available to the Beat. My solution was to move spf13/cobra from the libbeat vendor directory tree to the beat vendor directory tree, but this seems messy at best. If there a better way to do this?

---

<div class="post-metadata">

**Author:** ![kvch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kvch/32/72058_2.png) [@kvch](https://discuss.elastic.co/u/kvch)\
**Post date:** [January 29, 2019, 12:43pm UTC](https://discuss.elastic.co/t/adding-a-command-to-a-beat/165851/2 "2019-01-29T12:43:48Z")

</div>

I suggest you use `govendor` to handle your dependencies: [https://github.com/kardianos/govendor](https://github.com/kardianos/govendor)  
You can add and remove dependencies as you need: [https://github.com/kardianos/govendor/blob/master/doc/faq.md](https://github.com/kardianos/govendor/blob/master/doc/faq.md)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 26, 2019, 2:43pm UTC](https://discuss.elastic.co/t/adding-a-command-to-a-beat/165851/3 "2019-02-26T14:43:49Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
