본문으로 건너뛰기
cccskills
무료GitHub에 공개

borg-live-debug

Live Borg debugging by exec-ing into the borg-web-ui Docker container. Use when debugging borg commands, writing tests against real borg output, developing borg 2.0 features, or verifying borg behavior before writing code.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구Docker
설치 방법 보기

포함된 파일(1)

  • SKILL.md5.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Borg Live Debug Skill

You have direct access to a running borg-web-ui Docker container. Use this to run real borg/borg2 commands, inspect actual output, and use that ground truth to write code, tests, and fixes.

Container Details

  • Container name: borg-web-ui
  • Borg 1 binary: borg (e.g. /usr/bin/borg or via PATH)
  • Borg 2 binary: borg2 (e.g. /usr/local/bin/borg2)
  • Working dir: /app
  • Data dir: /data (database, SSH keys, repos)
  • Working user for borg ops: borg (use gosu borg or su borg -c)

How to exec into the container

Run commands inside the container using:

docker exec -it borg-web-ui <command>
# or as the borg user:
docker exec -u borg borg-web-ui <command>
# or for multi-step shell sessions:
docker exec borg-web-ui bash -c "<cmd1> && <cmd2>"

Workflow

When the user asks to debug, test, or develop borg functionality:

Step 1 — Verify the container is running

docker ps --filter name=borg-web-ui --format "{{.Names}} {{.Status}}"

If it's not running, tell the user to start it: docker compose up -d

Step 2 — Probe the environment

# Check borg versions available
docker exec borg-web-ui bash -c "borg --version 2>/dev/null; borg2 --version 2>/dev/null"

# Check what repos are configured (from DB or env)
docker exec borg-web-ui bash -c "ls /data/ 2>/dev/null"

Step 3 — Run the borg command and capture output

Run the exact borg command you need to test. Always capture both stdout and stderr:

docker exec -u borg borg-web-ui bash -c "BORG_PASSPHRASE='' borg list /path/to/repo 2>&1"
# For borg2:
docker exec -u borg borg-web-ui bash -c "BORG_PASSPHRASE='' borg2 rinfo /path/to/repo 2>&1"

Key environment variables to set when running borg commands:

  • BORG_PASSPHRASE — passphrase (empty string if unencrypted)
  • BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes — skip prompts for unencrypted repos
  • BORG_RSH — custom SSH command if needed
  • BORG_REMOTE_PATH — path to borg on remote (for SSH repos)

Step 4 — Use output to write code

After seeing the real output:

  • Parse the exact JSON structure (use borg ... --json wherever possible)
  • Match error messages exactly for error handling
  • Match field names precisely in Python code
  • Write tests using real fixture data from the output

Common borg2 command cheat sheet (key differences from borg1)

TaskBorg 1Borg 2
Init repoborg init REPOborg2 rcreate REPO
Repo infoborg info REPOborg2 rinfo REPO
Delete repoborg delete REPOborg2 rdelete REPO
List archivesborg list REPOborg2 list REPO
Archive infoborg info REPO::ARCborg2 info REPO::ARC
Createborg create REPO::ARC src/borg2 create REPO::ARC src/
Extractborg extract REPO::ARCborg2 extract REPO::ARC
Pruneborg prune REPOborg2 prune REPO
CompactN/A (auto)borg2 compact REPO (REQUIRED after delete/prune)
Checkborg check REPOborg2 check REPO
Mountborg mount REPO::ARC MNTPTborg2 mount REPO::ARC MNTPT

Create a temporary test repo inside the container

When you need a throwaway repo to test against:

# Create a temp repo (unencrypted for easy testing)
docker exec -u borg borg-web-ui bash -c "
  BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes \
  borg init --encryption=none /tmp/test-repo-1 2>&1 &&
  echo 'test content' > /tmp/testfile.txt &&
  borg create /tmp/test-repo-1::archive-1 /tmp/testfile.txt 2>&1 &&
  borg list /tmp/test-repo-1 2>&1
"

# Same for borg2
docker exec -u borg borg-web-ui bash -c "
  BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes \
  borg2 rcreate --encryption=none /tmp/test-repo-2 2>&1 &&
  echo 'test content' > /tmp/testfile.txt &&
  borg2 create /tmp/test-repo-2::archive-1 /tmp/testfile.txt 2>&1 &&
  borg2 list /tmp/test-repo-2 2>&1
"

JSON output for parsing

Always prefer --json flag to get structured output you can map directly to Python:

docker exec -u borg borg-web-ui bash -c "borg list --json /tmp/test-repo-1 2>&1"
docker exec -u borg borg-web-ui bash -c "borg info --json /tmp/test-repo-1::archive-1 2>&1"
docker exec -u borg borg-web-ui bash -c "borg2 rinfo --json /tmp/test-repo-2 2>&1"

Inspect the Python app code live

# Check what Python modules are available
docker exec borg-web-ui bash -c "cd /app && python3 -c 'from app.core.borg2 import *; print(\"ok\")'"

# Run a quick Python snippet against the live app
docker exec borg-web-ui bash -c "cd /app && python3 -c \"
import asyncio
from app.core.borg2 import borg2_rinfo
result = asyncio.run(borg2_rinfo('/tmp/test-repo-2'))
print(result)
\""

Cleanup

After debugging, clean up temp repos:

docker exec borg-web-ui bash -c "rm -rf /tmp/test-repo-1 /tmp/test-repo-2 /tmp/testfile.txt"

Rules

  1. Always run the command first, then write code — never guess borg output format.
  2. Use --json wherever possible — map the exact field names into Python dicts.
  3. Capture stderr — borg sends warnings and errors to stderr; use 2>&1.
  4. Test both binaries — when working on borg2 features, also verify borg1 is unaffected.
  5. Clean up temp repos after debugging sessions.
  6. If container is not running, tell the user before attempting anything.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

commit

무료

Create a well-formed git commit from current changes using session history for rationale and summary; use when asked to commit, prepare a commit message, or finalize staged work.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

karanhudia/borg-ui1.7천2026년 10월 19일 업데이트

Continue a multi-phase engineering spec from its progress table. Use when the user says /continue-spec, "continue the spec", "continue the operations feature", or asks what the next phase is. Runs the next step (plan, implement, review) in this session on the model the spec names, stopping at the spec's gates. Never uses subagents.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

karanhudia/borg-ui1.7천2026년 10월 19일 업데이트

land

무료

Land a PR by monitoring conflicts, resolving them, waiting for checks, and squash-merging when green; use when asked to land, merge, or shepherd a PR to completion.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

karanhudia/borg-ui1.7천2026년 10월 19일 업데이트

linear

무료

Use Symphony's `linear_graphql` client tool for raw Linear GraphQL operations such as comment editing and upload flows.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

karanhudia/borg-ui1.7천2026년 10월 19일 업데이트

pull

무료

Pull latest origin/main into the current local branch and resolve merge conflicts (aka update-branch). Use when Codex needs to sync a feature branch with origin, perform a merge-based update (not rebase), and guide conflict resolution best practices.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

karanhudia/borg-ui1.7천2026년 10월 19일 업데이트

push

무료

Push current branch changes to origin and create or update the corresponding pull request; use when asked to push, publish updates, or create pull request.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

karanhudia/borg-ui1.7천2026년 10월 19일 업데이트

karanhudia의 스킬 모두 보기

이 스킬의 문제 신고