Foo-x/jw

A CLI to manage jj workspaces.

★ 0Forks 0TypeScriptGitHub ↗Compare

README

jw - jujutsu workspace management CLI

A CLI tool for easily managing jujutsu workspaces.

Requirements

Installation

bun i -g github:foo-x/jw

This makes the jw command available globally.

Usage

Initialize configuration

jw init

Creates .jwconfig in the repository root.

Create a new workspace

jw new <name> [-r <revision>]
  • Any / in the name is automatically converted to -
  • The workspace is created in <parent of default>/<repo><suffix>/<name> (suffix defaults to __ws)
  • Files specified in .jwconfig are copied
  • Commands specified in .jwconfig are executed

List workspaces

jw list

Output workspace path

jw go [name]

Can be used with shell's cd command:

cd $(jw go <name>)

Remove a workspace

jw rm <name>
  • Runs jj workspace forget
  • Deletes the workspace directory

Rename a workspace

jw rename <old> <new>

Copy files to a workspace

jw copy <name>

Copies files specified in .jwconfig from the default workspace to the specified workspace.

Remove non-existent workspaces from config

jw clean

Switch default workspace to current revision

jw this

Switches the default workspace to the current workspace's revision. This is useful when you want to synchronize the default workspace with your work in another workspace.

  • Must be run from a non-default workspace

Use revision from a workspace

jw use <name>

Switches the default workspace to the specified workspace's revision. This is useful when you want to switch to another workspace's revision from the default workspace.

  • Must be run from the default workspace

Show version

jw version

Shell completion (bash)

source <(jw completion bash)

Configuration File (.jwconfig)

Create a .jwconfig file in the project root:

{
  "copyFiles": [],
  "postCreateCommands": [],
  "workspacesDirSuffix": "__ws"
}
  • copyFiles: Files/directories to copy when creating a workspace
  • postCreateCommands: Commands to run after creating a workspace
  • workspacesDirSuffix: Suffix for the workspaces parent directory (optional)

Development

bun install
bun link
jw <command>

License

MIT

Contributors

Foo-x

Issues