# Opion to list all versions of packages

**URL:** <https://forum.opentap.io/t/opion-to-list-all-versions-of-packages/1240>\
**Category:** Technical\
**Created:** [October 2, 2023, 6:34pm UTC](https://forum.opentap.io/t/opion-to-list-all-versions-of-packages/1240 "2023-10-02T18:34:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![GoranJohnsson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opentap.io/goranjohnsson/32/140_2.png) [@GoranJohnsson](https://forum.opentap.io/u/GoranJohnsson)\
**Post date:** [October 2, 2023, 6:34pm UTC](https://forum.opentap.io/t/opion-to-list-all-versions-of-packages/1240/1 "2023-10-02T18:34:12Z")

</div>

Using tap.exe package list -r “some repo” only rteturns the newest version of all packagesin the repo. How can I get all versions? The -a Option only works for a single package. Shouldnt -a also work here: tap.exe package list -a

---

<div class="post-metadata">

**Author:** ![rolf\_madsen](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@rolf\_madsen](https://forum.opentap.io/u/rolf_madsen)\
**Post date:** [October 3, 2023, 8:14am UTC](https://forum.opentap.io/t/opion-to-list-all-versions-of-packages/1240/2 "2023-10-03T08:14:18Z")

</div>

Hi @GoranJohnsson,

I can confirm what you see. I think it should, but somehow it does not work…

At the same time, I can see why it might not be a good idea to query everything from the repo easily since that would be a huge query.

What is the reason for doing this?

---

<div class="post-metadata">

**Author:** ![GoranJohnsson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opentap.io/goranjohnsson/32/140_2.png) [@GoranJohnsson](https://forum.opentap.io/u/GoranJohnsson)\
**Post date:** [October 3, 2023, 2:51pm UTC](https://forum.opentap.io/t/opion-to-list-all-versions-of-packages/1240/3 "2023-10-03T14:51:05Z")

</div>

Need this in order to populate a list with all available packages in a custom packet manager (since the PWTA PM cannot manage an arbitrary OpenTAP installation and not forcing the system admin to use the CLI)  
So is this limitation a bug in tap.exe?

---

<div class="post-metadata">

**Author:** ![alexander.larsen](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@alexander.larsen](https://forum.opentap.io/u/alexander.larsen)\
**Post date:** [October 4, 2023, 8:03am UTC](https://forum.opentap.io/t/opion-to-list-all-versions-of-packages/1240/4 "2023-10-04T08:03:05Z")

</div>

Hi @GoranJohnsson ,

As Rolf said, this would be a huge query (and extremely slow). This is probably not what you want.

The way PWTA PM and the online package repository ([packages.opentap.io](http://packages.opentap.io)) does it is to fetch the latest version of all packages to create the initial list, and only request all versions of a particular package on demand (when a package from the list is selected). I would recommend this approach instead.

It sounds like you are using the tap CLI to get the list of packages, and then parsing the output. I would advice against this. We make no promises about the output formatting of CLI actions. Consider using the C# API instead. The source code of the `list` CLI action may be instructive.

You can also take a look at the repository nuget client which we recently published to make it easier for C# applications to interface with the package repository: [NuGet Gallery | OpenTAP.Repository.Client 4.26.1](https://www.nuget.org/packages/OpenTAP.Repository.Client)

I hope this helps! I think a package manager for managing multiple installations on the same system is a good idea. I look forward to see what you come up with

---

<div class="post-metadata">

**Author:** ![GoranJohnsson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opentap.io/goranjohnsson/32/140_2.png) [@GoranJohnsson](https://forum.opentap.io/u/GoranJohnsson)\
**Post date:** [October 4, 2023, 9:10am UTC](https://forum.opentap.io/t/opion-to-list-all-versions-of-packages/1240/5 "2023-10-04T09:10:08Z")

</div>

Yes I’m using the CLI and parse the output, works pretty well now. I would prefer to use the API but found this part hard to understand and not so documented. i will however look into it again. Thanks

---

<div class="post-metadata">

**Author:** ![rolf\_madsen](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@rolf\_madsen](https://forum.opentap.io/u/rolf_madsen)\
**Post date:** [October 4, 2023, 11:25am UTC](https://forum.opentap.io/t/opion-to-list-all-versions-of-packages/1240/6 "2023-10-04T11:25:51Z")

</div>

If you need an example of how to make a package manager, you can check out the code for the TUI. It implements a full package manager:

[https://github.com/StefanHolst/opentap-tui/blob/main/OpenTAP.TUI/Views/PackageListView.cs](https://github.com/StefanHolst/opentap-tui/blob/main/OpenTAP.TUI/Views/PackageListView.cs)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/opentap/original/1X/f052cbd41d7d787a2feee267654fdad854a7c598.png)
