# jdx ws

IDE equivalent: Project and library configuration

Manage named workspaces: ordered jar roots reused across queries (create, list, info, remove, use, add). Read commands consume them via -w <name>, JDX_WORKSPACE, or jdx ws use.

## Usage

```text
jdx ws [<options>] <command> [<args>]...
```

## Subcommands

### `jdx ws create`

Create a named workspace: an ordered list of binary roots reused via -w <name>. Refuses when the name exists (see ws add, ws remove). Exits 1 when the name exists, 3 on bad usage, 6 on IO failure.

```text
jdx ws create [<options>] <name>
```

| Option | Description |
|---|---|
| `--jars=<text>` | Binary roots: jar files, class directories or globs (repeatable, order kept). |
| `--jdk` | Include the JDK stdlib (the default). |
| `--no-jdk` | Do not include the JDK stdlib. |
| `--src=<text>` | Source dirs: directories of .java/.kt files scanned textually by jdx usages (repeatable, order kept). |
| `--coord=<text>` | Maven coordinate roots group:artifact:version (repeatable). Stored in the workspace and resolved to jars at query time (local caches first; --fetch on read commands allows Maven repository downloads). |
| `--repo=<text>` | Maven repository base URLs for --coord fetches (repeatable). Stored in the workspace and tried in order before Maven Central at query time. Must be http(s) URLs. |
| `--json` | Emit machine-readable JSON instead of human-readable text (same information, D-007). |
| `-h, --help` | Show this message and exit |

| Argument | Description |
|---|---|
| `<name>` | Workspace name (letters, digits, '.', '_' and '-'). |

### `jdx ws list`

List named workspaces (the default from jdx ws use is marked). Exits 6 on IO failure.

```text
jdx ws list [<options>]
```

| Option | Description |
|---|---|
| `--json` | Emit machine-readable JSON instead of human-readable text (same information, D-007). |
| `-h, --help` | Show this message and exit |

### `jdx ws info`

Show a workspace: ordered roots, JDK switch, whether it is the default. Exits 1 when unknown, 4 when its file is corrupt.

```text
jdx ws info [<options>] <name>
```

| Option | Description |
|---|---|
| `--json` | Emit machine-readable JSON instead of human-readable text (same information, D-007). |
| `-h, --help` | Show this message and exit |

| Argument | Description |
|---|---|
| `<name>` | Workspace name to show. |

### `jdx ws remove`

Delete a named workspace (clears the jdx ws use default when it pointed here). Exits 1 when unknown, 6 on IO failure.

```text
jdx ws remove [<options>] <name>
```

| Option | Description |
|---|---|
| `--json` | Emit machine-readable JSON instead of human-readable text (same information, D-007). |
| `-h, --help` | Show this message and exit |

| Argument | Description |
|---|---|
| `<name>` | Workspace name to delete. |

### `jdx ws use`

Set the default workspace read commands use when neither -w nor JDX_WORKSPACE names one (PROPOSAL.md §13). With --clear, unset it. Exits 1 when the workspace is unknown, 3 on bad usage.

```text
jdx ws use [<options>] [<name>]
```

| Option | Description |
|---|---|
| `--clear` | Unset the default workspace. |
| `--json` | Emit machine-readable JSON instead of human-readable text (same information, D-007). |
| `-h, --help` | Show this message and exit |

| Argument | Description |
|---|---|
| `<name>` | Workspace name to make the default. |

### `jdx ws add`

Append one binary root (jar, class dir or glob) to a workspace, keeping order. Exits 1 when the workspace is unknown, 3 on bad usage, 4/6 on store failure.

```text
jdx ws add [<options>] <name> <root>
```

| Option | Description |
|---|---|
| `--json` | Emit machine-readable JSON instead of human-readable text (same information, D-007). |
| `-h, --help` | Show this message and exit |

| Argument | Description |
|---|---|
| `<name>` | Workspace to extend. |
| `<root>` | Binary root to append (jar, class dir or glob). |

## Options

| Option | Description |
|---|---|
| `-h, --help` | Show this message and exit |

## Full help text

```console
$ jdx ws --help
Usage: jdx ws [<options>] <command> [<args>]...

  Manage named workspaces: ordered jar roots reused across queries (create, list, info, remove, use, add). Read commands consume them via -w <name>, JDX_WORKSPACE, or jdx ws use.

Options:
  -h, --help  Show this message and exit

Commands:
  create  Create a named workspace: an ordered list of binary roots reused via -w <name>. Refuses when the name exists (see ws add, ws remove). Exits 1 when the name exists, 3 on bad usage, 6 on IO failure.
  list    List named workspaces (the default from jdx ws use is marked). Exits 6 on IO failure.
  info    Show a workspace: ordered roots, JDK switch, whether it is the default. Exits 1 when unknown, 4 when its file is corrupt.
  remove  Delete a named workspace (clears the jdx ws use default when it pointed here). Exits 1 when unknown, 6 on IO failure.
  use     Set the default workspace read commands use when neither -w nor JDX_WORKSPACE names one (PROPOSAL.md §13). With --clear, unset it. Exits 1 when the workspace is unknown, 3 on bad usage.
  add     Append one binary root (jar, class dir or glob) to a workspace, keeping order. Exits 1 when the workspace is unknown, 3 on bad usage, 4/6 on store failure.
```

## Learn more

Guide: [Classpath & workspaces](https://mohammadmd1383.github.io/jdx/docs/classpath/) · [All commands](https://mohammadmd1383.github.io/jdx/docs/reference/)
