Behaviour every Cherry command implements.
A command is pure input → result: it receives a Cherry.CLI.Context and
returns {:ok, data} or {:error, %Cherry.CLI.Error{}}. Rendering (human
text vs --json envelope) belongs to Cherry.CLI, so commands stay
testable without capturing IO.
Summary
Callbacks
The command's full doc text — the single source reused as the mix task's
@moduledoc and rendered by cherry help <verb> and cherry <verb> --help.
The first line doubles as the one-line summary on the base help screen.
Renders the success data as the human-facing output line(s).
Executes the command.
Command-specific OptionParser switches, merged with the global ones.
Callbacks
@callback doc() :: String.t()
The command's full doc text — the single source reused as the mix task's
@moduledoc and rendered by cherry help <verb> and cherry <verb> --help.
The first line doubles as the one-line summary on the base help screen.
Renders the success data as the human-facing output line(s).
@callback run(Cherry.CLI.Context.t()) :: {:ok, map()} | {:error, Cherry.CLI.Error.t()}
Executes the command.
@callback switches() :: keyword()
Command-specific OptionParser switches, merged with the global ones.