# LibTmux::Workspace

**Workspace Manager concept example** A working example of the core library. It can change without notice.

- **Module:** LibTmux
- **Package:** LibTmux-Workspace
- **Language:** Perl
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-perl/blob/352715a4fa66a96eed7763b90daaa536aa2f121d/packages/workspace/lib/LibTmux/Workspace.pm#L1
- **Page:** https://libtmux.org/en/perl/latest/workspace/reference/libtmux-workspace/

```
package LibTmux::Workspace;
```

Versioned JSON configuration and owned orchestration


## SYNOPSIS


```perl
    use LibTmux::Workspace;
    my $workspace = LibTmux::Workspace->from_json($json_octets);
    my $plan = $workspace->plan(existing => 'error');
    my $report = $workspace->load(server => $server);
```


## COMMAND LINE

The packaged `libtmux-workspace` executable exposes `validate`, `plan`, and `load`. `--dry-run` selects planning without tmux I/O. See the installed executable's help for socket and repeat-application options.



## Members

### Common operations

- [`load`](/en/perl/latest/workspace/reference/libtmux-workspace-load/) (method): `load(server => $server, existing => 'error'|'skip')` uses public [`LibTmux::Server`](/en/perl/latest/reference/libtmux-server/) operations. It checks all session-name conflicts before creation. `error` rejects any existing target with [`Conflict`](/en/perl/latest/workspace/reference/libtmux-workspace-x-conflict/); `skip` leaves that entire session alone, so repeated application creates only absent sessions. A missing server permits explicit creation; other acquisition failures propagate.
- [`new`](/en/perl/latest/workspace/reference/libtmux-workspace-new/) (method): `new(config => $hashref)` validates and copies a `libtmux.workspace/v1` configuration. No I/O occurs. Sessions contain named windows with nonempty pane arrays. Each pane requires literal `command` arguments or an explicit `shell_command`. Environment values inherit from workspace, session, and window, with pane values taking precedence. All configuration errors throw [`Config`](/en/perl/latest/workspace/reference/libtmux-workspace-x-config/).

### Other members

- [`from_json`](/en/perl/latest/workspace/reference/libtmux-workspace-from_json/) (method): Decode bounded UTF-8 JSON octets with core [JSON::PP](https://perldoc.perl.org/5.44.0/JSON::PP) and call [`"new"`](/en/perl/latest/workspace/reference/libtmux-workspace-new/). Reject unsupported versions, unknown keys, invalid commands, and duplicate names. YAML is not part of this distribution.
- [`plan`](/en/perl/latest/workspace/reference/libtmux-workspace-plan/) (method): `plan(existing => 'error'|'skip')` returns a fresh data plan in input order. It performs no tmux I/O or mutations. A dry-run does not prove live availability or command success. Exports share no mutable arrays with the loader. No context-dependent return values are used.
