
Description
Use when managing ephemeral Gitea Docker environments, mirroring GitHub repos for isolated work, or promoting changes back to GitHub as PRs. Triggers on gitea, ephemeral git, isolated git environment, mirror repo, promote branch, disposable git server.
SKILL.md
Gitea Ephemeral Environments
amplifier-gitea is a CLI for on-demand, ephemeral Gitea Docker containers. All commands output JSON to stdout.
Prerequisites Check
Before any gitea operation, verify the environment:
# 1. Is the CLI installed?
which amplifier-gitea
# 2. Is Docker available and running?
which docker && docker info > /dev/null 2>&1 && echo "Docker OK" || echo "Docker NOT running"
If amplifier-gitea is not found:
uv tool install git+https://github.com/microsoft/amplifier-bundle-gitea@main
If Docker is not running:
- Linux:
sudo systemctl start docker - macOS:
open -a Docker - WSL: Start Docker Desktop on Windows, ensure WSL integration is enabled
If prerequisites are missing, report clearly and stop. Do not attempt workarounds.
Documentation
For overview, quick start, installation, and workflow examples:
read_file("@gitea:README.md")
For complete CLI reference with all flags, output schemas, and Gitea API examples:
read_file("@gitea:docs/api_reference.md")
For development setup, testing, and design decisions:
read_file("@gitea:docs/development.md")
Key Details
Admin Credentials
Every environment by default is created with a hardcoded admin account: admin / admin1234. The Gitea web UI is accessible at http://localhost:<port> and the Swagger API docs at http://localhost:<port>/swagger.
Mirroring Performance
By default mirror-from-github copies only git content (full history + all branches) and skips metadata. This is fast -- typically a few seconds.
Issues and PRs are the expensive part. Enabling --include-issues --include-prs can take several minutes depending on the repo size. Only opt in when you actually need it.
GitHub Token Resolution
GitHub sync commands (mirror-from-github, promote-to-github) resolve tokens in this order:
--github-tokenflag (explicit)GH_TOKENenvironment variablegh auth tokenCLI command
If the user has gh auth login done, no extra token configuration is needed.
Deploying Local Changes Without Committing
To test a local repo's working tree (committed + staged + unstaged + untracked + deletions) through a Gitea mirror without committing or staging anything in the source repo, snapshot it into a throwaway clone and push from there. Use this when the mirror must reflect your exact local state but you must not mutate the source repo (no git add/commit/stash in it).
First make sure the repo exists in Gitea (mirror-from-github <id> --github-repo ... or create an empty repo), then:
PORT=... # from `amplifier-gitea status <id>`
TOKEN=... # from `amplifier-gitea token <id>`
SNAP="$(mktemp -d)/<repo-name>"
git clone --local --no-hardlinks "<local-repo>" "$SNAP"
# overlay staged + unstaged + untracked (non-ignored) files from the working tree
( cd "<local-repo>" && git ls-files -z --cached --modified --others --exclude-standard ) \
| rsync -a --files-from=- --from0 "<local-repo>/" "$SNAP/"
# mirror tracked-file deletions
( cd "<local-repo>" && git ls-files -z --deleted ) \
| ( cd "$SNAP" && xargs -0 --no-run-if-empty rm -f )
# single throwaway commit IN THE SNAPSHOT, then force-push to the mirror
cd "$SNAP"
git -c user.email=snapshot@local -c user.name="Gitea Snapshot" add -A
git -c user.email=snapshot@local -c user.name="Gitea Snapshot" commit --allow-empty -m "working-tree snapshot"
git -c credential.helper= push --force \
"http://admin:$TOKEN@localhost:$PORT/admin/<repo-name>.git" HEAD:refs/heads/main
All git add/commit happens only in the temp snapshot, never in the source repo. If snapshotting fails, abort -- never fall back to operating on the source working tree.
Troubleshooting
| Problem | Fix |
|---|---|
command not found: amplifier-gitea | uv tool install git+https://github.com/microsoft/amplifier-bundle-gitea@main |
Cannot connect to the Docker daemon | Start Docker: sudo systemctl start docker (Linux) or open Docker Desktop (macOS/Windows) |
port is already allocated | Choose a different --port value, or amplifier-gitea list to find existing environments |
mirror-from-github fails on private repo | Pass --github-token or ensure gh auth login is done |
Token lost after create | Run amplifier-gitea token <id> to generate a new one |
promote-to-github 404 error | Verify --github-repo is in owner/repo format (not a full URL) |
No GitHub token found | Run gh auth login, or set GH_TOKEN, or pass --github-token |
Branch already exists on promote | The --github-branch already exists on the target repo. Use a different branch name. |
More from Microsoft
View publisherplaywright-trace
inspect Playwright trace files
playwright
Apr 6DebuggingPlaywrightTestingrushstack-best-practices
manage Rush monorepos with best practices
rushstack
Apr 6EngineeringLocal DevelopmentMicrosoftProject Management +1azure-ai-agents-persistent-dotnet
build AI agents with Azure .NET SDK
skills
Jul 3.NETAgentsAzureLLMazure-ai-anomalydetector-java
build anomaly detection applications with Java
skills
May 13AnalyticsAzureData AnalysisJava +2azure-ai-contentsafety-java
build content moderation applications with Azure AI
skills
Jul 7AI InfrastructureAzureJavaSecurityazure-ai-contentsafety-py
detect harmful content with Azure AI Content Safety
skills
Jul 18AzureComplianceLLMMicrosoft +2