Skip to main content

Agent

Struct Agent 

Source
pub struct Agent { /* private fields */ }
Expand description

A coding agent that reads skills from a known directory.

The built-in agents mirror the directories used by gh skill install.

Implementations§

Source§

impl Agent

Source

pub const GITHUB_COPILOT: Self

GitHub Copilot.

Source

pub const CLAUDE_CODE: Self

Claude Code, which relocates its whole configuration with CLAUDE_CONFIG_DIR.

Source

pub const CURSOR: Self

Cursor.

Source

pub const CODEX: Self

Codex.

Source

pub const GEMINI: Self

Gemini CLI.

Source

pub const ANTIGRAVITY: Self

Antigravity.

Source

pub fn builtins() -> Vec<Self>

Every built-in agent, in the order gh skill install documents them.

The constants above and this list are two places, and the table in tests/agent.rs is what holds them together: it names every agent, its title and its project directory, and asserts the length, so an agent added to one and not the other is a failing test rather than an agent --agent all never reaches.

Source

pub fn new( name: impl Into<String>, title: impl Into<String>, project_dir: impl Into<String>, ) -> Self

An agent this library does not know about.

project_dir is relative to the project root and separated with /. A project install that would land outside the project root is refused whoever wrote the path, so this is not a way around that bound; Installer::with_project_root and --dir are.

Source

pub fn with_user_dir( self, f: impl Fn() -> Result<PathBuf> + Send + Sync + 'static, ) -> Self

Sets where user scope writes. Without one the agent has project scope alone.

Source

pub fn name(&self) -> &str

The --agent value, such as claude-code.

Source

pub fn title(&self) -> &str

The human readable name, such as Claude Code.

Source

pub fn project_dir(&self) -> &str

The skills directory relative to the project root, separated with /.

Source

pub fn dir(&self, scope: Scope, project_root: Option<&Path>) -> Result<PathBuf>

Resolves the skills directory for a scope.

project_root applies to Scope::Project alone, and None means the working directory.

§Errors

Fails when the home directory is not known, or when the agent has no user scope directory.

Trait Implementations§

Source§

impl Clone for Agent

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Agent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&Agent> for AgentSelector

Source§

fn from(a: &Agent) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Agent

§

impl !UnwindSafe for Agent

§

impl Freeze for Agent

§

impl Send for Agent

§

impl Sync for Agent

§

impl Unpin for Agent

§

impl UnsafeUnpin for Agent

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.