{"id":16373395,"url":"https://github.com/antham/wo","last_synced_at":"2025-03-23T03:32:34.459Z","repository":{"id":221895986,"uuid":"755706152","full_name":"antham/wo","owner":"antham","description":"Worskpace manager for the shell","archived":false,"fork":false,"pushed_at":"2025-03-18T06:44:44.000Z","size":215,"stargazers_count":12,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-18T17:06:38.272Z","etag":null,"topics":["shell","workspace-management"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antham.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-10T21:10:30.000Z","updated_at":"2025-03-18T06:44:46.000Z","dependencies_parsed_at":"2024-02-10T22:26:28.974Z","dependency_job_id":"58850401-4f16-4c6f-9f4e-c12dfb1694c6","html_url":"https://github.com/antham/wo","commit_stats":null,"previous_names":["antham/wo"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antham%2Fwo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antham%2Fwo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antham%2Fwo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antham%2Fwo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antham","download_url":"https://codeload.github.com/antham/wo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245052619,"owners_count":20553161,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["shell","workspace-management"],"created_at":"2024-10-11T03:14:12.300Z","updated_at":"2025-03-23T03:32:33.996Z","avatar_url":"https://github.com/antham.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [![Go Report Card](https://goreportcard.com/badge/github.com/antham/wo)](https://goreportcard.com/report/github.com/antham/wo) [![codecov](https://codecov.io/gh/antham/wo/graph/badge.svg?token=l5zT9434GU)](https://codecov.io/gh/antham/wo) [![GitHub tag](https://img.shields.io/github/tag/antham/wo.svg)]()\n\nWo is a shell workspace manager inspired by the great https://github.com/jamesob/desk project:\n* create a workspace for each of your project\n* define environments (e.g., staging, production) for each workspace if needed or use the default one\n* define shell functions callable from anywhere, using a specific environment if needed\n* supports `bash`,`fish` and `zsh`\n\n### Demonstration\n\nWe take as an example a workspace created for a cli project that output the environment variable `SECRET`.\n\n[![asciicast](https://asciinema.org/a/yGEwo4mv3bNcmTM3YC0oD4kfN.svg)](https://asciinema.org/a/yGEwo4mv3bNcmTM3YC0oD4kfN)\n\n## Install\n\n### With Go\n\nIf you have `go` installed you can run:\n\n``` sh\ngo install github.com/antham/wo@latest\n```\n\n### With Archlinux\n\nYou will find it on aur, run with `yay`:\n\n``` sh\nyay -S wo-bin\n```\n\n### With Homebrew\n\nRun:\n\n``` sh\nbrew tap antham/homebrew-wo\nbrew install wo\n```\n\n### With the install script\n\nTo install the binary in `/usr/local/bin`, run:\n\n``` sh\ncurl -sSf https://raw.githubusercontent.com/antham/wo/main/installer.sh | sudo sh\n```\n\nTo select another path, run:\n\n``` sh\ncurl -sSf https://raw.githubusercontent.com/antham/wo/main/installer.sh | sh -s -- -o \"\u003cinstall_path\u003e\"\n```\n\n### Other systems\n\nYou can find `deb`, `rpm` and `apk` packages on the release page : https://github.com/antham/wo/releases\n\n### Binaries\n\nYou can find binaries for `linux` and `darwin` for `arm64` and `amd64` on the release page: https://github.com/antham/wo/releases\n\n## Setup\n\nYou need to have several environment variable defined:\n\n| Environment variable | Description                               |\n|----------------------|-------------------------------------------|\n| SHELL                | the location of the current shell program |\n| VISUAL/EDITOR        | the editor to use to edit functions files |\n\nIt is advised to create a one letter alias for the run function, as your are going to use it a lot, like so:\n``` sh\nalias r=\"wo run\"\n```\n\nAdd the following command to your shell init file according to your shell.\n\nYou can customize how the aliases are generated (see below in usage what is the goal of those aliases), the default is to prefix them with `c_`, you can change this behaviour with the `-p` flag on the setup command.\n\nYou can set the theme with the `-t` flag, it could be either `dark` or `light`, the default is the `light` theme.\n\n### Bash\n\n`source \u003c(wo setup bash)`\n\n### Fish\n\n`wo setup fish | source`\n\n### Zsh\n\n`source \u003c(wo setup zsh)`\n\n## Usage\n\n### Creating a workspace\n\nTo create a workspace for your project, use the `create` command, run:\n``` sh\nwo create cli $PWD/projects/cli\n```\n\nOnce your workspace is created, an alias is created to jump into the project folder, you need to reload your shell to \"activate\" it, open a new terminal or in the existing run:\n\n``` sh\nexec \u003cname_of_your_shell\u003e\n```\n\nThe alias in our case will be `c_cli`, so the `c_` prefix (you can configure that) followed by the name of your workspace.\n\n\n### Adding functions to a workspace\n\nTo add some functions, run:\n\n``` sh\nwo edit cli\n```\n\nA file will be opened with your default editor, the function you add must fit with the shell you are currently using, if you add one comment line right before the function name it will be taken and used as the description of the function or if the shell is `fish` the description added with the `-d` will be used.\n\nHere are examples of how to define a function for every shell:\n\n#### Bash\n``` bash\n# Run a curl request\nrun_curl() {\n  curl $1\n}\n```\n\n#### Zsh\n\n``` zsh\n# Run a curl request\nrun_curl() {\n  curl $1\n}\n```\n\n#### Fish\n\n``` fish\nfunction run_curl -d \"Run a curl request\"\n  curl $argv[1]\nend\n```\n\n### Running a function\n\nTo run a function into a workspace, call the `run` command:\n\n``` sh\nwo run cli run_curl http://google.fr\n```\n\nThe first parameter is the workspace to use, the second parameter, the function defined in the workspace, all following parameters are additional parameters you can access in your function with the usual way of accessing function parameters according to your shell.\n\n\nA function is ran from the folder of your project, so you don't need to do anything to access a command relative to your project, let's say a `npm run` for instance.\n\n### Running a function in an environment\n\nAll functions are ran in a `default` environment if you specified nothing, you can edit this environment with:\n\n``` sh\nwo env edit cli default\n```\n\nIt will open an editor to let you add your environment variables or things you want to run with each functions.\n\nIf you want to create additional environment, run:\n\n``` sh\nwo env create cli prod\n```\n\nYou can edit the environment with the previous `edit` command.\n\nTo use it, you simply provide it to the function to run like so:\n\n``` sh\nwo run -e prod cli run_curl http://google.fr\n```\n\nYou get special environment variables that are defined for every functions:\n\n| Environment variable | Usage                            |\n|----------------------|----------------------------------|\n| WO_ENV               | the name of the environment used |\n| WO_NAME              | the name of the workspace used   |\n\n### Changing the path of an existing workspace\n\nRun:\n\n``` sh\nwo config set cli $PWD/project/cli2\n```\n\n### Committing the workspaces\n\nYou can commit and push the folder containing all workspaces on a repository, it is located at:\n\n``` sh\nwo global get config-dir\n```\n\nA default `.gitignore` is provided to exclude all environment variables. At the moment the process of committing and pushing the workspaces is manual. \n\nWhen you restore a backup from git run `wo fix` to restore the default environment as the folder containing all the environments are not committed.\n\n### To go further\n\nCheck the help of the command line\n\n``` sh\nwo help\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantham%2Fwo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantham%2Fwo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantham%2Fwo/lists"}