Jido. VFS. Adapter. GitHub
(Jido.VFS v1.0.0)
View Source
A GitHub virtual filesystem adapter for Jido.VFS.
This adapter allows you to interact with GitHub repositories as if they were
a local filesystem, using the GitHub API through the tentacat package.
Configuration
config = Jido.VFS.Adapter.GitHub.configure(
owner: "username",
repo: "repository-name",
ref: "main", # branch or commit SHA
auth: %{access_token: "github_pat_token"}
)Application Configuration
You can also configure GitHub credentials in your application config:
# config/config.exs
config :jido_vfs, :github,
access_token: "github_pat_token",
name: "Your Name",
email: "your@email.com"When configured this way, the adapter will automatically use these credentials as defaults if not explicitly provided in the configure/1 call.
Authentication
Supports several authentication methods:
- Personal Access Token:
%{access_token: "token"} - Username/Password:
%{user: "username", password: "password"} - No authentication (public repos only):
nil
Examples
# Read a file
{:ok, content} = Jido.VFS.read(config, "README.md")
# Write a file (creates a commit)
:ok = Jido.VFS.write(config, "new_file.txt", "content",
message: "Add new file",
committer: %{name: "Your Name", email: "your@email.com"})
# List directory contents
{:ok, files} = Jido.VFS.list_contents(config, "src/")
Summary
Functions
Configure the GitHub adapter.