It is possible to use curl to query the LXD unix.socket directly:
curl --unix-socket /var/lib/lxd/unix.socket http:/1.0/containers | jq .
Example output:
{
"type": "sync",
"status": "Success",
"status_code": 200,
"operation": "",
"error_code": 0,
"error": "",
"metadata": [
"/1.0/containers/base",
"/1.0/containers/jay-test-99",
"/1.0/containers/jays-awesome-container-2"
]
}
I know that this is an old question, but for someone ending up here while searching for how to copy files between host and container, this might help.
To pull a file 'my-file' from the container 'container-name' to the current folder, use:
lxc file pull container-name/any-path/my-file .
To push 'my-file', use:
lxc file push my-file container-name/any-path/
To push a folder 'my-dir' recursive, use:
lxc file push -r my-dir container-name/any-path/