# LibTmux.Server.run/3

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/5bacf40788b43a5af27bb3656e727a921ba2db40/lib/libtmux/server.ex#L528
- **Page:** https://libtmux.org/en/elixir/pr-173/reference/libtmux-server-run-3/

```
run(server, command, options \\ [])
@spec run(t(), LibTmux.Command.t(), [
        LibTmux.Transport.OneShot.option()
      ]) ::
        {:ok, LibTmux.Transport.OneShot.result()}
        | {:error, LibTmux.Error.t()}
```

Runs one trusted command without attaching; returns bounded output and exit evidence.

The options are those of `LibTmux.Transport.OneShot.run/3`, except
`:keep_tmux_context` and `:native_helper`, which belong to the descriptor.
Raises `ArgumentError` for a Server built by hand
whose `socket` or `socket_name` is not `nil` or a string, or that sets both.

See the [worked example](advanced-execution.html).

## Parameters

- `server` (`t()`)
- `command` (`LibTmux.Command.t()`)
- `options` (`[LibTmux.Transport.OneShot.option()]`)
  Default: `[]`.

## Guides

Pages that discuss `run/3`.

- [Attaching to tmux](/en/elixir/pr-173/guides/attaching-to-tmux/)

## In other ports

Run a tmux command this port does not model

| Port | API | Differs from Elixir |
| --- | --- | --- |
| Elixir | `LibTmux.Server.run/3`. Runs one trusted command without attaching; returns bounded output and exit evidence. | This page |
| Python | [`libtmux.Server.cmd`](/en/py/latest/reference/libtmux-server-cmd/) (method). Execute tmux command respective of socket name and file, return output. | None recorded in the model |
| Ruby | [`LibTmux::Server#run`](/en/ruby/latest/reference/libtmux-server-run/) (method). Raw tmux arguments retain tmux's separators and format semantics. | None recorded in the model |
| Lua | [`libtmux.Server:command`](/en/lua/latest/reference/libtmux-server-command/) (method). Binds a snapshot record to a live handle of its class. | None recorded in the model |
| Erlang | [`tmux_server:command/3`](/en/erlang/latest/reference/tmux_server-command-3/) (function). Execute one validated command and await its result. Performs I/O. The result preserves stdout, stderr, exit status and cleanup certainty. Use tmux_operation:start/3 to submit without blocking this caller. A timeout or cancellation cannot reverse effects that may already have reached tmux. Values from domain command builders keep their captured endpoint origin. Another endpoint returns different_owner with submitted = false before any native preflight or execution. Raw commands do not carry that origin. | free function. Executes an explicit command value with bounded output and separate outcome and cleanup evidence. |
| TypeScript | [`server.Server.cmd`](/en/ts/latest/reference/server-server-cmd/) (method). Run a tmux command this package does not model. | None recorded in the model |
| Rust | [`server.Server.cmd`](/en/rs/latest/reference/server-server-cmd/) (method). Execute one raw logical tmux command. | async |
| Go | [`tmux.Server.Cmd`](/en/go/latest/reference/tmux-server-cmd/) (method). Cmd executes raw tmux arguments and returns caller-owned result slices. A completed nonzero exit remains a result; validation and transport failures return errors. Cancellation cannot prove whether a mutation reached tmux. | None recorded in the model |
| Java | [`io.github.libtmux.Server.cmd`](/en/java/latest/reference/io-github-libtmux-server-server-cmd/) (method). Runs one tmux command against this server. | 3 overloads |
| Perl | [`LibTmux::Server::cmd`](/en/perl/latest/reference/libtmux-server-cmd/) (method). cmd(@literal_arguments). | Checked literal argument vector; no shell wrapper or implicit tmux command list. |
| Raku | [`LibTmux::Server.command`](/en/raku/latest/reference/libtmux-server-command/) (method). Execute explicit tmux command syntax in the currently observed daemon. | None recorded in the model |

No Haskell equivalent. No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.

No C# equivalent. no equivalent on `Server`

No C++ equivalent. no equivalent on `Server`

No Swift equivalent. no equivalent on `Server`

No OCaml equivalent. No direct public OCaml equivalent is recorded for this operation.

No equivalent is recorded in PowerShell, Julia, Common Lisp, Clojure, Kotlin, Scala or F#.
