Git Provider Integration
The Git Provider Integration enables Daytona to work with different Git providers.
Daytona’s Git Provider Integration is designed to:
- Provide flexibility: Use any supported Git provider to manage your source code.
- Simplify development workflows: Use the same Daytona commands regardless of the underlying Git provider.
- Secure integrations: Access Git providers using authenticated requests.
Git Provider Management Commands:
daytona git-providers add
: Registers a new Git provider. docs/daytona_git-providers_add.mddaytona git-providers list
: Lists registered Git providers. docs/daytona_git-providers_list.mddaytona git-providers delete
: Unregisters a Git provider. docs/daytona_git-providers_delete.md
Git Provider API
The Git Provider API, located at http://localhost:3986
, provides the following endpoints:
GetGitContext
: Retrieves Git context information for a given URL. pkg/apiclient/docs/GitProviderAPI.mdGetGitProviderForUrl
: Fetches the Git provider associated with a given URL. pkg/apiclient/docs/GitProviderAPI.mdGetGitProviderIdForUrl
: Retrieves the ID of the Git provider for a given URL. pkg/apiclient/docs/GitProviderAPI.mdGetGitUser
: Fetches Git user information for a specific Git provider. pkg/apiclient/docs/GitProviderAPI.mdGetNamespaces
: Retrieves namespaces available within a Git provider. pkg/apiclient/docs/GitProviderAPI.mdGetRepoBranches
: Fetches branches for a specific repository within a Git provider. pkg/apiclient/docs/GitProviderAPI.mdGetRepoPRs
: Lists pull requests for a given repository within a Git provider. pkg/apiclient/docs/GitProviderAPI.mdGetRepositories
: Retrieves repositories within a specific namespace and Git provider. pkg/apiclient/docs/GitProviderAPI.mdGetUrlFromRepository
: Retrieves the URL of a Git repository. pkg/apiclient/docs/GitProviderAPI.mdListGitProviders
: Lists all registered Git providers. pkg/apiclient/docs/GitProviderAPI.mdRemoveGitProvider
: Removes a registered Git provider. pkg/apiclient/docs/GitProviderAPI.mdSetGitProvider
: Registers or updates a Git provider. pkg/apiclient/docs/GitProviderAPI.md
Example of Registering a Git provider
daytona git-providers add --url "https://github.com/" --username "your-username" --token "your-token"
Example of Fetching Branches
daytona git-providers list
# Output:
# [
# {
# "id": "github",
# "baseUrl": "https://github.com/"
# }
# ]
daytona git-providers get-branches --provider "github" --namespace "your-namespace" --repo "your-repo"
Important Notes:
- Each Git provider requires specific authentication information, such as an access token or API key.
- Before using the Git Provider Integration, review the authentication requirements for your Git provider.
Data Models
The Git Provider Integration utilizes various data models. Each model is documented in the pkg/apiclient/docs
directory.
GitBranch
: Represents a Git branch. pkg/apiclient/docs/GitBranch.mdGitProvider
: Represents a Git provider. pkg/apiclient/docs/GitProvider.mdGitRepository
: Represents a Git repository. pkg/apiclient/docs/GitRepository.md
Top-Level Directory Explanations
hack/ - Directory for Go development, including build scripts and dependencies.
internal/ - Private package directory for the project’s internal modules.
internal/apikeys/ - Subdirectory for managing API keys.
internal/testing/ - Subdirectory for testing-related modules.
internal/testing/git/ - Subdirectory for Git-related testing configurations.
internal/testing/server/ - Subdirectory for testing server configurations.
internal/util/ - Subdirectory for utility modules.
internal/util/apiclient/ - Subdirectory for API client utilities.
pkg/ - Go packages directory.
pkg/agent/ - Subdirectory for the project’s agent package.
pkg/agent/config/ - Subdirectory for configuration files for the agent package.
pkg/agent/ssh/ - Subdirectory for SSH-related configurations and utilities.
pkg/agent/tailscale/ - Subdirectory for Tailscale-related configurations and utilities.
pkg/api/ - Subdirectory for API-related packages.
pkg/api/controllers/ - Subdirectory for API controller handlers.
pkg/api/middlewares/ - Subdirectory for API middlewares.
pkg/apiclient/ - Subdirectory for API client package.
pkg/apiclient/.openapi-generator/ - Subdirectory for OpenAPI generator configurations.
pkg/apiclient/api/ - Subdirectory for API client API.
pkg/apikey/ - Subdirectory for API key management.
pkg/cmd/ - Subdirectory for command-line interface tools.
pkg/cmd/agent/ - Subdirectory for agent command-line tools.
pkg/cmd/apikey/ - Subdirectory for API key command-line tools.
pkg/cmd/containerregistry/ - Subdirectory for container registry command-line tools.
pkg/cmd/gitprovider/ - Subdirectory for Git provider command-line tools.
pkg/cmd/ports/ - Subdirectory for port command-line tools.
pkg/cmd/profile/ - Subdirectory for profile command-line tools.
pkg/cmd/projectconfig/ - Subdirectory for project configuration command-line tools.
pkg/cmd/provider/ - Subdirectory for provider command-line tools.
pkg/cmd/server/ - Subdirectory for server command-line tools.
pkg/cmd/workspace/ - Subdirectory for workspace command-line tools.
pkg/cmd/workspacemode/ - Subdirectory for workspace mode command-line tools.
pkg/containerregistry/ - Subdirectory for container registry package.
pkg/db/ - Subdirectory for database-related packages and scripts.
pkg/db/dto/ - Subdirectory for database data transfer objects.
pkg/docker/ - Subdirectory for Docker-related packages and scripts.
pkg/git/ - Subdirectory for Git-related packages and scripts.
pkg/gitprovider/ - Subdirectory for Git provider package.
pkg/gitprovider/gitnessclient/ - Subdirectory for Git provider GitHub client.
pkg/ide/ - Subdirectory for IDE-related packages and scripts.
pkg/profiledata/ - Subdirectory for profiledata package.
pkg/provider/ - Subdirectory for provider packages and scripts.
pkg/provider/manager/ - Subdirectory for provider manager.
pkg/provider/util/ - Subdirectory for provider utilities.
pkg/provisioner/ - Subdirectory for provisioner packages and scripts.
pkg/server/ - Subdirectory for server-related packages and scripts.
pkg/server/apikeys/ - Subdirectory for API keys server-side.
pkg/server/containerregistries/ - Subdirectory for container registries server-side.
pkg/server/gitproviders/ - Subdirectory for Git providers server-side.
pkg/server/headscale/ - Subdirectory for Headscale server-side.
pkg/server/profiledata/ - Subdirectory for profiledata server-side.
pkg/server/projectconfig/ - Subdirectory for project configuration server-side.
pkg/server/providertargets/ - Subdirectory for provider targets server-side.
pkg/ssh/ - Subdirectory for SSH-related packages and scripts.
pkg/tailscale/ - Subdirectory for Tailscale package.
pkg/tailscale/tunnel/ - Subdirectory for Tailscale tunnel.
pkg/telemetry/ - Subdirectory for telemetry-related packages and scripts.
pkg/views/ - Subdirectory for view templates.
pkg/views/containerregistry/ - Subdirectory for container registry view templates.
pkg/views/env/ - Subdirectory for environment variable view templates.
pkg/views/gitprovider/ - Subdirectory for Git provider view templates.
pkg/views/ide/ - Subdirectory for IDE view templates.