Capability
File system
Six operations against a sandbox's filesystem: write, read, edit, list, find-by-name, and find-by-content. Every path is relative to the sandbox's own root — there's no notion of a path outside it.
Create, view, edit
files.py
sb.file_create("notes.txt", "hello from boxkite\n")
sb.view("notes.txt") # {"content": "..."}
sb.view("src/", ) # directory -> {"is_directory": True, "entries": [...]}
sb.view("notes.txt", view_range=[1, 10]) # 1-indexed [start, end] line range
sb.str_replace("notes.txt", old_str="hello", new_str="hi")Content, old_str, and new_str are each capped at 10MB. str_replace requires the target string to appear exactly once unless you pass replace_all.
Search: ls, glob, grep
Three read-only operations for exploring a sandbox without a shell round trip: ls lists a directory's direct children, glob finds files by name pattern, grep searches file contents by regex (capped at 5000 matches server-side, 500 by default).
search.py
sb.ls("src/")
sb.glob("**/*.py")
sb.grep(r"def create_\w+_tool", path="src/boxkite/tools")