| Crates.io | cargo-new-workspace |
| lib.rs | cargo-new-workspace |
| version | 1.0.1 |
| created_at | 2025-12-21 20:32:38.785734+00 |
| updated_at | 2025-12-21 21:12:10.779343+00 |
| description | A tiny binary that creates a minimal Cargo.toml file that a workspace requires |
| homepage | |
| repository | https://github.com/AskSkivdal/cargo-new-workspace |
| max_upload_size | |
| id | 1998554 |
| size | 2,669 |
This is a tiny cargo command to create a workspace in the current directory.
This program is really simple it just creates a minimal Cargo.toml in the current directory. The file will contain
[workspace]
resolver = "3"
Thats it, its literaly nothing more than
use std::{fs, path::PathBuf, process::exit};
fn main() {
let cargo_file = PathBuf::from("./Cargo.toml");
if cargo_file.exists() {
eprintln!("This directory already has a Cargo.toml file");
exit(1);
}
fs::write(cargo_file, b"[workspace]\nresolver = \"3\"").unwrap();
}
cargo install cargo-new-workspace
Since the program does not create a directory you will have to do that before you run
cargo new-workspace
mkdir my-workspace
cd my-workspace
cargo new-workspace