Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move cloud commands under spin cloud #1117

Closed
michelleN opened this issue Feb 7, 2023 · 3 comments · Fixed by #1139
Closed

move cloud commands under spin cloud #1117

michelleN opened this issue Feb 7, 2023 · 3 comments · Fixed by #1139
Assignees
Labels
enhancement New feature or request

Comments

@michelleN
Copy link
Member

Going forward, it would be nice to move cloud related commands under the spin cloud command.

$ spin login -> spin cloud login
$ spin deploy -> spin cloud deploy

For convenience, we should leave aliases for spin login and spin deploy but all other cloud related commands should be added under spin cloud.

@michelleN michelleN added the enhancement New feature or request label Feb 7, 2023
@michelleN michelleN changed the title move spin deploy/login to spin cloud deploy/login move cloud commands under spin cloud Feb 7, 2023
@bacongobbler bacongobbler self-assigned this Feb 13, 2023
@bacongobbler
Copy link
Member

bacongobbler commented Feb 14, 2023

we should leave aliases for spin login and spin deploy

Slight technical blocker... I cannot create an alias from spin deploy to spin cloud deploy. Or at least, I'm not familiar enough with Clap to know how to do this.

Clap has a feature called replace, but it is marked unstable behind the unstable-replace flag. There is no support for this flag in clap-derive, which we use for aliasing commands in the Spin CLI. It sounds like the replace feature is expected to be removed and replaced with proper cross-command alias support in the future, but the last time it saw any activity was in late 2021.

How should we proceed?

@itowlson
Copy link
Contributor

We could leave the Deploy and Login subcommand enum variants (hidden if desired), with the variants having the same payloads as the matching Cloud commands? It will be duplication rather than true aliasing, but nobody would know... (I hope)

(We will need to be sneakier than this when cloud becomes a plugin, but we'll likely be figuring out clap sorcery at that point anyway, e.g. to make cloud appear in help text.)

@bacongobbler
Copy link
Member

That seems like a possible solution. Calling spin deploy won't actually point you to spin cloud deploy, but close enough. 🤷🏼

Okay, I've marked those commands as hidden, so now you see this with spin help:

><> ./target/release/spin help
spin 0.8.0 (fd67c3d 2023-02-14)
The Spin CLI

USAGE:
    spin <SUBCOMMAND>

OPTIONS:
    -h, --help       Print help information
    -V, --version    Print version information

SUBCOMMANDS:
    add          Scaffold a new component into an existing application
    bindle       Commands for publishing applications as bindles
    build        Build the Spin application
    cloud        Commands for publishing applications to Fermyon Cloud
    help         Print this message or the help of the given subcommand(s)
    new          Scaffold a new application based on a template
    plugins      Install/uninstall Spin plugins
    registry     Commands for working with OCI registries to distribute applications. The set of
                     commands for OCI is EXPERIMENTAL, and may change in future versions of Spin.
                     Currently, the OCI commands are reusing the credentials from
                     ~/.docker/config.json to authenticate to registries
    templates    Commands for working with WebAssembly component templates
    up           Start the Spin application

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants