github_* — GitHub

The GitHub tool namespace — fetching, creating/updating, and batch-moving files, code search, and issues. The mechanism that edits this docs site.

The github_* family is how Leif edits repositories — including this docs site. owner and repo default to the configured repo when omitted, and the default branch is main. Because Cloudflare Pages watches main, a write here is a deploy — see Cloudflare Pages Deploys.

Reading

github_get_file

github_get_file(file_path, owner=None, repo=None, ref="main")

ref is a branch, tag, or SHA (default main).

github_search_code

github_search_code(query, owner=None, repo=None, max_results=10)

The way to find a file when you don’t know its path.

Writing

github_create_or_update_file

github_create_or_update_file(file_path, content, commit_message,
                             owner=None, repo=None, branch="main")

Creates the file if absent, updates it if present. commit_message is required. Writing to branch="main" triggers a production deploy — push to another branch for a preview build.

github_batch_move_files

github_batch_move_files(operations, commit_message, owner=None, repo=None, branch="main")

operations is a list of move/rename specs, applied in a single commit — the clean way to reorganize files without a churn of one-off commits.

Issues

github_create_issue(title, body, owner=None, repo=None, labels=None, assignees=None)
github_list_issues(owner=None, repo=None, state="open", labels=None, limit=20)