CLI to create templated workspaces using user-configured JSON files
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore 🆕 Jan 23, 2019
Cargo.lock
Cargo.toml
LICENSE 🆕 Jan 23, 2019
README.md

README.md

wksp

Usage

Create the configuration directory for wksp to look for template files in:

# Windows -> C:\Users\{USER}\.wksp
# Linux -> /home/{USER}/.wksp
# MacOS -> ~/.wksp OR /Users/{USER}/.wksp

Inside of the wksp configuration directory, each template is a JSON file using the following schema:

{
  "folders": [
    {
      "name": "myfolder",
      "template": {
        "folders": ["..."],
        "files": ["..."]
      }
    }
  ],
  "files": ["file1.rs", "file2.js", "file3.go"]
}

folder and files fields do not need to be defined if they will be empty

Example

Running the command:

wksp --name new_workspace --template example

Will look for a template file $HOME/.wksp/example.json and build the template in the current directory named whatever you passed to the -n/--name argument.

Given a template defined as:

# javascript_git.json
{
  "folders": [
    {
      "name": "src",
      "template": {
        "folders": [{ "name": "lib" }],
        "files": ["index.js"]
      }
    },
    {
      "name": "tests",
      "template": {
        "files": ["index.test.js"]
      }
    }
  ],
  "files": [".gitignore", "README.md", "LICENSE"]
}

Running the command wksp -n js-project -t javascript_git will produce the following file tree:

js-project
├── .gitignore
├── LICENSE
├── README.md
├── src
│   ├── index.js
│   └── lib
└── tests
    └── index.test.js

3 directories, 5 files