# How to add a command to verdi in plugin?

**URL:** <https://aiida.discourse.group/t/how-to-add-a-command-to-verdi-in-plugin/186>\
**Category:** General Usage\
**Created:** [December 1, 2023, 4:05pm UTC](https://aiida.discourse.group/t/how-to-add-a-command-to-verdi-in-plugin/186 "2023-12-01T16:05:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xing](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/xing/32/10_2.png) [@Xing](https://aiida.discourse.group/u/Xing)\
**Post date:** [December 1, 2023, 4:05pm UTC](https://aiida.discourse.group/t/how-to-add-a-command-to-verdi-in-plugin/186/1 "2023-12-01T16:05:51Z")

</div>

Hi all, in the AiiDA docs, it says one can add a subcommand to a existing verdi commands, e.g., `verdi data mycmd`.  
What if I want to add a new command to `verdi` directly, e.g.,

```console
verdi worktree 

```

Which entry point should I use?

---

<div class="post-metadata">

**Author:** ![sphuber](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/sphuber/32/6_2.png) [@sphuber](https://aiida.discourse.group/u/sphuber)\
**Post date:** [December 1, 2023, 4:10pm UTC](https://aiida.discourse.group/t/how-to-add-a-command-to-verdi-in-plugin/186/2 "2023-12-01T16:10:41Z")

</div>

There is no such entry point mechanism for top level commands. It just exists for `verdi data`. You would have to provide your own CLI endpoint.

---

<div class="post-metadata">

**Author:** ![Xing](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/xing/32/10_2.png) [@Xing](https://aiida.discourse.group/u/Xing)\
**Post date:** [December 1, 2023, 4:13pm UTC](https://aiida.discourse.group/t/how-to-add-a-command-to-verdi-in-plugin/186/3 "2023-12-01T16:13:56Z")

</div>

Should we provide the entry point for adding other commands?

---

<div class="post-metadata">

**Author:** ![sphuber](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/sphuber/32/6_2.png) [@sphuber](https://aiida.discourse.group/u/sphuber)\
**Post date:** [December 1, 2023, 7:44pm UTC](https://aiida.discourse.group/t/how-to-add-a-command-to-verdi-in-plugin/186/4 "2023-12-01T19:44:03Z")

</div>

Certainly we can discuss it with the rest of the team. Maybe we should make an analysis first of the potential downsides. One I can see is that the response speed of `verdi` as a whole can suffer if plugin commands are slow. This could affect tab-completion as a whole, which would be not desirable.
