Documentation
¶
Overview ¶
Package toolkit turns an operation registry into a complete tool binary: the generated CLI plus the built-in serve, mcp and metadata commands.
func main() {
reg := op.New("notes", version)
ops.Register(reg, backend)
toolkit.Main(reg, toolkit.Options{Description: "Notes."})
}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CLIOptions ¶
CLIOptions is the cli configuration Main uses: the tool's own options plus the built-in serve, mcp and metadata commands.
func Handler ¶
Handler is the HTTP handler serve mounts on its socket: the api routes plus MCP at /mcp.
func ListenUnix ¶
ListenUnix listens on a Unix socket at path with mode 0600, so only the owning user (and a proxy running as that user) can connect. A stale socket left by a crashed server is replaced; a live one is an error. The socket is bound under a private temporary name and renamed into place, so it is never reachable with a wider mode.
Types ¶
type Options ¶
type Options struct {
// Description is the root help text.
Description string
// Globals is an optional pointer to a struct of root flags; see
// cli.Options.Globals.
Globals any
// Commands are hand-written commands mounted next to the operations.
Commands []cli.Command
// Authorizer decides whether a remote caller of serve (HTTP and HTTP MCP)
// may run an operation. Nil means op.DenyWrites.
Authorizer op.Authorizer
}
Options configures a tool binary.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package api serves an operation registry over HTTP:
|
Package api serves an operation registry over HTTP: |
|
Package cli generates a kong command line from an operation registry.
|
Package cli generates a kong command line from an operation registry. |
|
examples
|
|
|
sample
command
Command sample is a tiny fake tool built on toolkit.
|
Command sample is a tiny fake tool built on toolkit. |
|
Package mcp exposes the operations of a registry that set MCP: true as MCP tools, over stdio or streamable HTTP.
|
Package mcp exposes the operations of a registry that set MCP: true as MCP tools, over stdio or streamable HTTP. |
|
Package op is the operation registry.
|
Package op is the operation registry. |
|
Package toolkittest is the conformance kit a tool runs from its own tests:
|
Package toolkittest is the conformance kit a tool runs from its own tests: |