Learn R Programming

btw (version 1.0.0)

btw_tool_git_status: Tool: Git Status

Description

This tool allows the LLM to run gert::git_status(), equivalent to git status in the terminal, and to see the current status of the working directory.

Usage

btw_tool_git_status(
  include = c("both", "staged", "unstaged"),
  pathspec = NULL,
  `_intent` = ""
)

Value

Returns a character table of file statuses.

Arguments

include

One of "both", "staged", or "unstaged". Use "both" to show both staged and unstaged files (default).

pathspec

Optional character vector with paths to match.

_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_branch_list(), btw_tool_git_commit(), btw_tool_git_diff(), btw_tool_git_log()

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")

  writeLines("hello, world", "hello.md")

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

Run the code above in your browser using DataLab