Help us shape the future of Go! Take the 2026 Go Developer Survey

devtools

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package devtools gives a coding agent a shell and file tools over one workspace directory: shell, read_file, write_file, edit_file, list_dir and grep. Register them with [Register].

Paths are confined to the workspace root so the model gets a clear error for a path outside it. This is not a security boundary (a shell command can go anywhere the process can); run the agent in a sandbox for that.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// Shell runs commands as Shell + "-c" + command (default: bash if present, else sh).
	Shell string
	// DefaultTimeout is a command's timeout when the model sets none (default 10m).
	DefaultTimeout time.Duration
	// MaxTimeout caps the timeout the model may ask for (default 1h).
	MaxTimeout time.Duration
	// MaxOutputBytes caps a tool result; longer output keeps its head and tail
	// (default 16 KiB).
	MaxOutputBytes int
	// Env is extra environment for commands, as KEY=VALUE.
	Env []string
}

Options tunes the tools. Zero values pick the defaults.

type Tools

type Tools struct {
	// contains filtered or unexported fields
}

Tools are the devtools bound to a workspace root.

func New

func New(root string, opts Options) (*Tools, error)

New returns the tools for the workspace at root.

func (*Tools) Register

func (t *Tools) Register(a *agent.Agent)

Register adds the tools to a.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL