Skip to content
/ wksp Public

CLI to create templated workspaces using user-configured JSON files

License

Notifications You must be signed in to change notification settings

callensm/wksp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

CLI to create templated workspaces using user-configured JSON files

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages