DEV Community

Tom
Tom

Posted on • Edited on

2 1

Quickly switch projects

As I work on different projects at the same time, I want to be able to switch quickly between them. So if I need to work on Project-x I just run in the terminal:

projectx
Enter fullscreen mode Exit fullscreen mode

VS Code is opened at the right project, the web server starts and opens a browser on the correct URL.

This is easily done by adding an alias projectx to your .bashrc or .zshrc with the following contents:

alias projectx="cd /Users/tom/projects/project-x && code . && npm run dev"
Enter fullscreen mode Exit fullscreen mode

Bonus:

How to get the right path? Run pwd | pbcopy in the root dir of your project.

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more