Get Repository Files
Retrieves all files from a GitHub repository.Query Parameters
The repository owner (user or organization)
The repository name
Response
Array of file paths in the repository
The default branch name (e.g., “main” or “master”)
Example Request
Example Response
Error Responses
Get Organization Repositories
Retrieves repositories belonging to a GitHub organization.Query Parameters
The organization name
Response
Array of repository objects
Example Request
Example Response
Error Responses
Get User Repositories
Retrieves repositories for the authenticated user.Query Parameters
No query parameters required. This endpoint uses the authenticated user’s session.Response
Array of repository objects
Example Request
Example Response
Get File Content
Retrieves the content of a specific file from a GitHub repository with optional syntax highlighting.Query Parameters
The repository owner (user or organization)
The repository name
The file path within the repository
The branch, tag, or commit SHA to read from. Defaults to the repository’s default branch.
Whether to include syntax highlighting tokens. Set to
true to enable.Response
The raw file content
The Git SHA of the file
Syntax highlighting tokens (only included if
highlight=true). Array of token objects for rendering highlighted code.Example Request
Example Response
Error Responses
Notes
- All repository endpoints leverage the GitHub API integration defined in
/lib/github.ts - File content is decoded from base64 when retrieved from GitHub
- Syntax highlighting uses Shiki with support for 100+ languages
- The
pathparameter is automatically URL-decoded to handle special characters - Repositories are sorted by most recently pushed (for org repos) or most recently updated (for user repos)
- The
/api/org-reposendpoint fetches up to 100 repositories per request - The
/api/user-reposendpoint fetches up to 100 repositories sorted by update time - Authentication is handled via session cookies for user-specific endpoints