Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ out/
.vite/
.turbo/
storybook-static
bin/

# Environment
.env
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
## Commands

- `pnpm install` - Install all dependencies
- `pnpm dev` - Run both agent (watch) and code app via mprocs
- `pnpm dev` - Run both agent (watch) and code app via phrocs
- `pnpm dev:agent` - Run agent package in watch mode only
- `pnpm dev:code` - Run code desktop app only
- `pnpm build` - Build all packages (turbo)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ pnpm install

# Copy environment config
cp .env.example .env

# phrocs is auto-installed on first `pnpm dev`
```

### Running in Development
Expand Down
22 changes: 6 additions & 16 deletions mprocs.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,20 @@
procs:
code:
cmd: ["pnpm", "--filter", "code", "run", "start"]
cwd: .
color: blue
shell: 'pnpm --filter code run start'
depends_on:
- agent
- git

agent:
cmd: ["pnpm", "--filter", "agent", "run", "dev"]
cwd: .
color: magenta

shell: 'pnpm --filter agent run dev'

git:
cmd: ["pnpm", "--filter", "@posthog/git", "run", "dev"]
cwd: .
color: yellow
shell: 'pnpm --filter @posthog/git run dev'

storybook:
cmd: ["pnpm", "--filter", "code", "run", "storybook"]
cwd: .
color: cyan
shell: 'pnpm --filter code run storybook'
autostart: false

mobile-ios:
cmd: ["pnpm", "--filter", "@posthog/mobile", "run", "ios"]
cwd: .
color: green
shell: 'pnpm --filter @posthog/mobile run ios'
autostart: false
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"scripts": {
"setup": "bash apps/code/bin/setup",
"prepare": "husky",
"dev": "pnpm build:deps && mprocs",
"dev": "pnpm build:deps && bash scripts/ensure-phrocs.sh && bin/phrocs --config mprocs.yaml",
"dev:agent": "pnpm --filter agent dev",
"dev:git": "pnpm --filter @posthog/git dev",
"dev:code": "pnpm --filter code start",
Expand Down Expand Up @@ -45,7 +45,6 @@
"husky": "^9.1.7",
"knip": "^5.66.3",
"lint-staged": "^15.5.2",
"mprocs": "^0.7.1",
"turbo": "^2.6.2"
},
"lint-staged": {
Expand Down
10 changes: 0 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions scripts/ensure-phrocs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
set -euo pipefail

PHROCS_BIN="bin/phrocs"

if [ -x "$PHROCS_BIN" ]; then
exit 0
fi

echo "phrocs not found, downloading..."

ARCH=$(uname -m)
OS=$(uname -s | tr '[:upper:]' '[:lower:]')

case "$ARCH" in
arm64|aarch64) ARCH="arm64" ;;
x86_64) ARCH="amd64" ;;
*) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;;
esac

case "$OS" in
darwin|linux) ;;
*) echo "Unsupported OS: $OS" >&2; exit 1 ;;
esac

BINARY="phrocs-${OS}-${ARCH}"
URL="https://github.com/PostHog/posthog/releases/download/phrocs-latest/${BINARY}"

mkdir -p bin
curl -fSL "$URL" -o "$PHROCS_BIN"
chmod +x "$PHROCS_BIN"

echo "phrocs installed to $PHROCS_BIN"
Loading