Yeesh.MixCommand
(Yeesh v0.8.3)
View Source
Generates a Yeesh.Command module that wraps a specific Mix task.
Use this macro when you want to expose a Mix task as a named
Yeesh terminal command, without requiring the user to type mix
as a prefix.
Usage
defmodule MyApp.YeeshCommands.Chat do
use Yeesh.MixCommand,
task: "ragex.chat",
name: "chat",
description: "Interactive codebase Q&A",
default_args: ["--skip-analysis"]
endThen register it on the terminal component:
<.live_component
module={Yeesh.Live.TerminalComponent}
id="terminal"
commands={[MyApp.YeeshCommands.Chat]}
/>Options
:task(required) -- the Mix task name (e.g."ragex.chat"):name(required) -- the command name in the Yeesh terminal:description-- short description forhelpoutput (default:"Run mix <task>"):usage-- usage string (default: auto-generated from name and task):default_args-- default arguments prepended to user args (default:[])
The generated module delegates to Yeesh.MixRunner.run/3 with
the configured task name. User arguments are appended after
:default_args. Interactive and non-interactive tasks are handled
automatically.
This module is only compiled when Mix is available.