Deletes an agent file from an agents directory and removes it from the lock file.
Arguments
- name
The name of the agent to remove (without the
.mdextension).- path
The agents directory. Can be one of:
A known coding agent name such as
'claude_code','cursor', or'github_copilot'(seeagent_path()for the full list) to use that agent's conventional project-scope path.A character string giving the directory path directly.
NULL(the default), in which case the path is resolved from theWF_AGENTenvironment variable, or by prompting in interactive sessions. SetWF_AGENTin your.Renviron(e.g. withusethis::edit_r_environ()) to avoid the prompt.
- force
If
FALSE(the default), prompts for confirmation in interactive sessions. Set toTRUEto skip the prompt.
Examples
src <- tempfile(fileext = '.md')
writeLines(
c('---', 'name: example', 'description: An example agent.', '---'),
src
)
tmp <- tempfile()
add_agent(src, path = tmp)
#> Installed agent "example" to /tmp/Rtmp1p0v0x/file1be52d0549e6/example.md.
remove_agent('example', tmp, force = TRUE)
#> Removed agent "example" from /tmp/Rtmp1p0v0x/file1be52d0549e6.
