Using cargo to create new workspaces


#1

I don’t understand why cargo does not (yet) have a command to create workspaces.

Building a workspace from cargo would give some advantages, such as automatically adding a .gitignore and initializing a git repo.

According to The Book, the only way to create a workspace now is to manuallly create a folder and add a Cargo.toml to indicate that this is a workspace.

My suggestion is to add a --workspace option to the cargo new command, making cargo new --workspace <NAME> the official option to create new workspaces.


#2

Like many things in open source, I imagine that it’s because nobody has proposed it. I think more tooling around workspaces would be good.


#3

It would also be nice to have an option for cargo new to add the new crate in the workspace Cargo.toml. Or even better, do it automatically if you run cargo new in a workspace.