#How to download a cli?

1 messages · Page 1 of 1 (latest)

brave shuttle
#

I'm new to Dagger but have some experience with Cue.
I'm working with Supabase, and would like to, firstly, download the Supabase cli.
I"m reviewing the docs, but cannot find any examples of downloading - eg, using curl, or installing a dependency via brew.

patent hound
#

Welcome @brave shuttle 👋

#

Previously Dagger was all CUE, but all new development is in the newer multilanguage SDKs (backed by a common API). If you're just getting started with Dagger, I'd recommend starting with one of those.

Could the Go, Python, or Node.js (Javascript/Typescript) SDK work for you?

brave shuttle
#

Hi Jeremy.
I was hoping to use Cue. Cue is one of the reasons I was looking to use Dagger.

patent hound
#

You certainly can. But there is no new development happening in the CUE SDK, to set your expectations.

brave shuttle
#

Oh that is a shame.
Is the use of Cue in Dagger being abondoned?

patent hound
#

We got overwhelming feedback that CUE was difficult for folks to learn and that they would prefer to use languages they were already familiar with / were using already in their apps. It turned out that some things turned out to be super elegant in CUE, but some things were VERY difficult/impossible, but trivial in other languages like Go, Python, Node.js.

#

So the new SDKs are built on a new foundation of a common API layer that is distinct from the CUE version.

brave shuttle
#

Ok. I can understand that. Cue is really powerful for configuration. Its not a general purpose programming language.

patent hound
#

Here's an example of grabbing the Supabase CLI using one of the techniques outlined here:
https://supabase.com/docs/guides/cli
https://github.com/supabase/cli/releases

my main.go file:

package main

import (
    "context"
    "fmt"
    "time"

    "dagger.io/dagger"
)

func main() {
    ctx := context.Background()
    client, err := dagger.Connect(ctx)
    if err != nil {
        panic(err)
    }
    src := client.Host().Directory(".")
    release := "https://github.com/supabase/cli/releases/download/v1.45.2/supabase_1.45.2_linux_arm64.apk"

    supabase := client.
        Container().
        From("alpine:latest").
        WithExec([]string{"apk", "add", "curl"}).
        WithExec([]string{"curl", "-L", release, "-o", "supabase.apk"}).
        WithExec([]string{"apk", "add", "--allow-untrusted", "supabase.apk"})

    test := supabase.
        WithMountedDirectory("/src", src).
        WithWorkdir("/src").
        // ensure next step is not cached (just so we can observe it)
        WithEnvVariable("NO_CACHE", time.Now().String()).
        WithExec([]string{"supabase", "-v"})
    out, err := test.Stdout(ctx)

    if err != nil {
        panic(err)
    }
    fmt.Println(out)
}
go run main.go
1.45.2
GitHub

Supabase CLI. Contribute to supabase/cli development by creating an account on GitHub.

#

I'm on a Mac M1, so I chose an Arm version from the releases

patent hound
#

Another type of example is using an existing container image that has a CLI you want in it. In this case someone wanted to use Hadolint to lint their Dockerfile: #1083678065042927646 message