Feature: My Apps Git Credentials - EyevinnOSC/community GitHub Wiki
Git Credentials let you deploy My Apps from private GitHub, GitLab, or Gitea repositories without ever sharing your Personal Access Token (PAT) in chat or MCP arguments. You register the PAT once under a friendly name; OSC stores it securely, and you reference it by name thereafter.
When you deploy from a private repository, OSC needs your PAT to clone the code. Without git credentials, you would paste the raw token into an MCP tool argument or the web form — where it appears in chat history, MCP audit logs, and browser memory. Git credentials avoid this:
- The PAT is entered in your browser (or via a terminal command you run yourself) and stored encrypted server-side.
- Only the friendly name (e.g.
"my-github-token") appears in MCP conversations and deployment records. - Token rotation replaces the stored value without changing the name — running apps continue to reference the same credential key.
- An OSC account on any plan
- A Personal Access Token from GitHub, GitLab, or Gitea with at least read access to the target repository
You can register a credential in three ways. All three store the PAT under the same user.gitcred.<name> key.
- Go to My Apps in the OSC web console.
- Click the Git Credentials tab.
- Click Add credential.
- Choose Paste a PAT and enter a name and your token, or choose Use GitHub account if you have a connected GitHub account.
- Click Save credential.
Ask your AI assistant (via MCP) to start the registration flow:
Register a git credential called "my-github-token" for my private repository.
The start-git-credential-registration tool returns a one-time URL valid for 10 minutes:
- Open the URL in your browser.
- Log in with your OSC account if prompted.
- Paste your PAT in the form and submit.
The PAT travels directly from your browser to OSC — it never passes through MCP, your AI assistant, or any chat log.
Ask the AI assistant for curl instructions:
Give me the curl command to register a git credential called "ci-github-token".
The get-git-credential-setup-instructions tool returns a ready-to-run command:
curl -X PUT "https://deploy.svc.prod.osaas.io/mytenantsecrets/user.gitcred.ci-github-token" \
-H "x-pat-jwt: Bearer $OSC_PAT_JWT" \
-H "Content-Type: application/json" \
-d '{"value":"YOUR_GITHUB_PAT_HERE"}'Run this command in your own terminal. Replace YOUR_GITHUB_PAT_HERE with your actual PAT and set $OSC_PAT_JWT to your OSC Personal Access Token (from Settings → API). Do not paste the command back into AI chat.
Pass the credential name in create-my-app:
Create a My App called "myapp" from the private repo https://github.com/myorg/private-repo
using the git credential "my-github-token".
The create-my-app tool accepts a gitCredential parameter. The raw PAT never appears in the tool call.
When creating a My App from a private repository, the Git Token (Optional) field in the Create App form offers two modes:
- Paste token — type or paste a Personal Access Token directly into the field; it is stored as a Kubernetes secret for that app.
- Use saved credential — select a credential you have already registered under My Apps → Git Credentials. The dropdown is populated from your saved credentials automatically.
Choose Use saved credential to avoid handling the raw token during app creation: the credential reference is stored instead of the token value itself.
When a PAT expires, rotate without downtime:
- Register a new PAT under the same friendly name (overwrite it via the web console, MCP browser flow, or curl).
- Trigger a token update via MCP:
Update the git token for my app "myapp" to use the credential "my-github-token".
The update-my-app-github-token tool applies a rolling restart — the app stays at the same URL with no downtime.
Or update via MCP in one step:
Rotate the git credential for "myapp" to use "my-github-token" (already updated in OSC).
List my git credentials.
The list-git-credentials MCP tool returns all friendly names with creation and last-updated timestamps, plus which apps are currently bound to each credential (boundApps). Credential values (PATs) are never returned.
Each credential also includes an age in days and an expiry risk rating:
| Risk level | Condition | Meaning |
|---|---|---|
HIGH |
25+ days old | Within 5 days of GitHub's 30-day PAT default — likely expired or expiring very soon |
MEDIUM |
20–24 days old | Approaching expiry — consider reissuing proactively |
LOW |
Under 20 days | No action needed |
When the AI assistant lists your credentials and an expiry risk warning is shown, reissue the PAT on GitHub (Settings → Developer settings → Fine-grained personal access tokens) and re-register it using update-my-app-github-token or the browser flow.
You can also view credentials on the Git Credentials tab in My Apps.
The list-my-apps MCP tool likewise shows which git credential is linked to each app (Git Credential field). Apps created with a raw inline token instead of a named credential show no Git Credential field.
If an app fails to build with a 403, Authentication failed, Permission denied, or No such device or address error on git clone, the AI assistant automatically detects this pattern in diagnose-my-app and get-my-app-logs and guides you through the fix.
The No such device or address error is a TTY-style failure that git emits in containerised builds when a credential helper has no terminal to prompt on — it means the PAT is expired or missing, not that the repository URL is wrong.
GitHub fine-grained PATs have a 30-day default lifetime. If the error appears approximately 30 days after the credential was registered, the PAT has almost certainly expired — check the age via list-git-credentials before assuming a permission or URL problem.
-
Call
list-git-credentials— check whether a credential is already registered and inspect its age. AHIGHexpiry risk or a credential registered ~30 days ago is the most likely cause. -
If the credential is expired — reissue the PAT on GitHub, then re-register it with
start-git-credential-registration(browser flow) or the curl command fromget-git-credential-setup-instructions. Then callupdate-my-app-github-tokento link the refreshed token. -
If no credential exists — use
start-git-credential-registrationto register one via the browser flow (see Register a Git Credential above), then callupdate-my-app-github-tokento link it. -
If a credential exists, is not expired, but is not linked — call
update-my-app-github-tokenwith the app name and the credential name. - The app automatically rebuilds after the token update. Call
wait-for-app-readyto confirm the build succeeds.
This guidance applies to GitHub, GitLab, Bitbucket, and any non-OSC git host. Managed OSC Gitea repositories use a different credential path.
The gitToken and gitHubToken parameters on create-my-app and update-my-app-github-token are deprecated. They still work for one release cycle but will be removed in Phase 4. Migrate to gitCredential to keep PATs out of MCP arguments.
| Tool | Description |
|---|---|
start-git-credential-registration |
Start a browser-based PAT registration flow. Returns a one-time URL (valid 10 min). |
get-git-credential-setup-instructions |
Return a ready-to-run curl command for headless/CI credential registration. |
list-git-credentials |
List all registered credential names with timestamps, age in days, expiry risk (HIGH/MEDIUM/LOW), and which apps are bound to each. PAT values are never returned. |
list-my-apps |
Lists apps with their git credential binding (Git Credential field) when a named credential is used. |
create-my-app |
Pass gitCredential: "name" to deploy from a private repo. |
update-my-app-github-token |
Pass gitCredential: "name" to rotate a private repo token with rolling restart. |
diagnose-my-app |
Detects git clone 403 errors, authentication failures, and TTY-style credential errors. Provides step-by-step recovery guidance including expiry checks. |
- My Apps dashboard
- Feature: My Agent Tasks — for deploying apps via AI agent
- User Guide: Credentials and Secrets — overview of all OSC credential types