remote-codespaces
Procedural instructions on tunneling and exposing GH Codespaces over SSH/SFTP directly to Termux.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Procedural instructions on tunneling and exposing GH Codespaces over SSH/SFTP directly to Termux.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Protocol for high-fidelity document consolidation and conceptual shifting, preventing lossy 'banal summarization'.
Use this skill when the user wants to analyze a YouTube video forensically using a .info.json (metadata + comments) and/or .en.srt (transcript) produced by yt-dlp. Covers any narrative video genre: scams, true crime, interviews, controversies, documentaries. Triggers include: any mention of .info.json or .en.srt files, requests to analyze YouTube comments, mine crowd reactions, run sentiment analysis, cluster topics, find narrative pivots in a transcript, or extract the video URL from a yt-dlp JSON. The skill covers two tiers: (1) quick forensics via jq/Python, and (2) full statistical analysis via pandas/sklearn/matplotlib. Do NOT use for general YouTube searches, video downloading, or tasks where no .info.json/.en.srt files are present.
A methodology for researching, drafting, and posting high-quality technical reports to GitHub repositories.
Sequential JSON-based workflow for accessing non-Termux files on Android using termux-saf-*.
Generalized template for diagnosing complex logical patterns and bugs in unstructured codebases or texts.
Conceptual and operational master guide for interacting with Neo4j using MCP tools.
| name | remote-codespaces |
| description | Procedural instructions on tunneling and exposing GH Codespaces over SSH/SFTP directly to Termux. |
Why this setup works, including all the moving parts, your “surprises,” and parallels with GCloud. This is aimed at any AI trying to understand and reproduce the behavior reliably.
We are dealing with:
gh CLI, rclone, SSHFS (optional), sudo, FUSE, MiXplorer.gh:gh auth login --with-token < ~/.ghtoken1
gh’s session.codespace scope.CSPACE_NAME=$(gh codespace list --json name,state | jq -r '.[] | select(.state=="Available") | .name' | head -n1)
WORKSPACE_PATH=$(gh codespace ssh -c "$CSPACE_NAME" -- 'pwd' | tr -d '\r\n')
/workspace (which can fail).✅ Now we know the exact remote path we want to expose via SFTP/FUSE.
rclone serve sftp remotely:gh codespace ssh -c "$CSPACE_NAME" -- \
"nohup rclone serve sftp $WORKSPACE_PATH --addr :2222 >/dev/null 2>&1 &"
:2222.nohup ensures it continues running after the SSH session ends.gh codespace ssh -c "$CSPACE_NAME" -- -L 2222:localhost:2222 -N &
127.0.0.1:2222.✅ The tunnel makes the remote Codespace appear local.
SSH authentication has already been handled by gh:
gh uses the token from ~/.ghtoken1 to log in to the Codespace.MiXplorer connects as codespace, the actual Linux user in Codespace.
No password is required because the SSH session has already pre-authenticated.
No private key file is needed for MiXplorer; the tunnel handles all authentication.
Surprise tricks:
pem_private_key_path or entering a password is unnecessary.rclone or FUSE in TermuxRCLONE_REMOTE="GH_01"
MOUNT_PATH=~/storage/GH_01_rclone
# Create remote config if not exists
if ! rclone listremotes | grep -qx "${RCLONE_REMOTE}:"; then
rclone config create "$RCLONE_REMOTE" sftp \
host 127.0.0.1 \
user codespace \
port 2222
fi
mkdir -p "$MOUNT_PATH"
# Mount via FUSE (requires sudo on Termux)
sudo rclone mount "$RCLONE_REMOTE:" "$MOUNT_PATH" \
--allow-other \
--vfs-cache-mode writes &
sudo may be required to satisfy allow-other.GCloud workflow:
gcloud cloud-shell ssh --authorize-session "curl -s https://ipinfo.io/ip"Codespaces workflow is conceptually the same:
| GCloud | Codespaces / gh CLI |
|---|---|
| PEM key needed | Not needed — gh tunnel pre-authenticated |
| User: cloud shell | User: codespace |
| Fetch external IP | Tunnel via localhost |
| Mount via SSHFS or rclone | Mount via rclone FUSE |
| MiXplorer sees filesystem | Same |
Main surprise: Codespaces works without password or key, but GCloud does not.
gh auth login ensures gh can access Codespace.gh codespace ssh starts a session and/or tunnel.rclone serve sftp inside Codespace exposes the filesystem.127.0.0.1:2222).rclone mount accesses it as a local SFTP mount.Tricks for AIs to notice:
pwd in Codespace).rclone serve sftp inside Codespace + local port forward replaces the need for public IPs.allow-other in FUSE mounts.✅ Conclusion for AI readers
This is a clean pattern for ephemeral cloud workspaces:
gh or gcloud).The magic of Codespaces is the ephemeral SSH session created by gh, which allows no-key, no-password SFTP through the tunnel. GCloud works similarly, but uses PEM keys because authentication is not tunneled.
Working codes are in: /sdcard/Documents/Android_Code_snippets/aliases2.sh