https://github.com/timjentzsch/cargo-bavy
A third-party CLI utility for the Bevy game engine.
https://github.com/timjentzsch/cargo-bavy
bevy cli
Last synced: over 1 year ago
JSON representation
A third-party CLI utility for the Bevy game engine.
- Host: GitHub
- URL: https://github.com/timjentzsch/cargo-bavy
- Owner: TimJentzsch
- License: apache-2.0
- Created: 2022-08-16T19:07:32.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-26T17:44:57.000Z (over 3 years ago)
- Last Synced: 2024-09-18T00:10:09.377Z (almost 2 years ago)
- Topics: bevy, cli
- Language: Rust
- Homepage:
- Size: 101 KB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# cargo-bavy [](https://crates.io/crates/cargo-bavy) [](https://github.com/TimJentzsch/cargo-bavy/#license)
> [!WARNING]
>
> **DEPRECATED**: Use the [bevy_cli](https://github.com/TheBevyFlock/bevy_cli) instead.
A third-party command-line utility for the [Bevy game engine](https://bevyengine.org/).
To not steal the `cargo bevy` command from the official Bevy maintainers, I chose `cargo bavy` instead.
## Installation
```cli
cargo install cargo-bavy
```
## Usage
### Creating a new Bevy app
Run the following command:
```cli
cargo bavy new
```
You can then select all the features that you want.
Afterwards, a template project with the given name is created for you.
### Running your game
Run the following command:
```cli
cargo bavy run
```
This works similar to `cargo run`, but automatically passes the `--features bevy/dynamic` flag to get faster compile times.
It also provides a `--wasm`/`-w` flag, which allows you to quickly **test your game for the web**.
It will automatically compile your game for `wasm32-unknown-unknown`, bundle it with `wasm-bindgen-cli` and then serve it on a local webserver to be playable in your browser.
All necessary tools will be installed for you if needed.
### Building your game
Run the following command:
```cli
cargo bavy build
```
This works similar to `cargo build`, but automatically passes the `--features bevy/dynamic` flag to get faster compile times.
It also provides a `--wasm`/`-w` flag, which allows you to create a bundle for the web.
It will automatically compile your game for `wasm32-unknown-unknown` and bundle it with `wasm-bindgen-cli`.
All necessary tools will be installed for you if needed.
### Check your code
Run the following command:
```cli
cargo bavy check
```
This works similar to `cargo check`, but automatically passes the `--features bevy/dynamic` flag to get faster compile times.
It also provides a `--wasm`/`-w` flag, which allows you to check for the WASM target.
### Notes for usage with Rust Analyzer
If you are using `cargo bavy` with Rust Analyzer, you should configure it to use the `--features bevy/dynamic` flag in your project.
Otherwise, its checks might interfere with your `cargo bavy run` usage, leading to many non-incremental re-compiles.
Create a `.vscode/settings.json` file in your project with the following content:
```json
{
"rust-analyzer.cargo.features": ["bevy/dynamic"]
}
```
This way, Rust Analyzer uses the same features as you.
## License
The source code of this repository is dual-licensed under either:
- MIT License ([LICENSE-MIT](LICENSE-MIT) or )
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or )
at your option.
## Your contributions
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.