Bridging the Gap: The Philosophy and Power of “cd create” Workflows
If you spend any time inside a command-line interface (CLI), your fingers instinctively know certain rhythms. You type ls to look around, cd to move through directories, and mkdir when it is time to build something new.
For decades, the standard workflow for starting a new project folder has been a two-step routine:
mkdir my-awesome-project(Create the directory)cd my-awesome-project(Navigate into it)
While this habit is deeply ingrained in developers, system administrators, and power users worldwide, the concept of a unified “cd create” workflow—or streamlining the creation and immediate transition into a workspace—represents a continuous effort to optimize developer ergonomics.
Why the Two-Step Dance Can Be Friction
At first glance, typing mkdir project && cd project isn’t overly burdensome. It takes a second or two. However, in modern software engineering where context-switching is frequent, micro-frictions accumulate:
- Repetition: Typing the project name twice (once to make it, once to enter it) opens the door for typos between commands.
- Flow State Interruption: Every extra keystroke adds up when you are spinning up temporary test directories, debugging scripts, or bootstrapping microservices.
- Scripting Redundancy: Automation scripts and shell functions constantly have to account for error handling if the directory creation fails before attempting to change directories.
Implementing Your Own “Cd Create” Shortcut
Because standard POSIX shells (bash, zsh) treat cd and mkdir as separate utilities, there is no native single command literally called cd create built into baseline Unix. Instead, developers often solve this by creating custom shell functions or aliases in their .bashrc or .zshrc files.
Here is a popular, lightweight implementation you can add to your shell configuration:
# A simple 'mkcd' or 'cd-create' function
mkcd() {
mkdir -p "$1" && cd "$1"
}
By adding this function, typing mkcd my-new-folder instantly creates the parent directories safely (thanks to -p) and drops you right into the workspace. It eliminates the repetition and mimics the exact fluid intent of a “cd create” command.
Modern CLI Tools Redefining Project Initialization
Beyond simple shell functions, the philosophy of “creating and entering” has evolved significantly within modern CLI scaffolding tools. When you use tools like npm init, cargo new, git clone, or modern framework CLI generators, they often handle directory creation and navigation context under the hood, or they expect you to be safely nested inside your target folder immediately.
| Tool / Ecosystem | Traditional Approach | Streamlined Approach |
| :— | :— | :— |
| Node.js | mkdir app && cd app && npm init | npx create-vite app (Handles creation/scaffolding) |
| Rust | mkdir app && cd app && cargo init | cargo new app (Auto-generates and scaffolds) |
| Custom Shell | mkdir project && cd project | mkcd project |
Conclusion
The evolution of command-line tools proves that even the smallest optimizations matter. Whether you rely on a quick shell function, a modern project scaffold, or traditional muscle memory, streamlining how we instantiate and move into workspaces keeps us focused on writing code rather than fighting terminal mechanics.
Leave a Reply