Copy direct webdav link to file

Nextcloud version (eg, 20.0.5): Nextcloud Hub 6 (27.1.3)
Operating system and version (eg, Ubuntu 20.04): Debian 11
Apache or nginx version (eg, Apache 2.4.25): nginx 1.18.0-6.1+deb11u3
PHP version (eg, 7.4): 8.2

The issue you are facing:

I am looking for a way to copy a direct webdav link to a file in the form of https://DOMAIN.TLD/remote.php/dav/files/USERNAME/PATH/TO/DIRECTORY/FILE.EXT. It is to be used in a script fed to curl command to access the file directly to download. As of currently I would have to assemble the link myself from 3 different pieces (webdav link available from the sidepanel, directory path available from the url and filename available from details pane)
I have not found this feature in the nextcloud itself nor in the plugin directory

You can create a share link - click on share → share link and you get something like https://cloud.domain.tld/s/rZnJ6byAzL5SFxg
Anyway, this is not, what webdav is made for.
Use ssh and move to the coresponding folder you want to use.

I don’t need to share a file with anyone. I don’t need to access the file on a remote server. I don’t want to have to download an entire file to my hard drive every time I want to use it.

Per Nextcloud documentation,

With a WebDAV, client you can access your Nextcloud Files (including shares) on Linux, macOS and Windows in a similar way as any remote network share, and stay synchronized.

This is basically what my usecase is. it does work, granted I pass proper authentication and link to the application. The issue is, Nextcloud is not making it easy getting this link with a button press, but have to do gymnastics all over the interface to find necessary info. Its all there already, both in functionality and available information, why isn’t that information presented in one place

You can not direct download the file because your file needs a username/password. Here you find an example to use curl with Nextcloud and username/password.

I don’t know your use case. But sometimes it is easier to save files directly to a web server. In this case, you may not need a user and password. Of course, this also depends on the confidentiality of the data.