nuxt-hub / core

Build full-stack applications with Nuxt on CloudFlare, with zero configuration.
https://hub.nuxt.com
Apache License 2.0
993 stars 57 forks source link

Parameterized nuxthub link #358

Closed bovium closed 2 weeks ago

bovium commented 3 weeks ago

Is your feature request related to a problem? Please describe. I would like to be able to create new projects in hub.nuxt.com from a github pipeline ex. using a parameterized nuxthub link.

Describe the solution you'd like Instead of the questions where you type the input on nuxthub link is would like syntax ala this: nuxthub link --team "TeamName" --newproject --projectname "ProjectName" --region "Western Europe" --branch "master"

Describe alternatives you've considered I consider wrapping the "nuxthub link" with some tool appropriate for that to automize this to have the same behavior as a parameterized command.

atinux commented 3 weeks ago

Wouldn't it better to use our REST API if we expose it or you rather use the CLI?

bovium commented 3 weeks ago

Wouldn't it better to use our REST API if we expose it or you rather use the CLI?

Yes that would be perfect.

It would be very slick if I could do all the things I can do manually in the nuxthub UI through a Rest API.

What about authorization NUXT_HUB_USER_TOKEN should be used against the REST API I imagine?

atinux commented 3 weeks ago

You can actually do all the things with our REST API with the NUXT_HUB_USER_TOKEN, actually you can also create your own user token in the dashboard:

https://github.com/user-attachments/assets/2dad83e6-e06f-4d96-af7a-bd293e03d0ee

Then you can do the same actions as the CLI, checkout this file as it as most of the API actions: https://github.com/nuxt-hub/cli/blob/main/src/utils/data.mjs