pub struct CustomCommand {
pub name: String,
pub template: String,
pub source: String,
pub description: String,
pub model: Option<String>,
pub agent: Option<String>,
pub subtask: bool,
}Expand description
A custom command loaded from a text file.
Fields§
§name: StringCommand name (derived from filename).
template: StringTemplate text with placeholder variables (frontmatter stripped).
source: StringSource identifier (e.g. “project:review.md”).
description: StringHuman-readable description (from frontmatter or first # line).
model: Option<String>Optional model override for this command.
agent: Option<String>Optional agent override for this command.
subtask: boolWhether this command should run as a subtask (restricted permissions).
Implementations§
Source§impl CustomCommand
impl CustomCommand
Sourcepub fn expand(
&self,
arguments: &str,
context: Option<&HashMap<String, String>>,
) -> String
pub fn expand( &self, arguments: &str, context: Option<&HashMap<String, String>>, ) -> String
Expand the template with the given arguments and optional context.
- Executes
!cmd`` shell substitutions. - Replaces
$ARGUMENTSwith the full argument string. - Replaces
$1,$2, etc. with positional args (whitespace-split). - Cleans up unreplaced
$Npositional patterns. - Replaces context variables:
$KEY→ value.
Trait Implementations§
Source§impl Clone for CustomCommand
impl Clone for CustomCommand
Source§fn clone(&self) -> CustomCommand
fn clone(&self) -> CustomCommand
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CustomCommand
impl RefUnwindSafe for CustomCommand
impl Send for CustomCommand
impl Sync for CustomCommand
impl Unpin for CustomCommand
impl UnsafeUnpin for CustomCommand
impl UnwindSafe for CustomCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more