Microsoft logo

Skill

gitea

manage ephemeral Gitea Docker environments

Covers Git Docker

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:

  1. --github-token flag (explicit)
  2. GH_TOKEN environment variable
  3. gh auth token CLI 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

ProblemFix
command not found: amplifier-giteauv tool install git+https://github.com/microsoft/amplifier-bundle-gitea@main
Cannot connect to the Docker daemonStart Docker: sudo systemctl start docker (Linux) or open Docker Desktop (macOS/Windows)
port is already allocatedChoose a different --port value, or amplifier-gitea list to find existing environments
mirror-from-github fails on private repoPass --github-token or ensure gh auth login is done
Token lost after createRun amplifier-gitea token <id> to generate a new one
promote-to-github 404 errorVerify --github-repo is in owner/repo format (not a full URL)
No GitHub token foundRun gh auth login, or set GH_TOKEN, or pass --github-token
Branch already exists on promoteThe --github-branch already exists on the target repo. Use a different branch name.

© 2026 YourAI.tools. Every skill from an identity-verified publisher.

Independent catalog. Not affiliated with, endorsed by, or sponsored by Anthropic or any listed publisher. All trademarks belong to their respective owners.