setting-up-devbox

Configure, connect to, and sync code with a PostHog Coder devbox workspace.

713|118|Updated Aug 11, 2020
One-click install
npx skills add https://github.com/PostHog/posthog-foss --skill setting-up-devbox
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setting-up-devbox
Source: https://github.com/PostHog/posthog-foss/tree/main/.agents/skills/setting-up-devbox
Command: npx skills add https://github.com/PostHog/posthog-foss --skill setting-up-devbox

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PostHog engineers often struggle to get a remote devbox working: the Coder control plane sits behind a private Tailscale tailnet, auth and SSH config require one-time setup, and keeping a local checkout mirrored to the remote stack is error-prone. This Skill walks an engineer (or an agent) through the entire lifecycle using the supported hogli devbox:* commands.

Core Features & Use Cases

  • Diagnosis-first troubleshooting: Uses hogli devbox:doctor to identify tailnet misconfiguration (wrong tailnet, missing ACL grant, MagicDNS off) before touching anything else.
  • Full lifecycle management: Covers devbox:setup, devbox:start, devbox:ssh, devbox:exec, devbox:stop, and secret management for gh and Claude Code tokens via Coder user secrets.
  • Local-to-remote sync: Explains one-way mutagen mirroring with devbox:sync so you edit locally while the full PostHog stack runs on the box, including conflict behavior on feature branches.
  • Use Case: An engineer on a new laptop runs devbox:doctor, discovers they are signed into the dev tailnet instead of posthog.com, switches tailnets, completes setup, starts a box, and mirrors their feature branch for remote testing.

Quick Start

Ask the assistant to check my devbox status with hogli devbox:doctor and help me start and connect to my PostHog devbox.

Frequently Asked Questions about setting-up-devbox

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a PostHog devbox?

Run hogli devbox:doctor to check tailnet access and reachability, then hogli devbox:setup for one-time interactive configuration of the Coder CLI, SSH config, and optional git and dotfiles. Finally run hogli devbox:start to create or resume your box.

Why does every hogli devbox command fail at the reachability check?

The most common cause is being signed into the wrong Tailscale tailnet; devboxes require the posthog.com tailnet, not dev or prod tailnets. If the tailnet is correct, your email may be missing from group:engineering in tailnet-policy.hujson, which requires a PR to fix.

How do I sync local code changes to a remote devbox?

Run hogli devbox:sync from your local repo root to create a one-way mutagen mirror that pushes local edits to the box within seconds. The sync is one-way-safe, so remote-only files like node_modules are preserved, and lockfiles sync so the box reconciles dependencies.

How do I authenticate gh or Claude Code on a devbox?

Store tokens as Coder user secrets with hogli devbox:secret:set GH_TOKEN or CLAUDE_CODE_OAUTH_TOKEN, which injects them as environment variables into every box you start. Restart a running box to pick up newly set secrets, and never paste token values on a command line.

Why does devbox:exec report command not found for installed tools?

A non-login shell does not reliably source ~/.bashrc or ~/.zshrc, so tools on a login-shell PATH appear missing. Wrap commands in bash -lc '...' so the login shell loads the full PATH and exit codes propagate correctly.

Does devbox data persist across stops and restarts?

Stopping and starting a box, plus template and AMI updates, preserve everything under /home because the instance is stopped rather than terminated. A devbox:destroy wipes the disk entirely, so do not keep irreplaceable data only inside a box.