# Simple CLI command to get the package id of a DAR

**URL:** <https://forum.canton.network/t/simple-cli-command-to-get-the-package-id-of-a-dar/3388>\
**Category:** Outreach\
**Created:** [October 28, 2021, 8:12pm UTC](https://forum.canton.network/t/simple-cli-command-to-get-the-package-id-of-a-dar/3388 "2021-10-28T20:12:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gyorgybalazsi](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gyorgybalazsi/32/684_2.png) [@gyorgybalazsi](https://forum.canton.network/u/gyorgybalazsi)\
**Post date:** [October 28, 2021, 8:12pm UTC](https://forum.canton.network/t/simple-cli-command-to-get-the-package-id-of-a-dar/3388/1 "2021-10-28T20:12:24Z")

</div>

I didn’t know about this, so maybe will help other learners as well.

The command is:

```haskell
daml damlc inspect .daml/dist/create-daml-app-0.1.0.dar | head -1.

```

The output is like this:

```haskell
package 937a1153cbdfbed187e506af8a72474553a61e038259627b428cba26d95ea437

```

Found in the [Trigger Service](https://docs.daml.com/tools/trigger-service/index.html) section of the docs.

The following command returns a big json which also contains the package id:

```haskell
daml damlc inspect-dar .daml/dist/create-daml-app-0.1.0.dar --json

```

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [October 29, 2021, 7:55am UTC](https://forum.canton.network/t/simple-cli-command-to-get-the-package-id-of-a-dar/3388/2 "2021-10-29T07:55:41Z")

</div>

I recommend using `inspect-dar` over `inspect` which is specifically designed to output metadata like package ids, package names and so on and provides you a stable machine-readable format via the JSON format. `inspect` shows you the Daml-LF which is really more for debugging purposes and not guaranteed to be stable (which is why it does not show up in `daml damlc --help`).

---

<div class="post-metadata">

**Author:** ![gyorgybalazsi](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gyorgybalazsi/32/684_2.png) [@gyorgybalazsi](https://forum.canton.network/u/gyorgybalazsi)\
**Post date:** [January 26, 2022, 9:38pm UTC](https://forum.canton.network/t/simple-cli-command-to-get-the-package-id-of-a-dar/3388/3 "2022-01-26T21:38:52Z")

</div>

I’ve jus learnt the `jq` json editor command, using which we can extract the package id from the output of `inspect-dar`:

```haskell
> daml damlc inspect-dar --json .daml/dist/create-daml-app-0.1.0.dar | jq -r .main_package_id
51525b45d9aa029174f826aa34c4a44fcd1e8aba3f512c10ae7ebf5647aa643c

```
