bevy cli

Created on 5 Sep 2020  路  3Comments  路  Source: bevyengine/bevy

It would be great if we could have an official bevy cli. Here's some ideas off the top of my head for how it might look:

  • bevy new --template {shooter,2D,etc...} - generates a new bevy project following the best bevy practices
  • bevy build {platform} --release - builds the project and generates an artifact for the given platform
  • bevy prepare {platform} - prepares the platform to be built. Generates xcode project / android studio project, etc.
  • bevy doctor - checks your environment for any known gotchas.

    • Could verify that you have fast compiling setup correctly, including verifying lld or zld are installed

    • Could check for missing ANDROID_SDK_ROOT environment variables, outdated xcode version, etc...

  • bevy upgrade --version {version} - upgrades the bevy version, performing auto-migrations for breaking changes
  • bevy lint - possibly checks the project for best practices?

A lot of this functionality could be replaced or improved by an editor, and there's much we'd want to change from this, but I believe it could be incredibly useful!

enhancement

Most helpful comment

Yeah I think eventually we'll need a bevy cli tool. But I do want to focus on using existing ecosystem tools where we can. And I also don't want a bevy cli to be a required part of bevy setup or a part of our "getting started" guide. People should be able to get up and running with a common set of tools (namely git and cargo).

bevy new --template {shooter,2D,etc...}

git clone https://github.com/bevyengine/shooter-template

bevy build {platform} --release - builds the project and generates an artifact for the given platform

cargo build --target=SOME_TARGET. However cross platform builds often require extra configuration and/or only work on certain platforms (ex: android and ios), so automation here will be needed. I think i would prefer it if we made non-bevy tools better at this though as this isn't a bevy-specific problem. Ex: https://github.com/rust-embedded/cross

bevy prepare {platform} - prepares the platform to be built. Generates xcode project / android studio project, etc.

we might actually need a custom tool for this. once we have working android / ios builds we should definitely discuss what automation is needed here.

bevy doctor - checks your environment for any known gotchas.

yeah i like this :smile:

Could verify that you have fast compiling setup correctly, including verifying lld or zld are installed

yupyup good call

Could check for missing ANDROID_SDK_ROOT environment variables, outdated xcode version, etc...

yeah these things are easy to mess up and would benefit from some validation. im hoping we can make the "cross" project (or something like it) work for us so we can have a standardized way of building things without too much custom setup. but i guess setting up docker presents its own set of problems.

bevy upgrade --version {version} - upgrades the bevy version, performing auto-migrations for breaking changes

yeah as bevy starts to stabilize and people start building serious projects in it, migrations are a good idea.

bevy lint - possibly checks the project for best practices?

definitely an interesting idea. are clippy extensions a thing? it would be really cool to have some bevy clippy lints. the editor would likely do this at some point, so exposing that via cli is probably a good idea

So yeah, in general i think this tool will become necessary eventually, but I don't want to build custom bevy tools when we can invest our development energy into ecosystem tools / use whats already out there.

All 3 comments

Yeah I think eventually we'll need a bevy cli tool. But I do want to focus on using existing ecosystem tools where we can. And I also don't want a bevy cli to be a required part of bevy setup or a part of our "getting started" guide. People should be able to get up and running with a common set of tools (namely git and cargo).

bevy new --template {shooter,2D,etc...}

git clone https://github.com/bevyengine/shooter-template

bevy build {platform} --release - builds the project and generates an artifact for the given platform

cargo build --target=SOME_TARGET. However cross platform builds often require extra configuration and/or only work on certain platforms (ex: android and ios), so automation here will be needed. I think i would prefer it if we made non-bevy tools better at this though as this isn't a bevy-specific problem. Ex: https://github.com/rust-embedded/cross

bevy prepare {platform} - prepares the platform to be built. Generates xcode project / android studio project, etc.

we might actually need a custom tool for this. once we have working android / ios builds we should definitely discuss what automation is needed here.

bevy doctor - checks your environment for any known gotchas.

yeah i like this :smile:

Could verify that you have fast compiling setup correctly, including verifying lld or zld are installed

yupyup good call

Could check for missing ANDROID_SDK_ROOT environment variables, outdated xcode version, etc...

yeah these things are easy to mess up and would benefit from some validation. im hoping we can make the "cross" project (or something like it) work for us so we can have a standardized way of building things without too much custom setup. but i guess setting up docker presents its own set of problems.

bevy upgrade --version {version} - upgrades the bevy version, performing auto-migrations for breaking changes

yeah as bevy starts to stabilize and people start building serious projects in it, migrations are a good idea.

bevy lint - possibly checks the project for best practices?

definitely an interesting idea. are clippy extensions a thing? it would be really cool to have some bevy clippy lints. the editor would likely do this at some point, so exposing that via cli is probably a good idea

So yeah, in general i think this tool will become necessary eventually, but I don't want to build custom bevy tools when we can invest our development energy into ecosystem tools / use whats already out there.

For templating you can use Hygen (I'm the author), get a feel for bevy+templates, and get a good idea of how a CLI can function in terms of developer experience for bevy. On the event that we'll never get to build that CLI, then you're left with a fully functioning app generator:

http://www.hygen.io/

It started as a toolchain for any project, grabbed a focus in the frontend community, but I do use it for everything (using the binary, no need for node.js)

bevy_template currently supports a tiny bit of this functionality (mainly configuring fast-compile stuff and installing external linkers). I have a discussion topic open on it: https://github.com/bevyengine/bevy/discussions/557

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sztomi picture sztomi  路  4Comments

atsuzaki picture atsuzaki  路  4Comments

ben186 picture ben186  路  5Comments

Laozey picture Laozey  路  5Comments

cart picture cart  路  3Comments