https://github.com/soenneker/soenneker.github.filestore
A high-level file system utility for GitHub repositories, built on the GitHub OpenAPI client. Supports reading, writing, deleting, listing, and checking file existence via the GitHub Contents API.
https://github.com/soenneker/soenneker.github.filestore
api blob client content crud csharp dotnet file filestore filesystem github githubfilestore openapi repository rest sdk soenneker storage store util
Last synced: 18 days ago
JSON representation
A high-level file system utility for GitHub repositories, built on the GitHub OpenAPI client. Supports reading, writing, deleting, listing, and checking file existence via the GitHub Contents API.
- Host: GitHub
- URL: https://github.com/soenneker/soenneker.github.filestore
- Owner: soenneker
- License: mit
- Created: 2025-05-21T17:10:59.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2026-03-07T12:42:44.000Z (23 days ago)
- Last Synced: 2026-03-07T12:45:28.712Z (23 days ago)
- Topics: api, blob, client, content, crud, csharp, dotnet, file, filestore, filesystem, github, githubfilestore, openapi, repository, rest, sdk, soenneker, storage, store, util
- Language: C#
- Homepage: https://soenneker.com
- Size: 695 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
īģŋ[](https://www.nuget.org/packages/soenneker.github.filestore/)
[](https://github.com/soenneker/soenneker.github.filestore/actions/workflows/publish-package.yml)
[](https://www.nuget.org/packages/soenneker.github.filestore/)
#  Soenneker.GitHub.FileStore
### A high-level file system utility for GitHub repositories, built on the GitHub OpenAPI client. Supports reading, writing, deleting, listing, and checking file existence via the GitHub Contents API.
## Features
* đ Read file content from a GitHub repository
* đ Write new files with commit messages and optional branch targeting
* â Delete files with SHA validation
* đ List directory contents
* â
Check for file existence
* âī¸ Built on top of a typed OpenAPI GitHub client
## Installation
```bash
dotnet add package Soenneker.GitHub.FileStore
````
## Setup
```csharp
builder.Services.AddGitHubFileStoreAsSingleton();
```
This will register all necessary dependencies, including the underlying GitHub OpenAPI client.
âšī¸ **Note**: The GitHub access token must be provided via configuration under the key: `GitHub:Token`.
## Example Usage
```csharp
public class MyService
{
private readonly IGitHubFileStore _store;
public MyService(IGitHubFileStore store)
{
_store = store;
}
public async Task Run()
{
string content = await _store.Read("owner", "repo", "README.md");
await _store.Create("owner", "repo", "newfile.txt", "Hello world!");
bool exists = await _store.Exists("owner", "repo", "README.md");
var files = await _store.List("owner", "repo", "docs");
await _store.Delete("owner", "repo", "oldfile.txt");
}
}
```
## Related Packages
* [`Soenneker.GitHub.OpenApiClient`](https://www.nuget.org/packages/Soenneker.GitHub.OpenApiClient)