# `PhoenixKitAgent.Attachments.Cmd`
[🔗](https://github.com/BeamLabEU/phoenix_kit_agent/blob/v0.1.0/lib/phoenix_kit_agent/attachments/cmd.ex#L1)

Runs the external programs of attachment processing (`pdfinfo`, `pdftotext`,
`pdftoppm` — poppler) with a time limit, and says plainly when one is not
installed. What a program prints is never returned or logged on failure: it
can quote the file.

# `failure`

```elixir
@type failure() :: :tool_missing | :timeout | :failed
```

Why a program did not give its result.

# `available?`

```elixir
@spec available?(String.t()) :: boolean()
```

Whether the program is installed.

# `run`

```elixir
@spec run(String.t(), [String.t()]) :: {:ok, String.t()} | {:error, failure()}
```

Runs `tool` with `args`. `{:ok, output}` (stdout and stderr) when it exits
with 0.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
