8 unstable releases (3 breaking)

0.4.2 Jan 10, 2019
0.4.1 Dec 13, 2018
0.3.0 Oct 25, 2018
0.2.2 Oct 21, 2018
0.1.0 Oct 3, 2018

#102 in #chat

Download history 46/week @ 2024-03-16 42/week @ 2024-03-23 75/week @ 2024-03-30 35/week @ 2024-04-06 41/week @ 2024-04-13 21/week @ 2024-04-20 13/week @ 2024-04-27 20/week @ 2024-05-04 23/week @ 2024-05-11 24/week @ 2024-05-18 19/week @ 2024-05-25 22/week @ 2024-06-01 27/week @ 2024-06-08 13/week @ 2024-06-15 5/week @ 2024-06-22 1/week @ 2024-06-29

51 downloads per month

MIT license

30KB
738 lines

workspace build status crates.io

ws is a CLI to manage and interpret small YAML files that specify tasks to open a project like opening an editor, launching a server or visiting a chat or documentation in the browser. It can be used to efficiently switch between work and side projects.

Installation

cargo install workspace

Then setup the ws command in your shell:

  • bash: Add this line to your .bashrc

    eval $(workspace shell bash)
    
  • fish: Add this line to your config.fish

    workspace shell fish | source -
    
  • PowerShell: Add this line to your profile.ps1

    Invoke-Expression "$(workspace shell posh)"
    

workspace shell prints a shell function ws that delegates output from workspace but intercepts commands to run. This lets you change the directory and run commands directly in the shell, e.g. if they need user input.

Documentation

For the CLI, see:

ws --help

Workspaces can have the following fields:

  • path, list of strings

    path to the workspace

  • tabs, list of strings

    tabs to open in $BROWSER

  • commands, table

    • local, list of strings

      commands to execute in the current shell

    • background, list of strings

      commands to execute as background processes

    • external, list of strings

      commands to execute in a new $TERMINAL

Note: path is mandatory and created automatically by ws new

For example, this is the workspace I use for my blog:

path: /home/matthias/code/web/blog/

commands:
  local:
  - git status
  - sudo systemctl start nginx
  background:
  - code -r .
  external:
  - gulp

tabs:
- https://developer.mozilla.org/en-US/
- localhost

It will cd into ~/code/web/blog/, print the git status, open the directory in visual studio code, start the gulp build in a new terminal, launch nginx to serve the files and open localhost and MDN in the browser.

Dependencies

~3–12MB
~113K SLoC