permission_callback

command
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Demonstrates WithCanUseTool: a stdin-based permission prompt that asks the operator to approve each tool call interactively. opencode only emits session/request_permission when its permission rule evaluates to "ask" — the default build agent allows everything, so this example uses a user configuration snippet to trigger prompts.

Triggering real permission prompts from an out-of-the-box opencode install requires setting `"permission": {"edit": "ask"}` in ~/.config/opencode/config.json; without that no permissions fire.

go run ./examples/permission_callback

Jump to

Keyboard shortcuts

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