fs_intercept

command
v0.0.3 Latest Latest
Warning

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

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

Documentation

Overview

Demonstrates WithOnFsWrite: intercept opencode's fs/write_text_file delegations and redirect them into an in-memory map rather than the real filesystem. Useful for sandboxed evaluation or auditing.

opencode only emits fs/write_text_file after an approved "ask" edit. For this example to fire the callback you need `"permission": {"edit": "ask"}` in ~/.config/opencode/config.json and a WithCanUseTool handler that approves.

go run ./examples/fs_intercept

Jump to

Keyboard shortcuts

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