Awesome Open Source
Awesome Open Source

Workspaces CLI

Publish to npm

A small command-line tool to easily list all your different VS Code Workspaces.

ws searches for all .code-workspace files in a user-specified root directory.
By default, ws searches only 1 level deep to prevent traversing folders like node-modules, vendor, etc.



npm i -g @woudsma/workspaces-cli


  • Node.js version >= 8
  • Make sure you have installed the code command in your $PATH - How to


Create a workspace

Create a workspace by opening a project in VS Code, optionally add more projects to your current workspace.
Save the workspace with:

File -> Save Workspace As...

Run ws

I've made a _workspaces folder in my personal projects folder, where I keep workspaces that include multiple projects. Other workspaces are usually stored in their own project folder. ws searches 1 level deep.
More info on Multi-root workspaces.

$ ws
Workspaces root directory: /Users/woudsma/Projects
? Select workspace …
❯ _workspaces/hasura-test

The workspace for this project is saved at /Users/woudsma/Projects/workspaces-cli/workspaces-cli.code-workspace for example.


$ ws [-h|--help]

ws is an alias of workspaces.

First time configuration

ws reads your workspaces root directory from ~/.workspacesrc.
If no configuration can be found, ws will try to create a ~/.workspacesrc file with the workspaces root directory that you've provided.

$ ws
No configuration found in /Users/woudsma/.workspacesrc
Creating /Users/woudsma/.workspacesrc
? Enter workspaces root directory, e.g. ~/Projects › ~/


Multiple root directories can be specified by adding them to WORKSPACES_ROOT_DIR in ~/.workspacesrc, seperated by comma.

# in ~/.workspacesrc

Turn off the subshell when selecting a workspace.

# USE_SUBSHELL=true (default)
echo USE_SUBSHELL=false >> ~/.workspacesrc

The default search depth can be changed by adding READDIR_DEPTH=<depth> to ~/.workspacesrc.

# READDIR_DEPTH=1 (default)
echo READDIR_DEPTH=2 >> ~/.workspacesrc

Pull requests are welcome!



Alternative Project Comparisons
Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Javascript (1,071,815
Cli (131,489
Search (31,536
Code (18,182
Vscode (10,106
Command Line Tool (8,466
Root (8,291
Studio (119