#Can I call builtin functions without using a module?
1 messages · Page 1 of 1 (latest)
Not yet but will be added soon: https://github.com/dagger/dagger/issues/6947
Problem There is no way to call core functions from the CLI Solution Allow calling core functions from the CLI. See https://daggerverse.dev/mod/github.com/shykes/core for a userland implementation.
In the meantime there are workarounds
Thanks to a small bug in the Go SDK, you can use this small bash/zsh function to emulate it: #daggernauts message
function core() {
(
set -ex
cd $(mktemp -d)
echo "{\"name\":\"$1\", \"sdk\":\"go\"}" > dagger.json
echo 'package main' > main.go
shift
dagger call "$@"
)
}
core container from --address=alpine with-exec --args="echo,hello world" stdout
That is very neat, thanks a bunch!
Something that might be related: #daggernauts message
Did you do anything more with that, or thought about it further?
It seems to me that it could be a way of actually calling the builtins, either directly via CLI or through a she-banged script like your example.
With the current workaround, and possible what comes from the PR you linked, I guess it is the go SDK that is used to interact with the engine, rather than something sh-esque.