I didn’t know about this, so maybe will help other learners as well.
The command is:
daml damlc inspect .daml/dist/create-daml-app-0.1.0.dar | head -1.
The output is like this:
Found in the Trigger Service section of the docs.
The following command returns a big json which also contains the package id:
daml damlc inspect-dar .daml/dist/create-daml-app-0.1.0.dar --json
I recommend using
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).
I’ve jus learnt the
jq json editor command, using which we can extract the package id from the output of
> daml damlc inspect-dar --json .daml/dist/create-daml-app-0.1.0.dar | jq -r .main_package_id