# `Git.Commands.Remote`
[🔗](https://github.com/joshrotenberg/git_wrapper_ex/blob/main/lib/git/commands/remote.ex#L1)

Implements the `Git.Command` behaviour for `git remote`.

Supports listing remotes (with or without verbose URL output), adding a new
remote, and removing an existing remote.

# `t`

```elixir
@type t() :: %Git.Commands.Remote{
  add_name: String.t() | nil,
  add_url: String.t() | nil,
  list: boolean(),
  remove: String.t() | nil,
  verbose: boolean()
}
```

# `args`

```elixir
@spec args(t()) :: [String.t()]
```

Builds the argument list for `git remote`.

- If `add_name` is set (with `add_url`): produces `["remote", "add", name, url]`
- If `remove` is set: produces `["remote", "remove", name]`
- Otherwise (list mode): produces `["remote"]`, plus `"-v"` when `verbose: true`

# `parse_output`

```elixir
@spec parse_output(String.t(), non_neg_integer()) ::
  {:ok, [Git.Remote.t()]}
  | {:ok, :done}
  | {:error, {String.t(), non_neg_integer()}}
```

Parses stdout and exit code from `git remote` into a result.

- List with exit code 0: `{:ok, [%Git.Remote{}]}` (empty list when no remotes)
- Add/remove with exit code 0: `{:ok, :done}`
- Non-zero exit code: `{:error, {stdout, exit_code}}`

---

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