Extract Daml source files from a DAR?
App Development4 posts171 views3 likesLast activity Jul 2026
WA
WallaceKellyOP
Sep 2024How can I extract the Daml source files from a DAR?
(assuming they have not been removed)
WA
WallaceKelly
Sep 2024 2The following works on macOS:
unzip some.dar '*.daml'
WA
WallaceKelly
Dec 2025 1Keep in mind that there is no guarantee that the embedded Daml source files are exactly the same as the source files used to compile the DAR.
DAR files are in in the zip format (similar to Java ecosystem’s JAR files). The Daml source files are included in the DAR files for convenience. However, replacing them does not invalidate the DAR file.
SI
Simon_Letort
Jul 2026Bash script to extract all .daml files from .dar archives in the current directory
#!/bin/bash
# Script to extract all .daml files from .dar archives in the current directory
for dar_file in *.dar; do
if [ -f "$dar_file" ]; then
echo "Extracting .daml files from: $dar_file"
unzip -o "$dar_file" '*.daml'
fi
done
echo "Done extracting .daml files from all .dar archives"