Learn R Programming

btw (version 1.0.0)

btw_tool_git_branch_list: Tool: Git Branch List

Description

This tool allows an LLM to list git branches in the repository using gert::git_branch_list(), equivalent to git branch in the terminal.

Usage

btw_tool_git_branch_list(include = c("local", "remote", "all"), `_intent` = "")

Value

Returns a character table of branches.

Arguments

include

Once of "local" (default), "remote", or "all" to filter branches to local branches only, remote branches only, or all branches.

_intent

An optional string describing the intent of the tool use. When the tool is used by an LLM, the model will use this argument to explain why it called the tool.

See Also

Other git tools: btw_tool_git_branch_checkout(), btw_tool_git_branch_create(), btw_tool_git_commit(), btw_tool_git_diff(), btw_tool_git_log(), btw_tool_git_status()

Examples

Run this code
withr::with_tempdir({
  gert::git_init()
  gert::git_config_set("user.name", "R Example")
  gert::git_config_set("user.email", "ex@example.com")

  fs::file_touch("hello.md")
  gert::git_add("hello.md")
  gert::git_commit("Initial commit")

  gert::git_branch_create("feature-1")
  gert::git_branch_create("feature-2")

  # What the LLM sees
  cat(btw_tool_git_branch_list()@value)
})

Run the code above in your browser using DataLab