Skip to content

Instantly share code, notes, and snippets.

@nazt
Created May 9, 2026 02:41
Show Gist options
  • Select an option

  • Save nazt/5c7b659378b3f22af306e17d6f0f3f1b to your computer and use it in GitHub Desktop.

Select an option

Save nazt/5c7b659378b3f22af306e17d6f0f3f1b to your computer and use it in GitHub Desktop.
mawjs user setup on macOS (m5) — Claude Code, maw CLI, ghq, Oracle plugins

mawjs User Setup on m5 (Mac Mini M1)

Full instructions for setting up the mawjs macOS user with Claude Code, maw CLI, ghq, and Oracle plugins. Completed: 2026-05-09

Prerequisites

  • macOS machine with admin access (user nat)
  • SSH key auth configured for mawjs@localhost
  • mawjs added to com.apple.access_ssh group
  • Bun installed at ~/.bun/bin/bun

1. Create the macOS User

# Create user (UID 502) via System Settings or:
sudo dscl . -create /Users/mawjs
sudo dscl . -create /Users/mawjs UserShell /bin/zsh
sudo dscl . -create /Users/mawjs UniqueID 502
sudo dscl . -create /Users/mawjs PrimaryGroupID 20
sudo dscl . -create /Users/mawjs NFSHomeDirectory /Users/mawjs
sudo createhomedir -c -u mawjs

# Enable SSH access
sudo dseditgroup -o edit -a mawjs -t user com.apple.access_ssh

2. SSH Key Auth

# From admin user, copy SSH public key
sudo mkdir -p /Users/mawjs/.ssh
sudo cp ~/.ssh/id_ed25519.pub /Users/mawjs/.ssh/authorized_keys
sudo chown -R mawjs:staff /Users/mawjs/.ssh
sudo chmod 700 /Users/mawjs/.ssh
sudo chmod 600 /Users/mawjs/.ssh/authorized_keys

Verify: ssh mawjs@localhost whoami should return mawjs.

3. Install Bun

ssh mawjs@localhost 'curl -fsSL https://bun.sh/install | bash'

Installed at ~/.bun/bin/bun.

4. Create .zshrc

ssh mawjs@localhost 'cat > ~/.zshrc << '\''ZSHRC'\''
# Bun
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"

# Local bin (for maw, claude, etc.)
export PATH="$HOME/.local/bin:$PATH"

# Homebrew (shared from host)
export PATH="/opt/homebrew/bin:$PATH"

# Timezone
export TZ="Asia/Bangkok"

# ghq
export GHQ_ROOT="$HOME/Code"

# Shared code directory
export PATH="/opt/Code/github.com/Soul-Brews-Studio/maw-js/bin:$PATH"
ZSHRC'

5. Install Claude CLI

ssh mawjs@localhost 'source ~/.zshrc && bun install -g @anthropic-ai/claude-code'

Installs to ~/.bun/bin/claude. Verify:

ssh mawjs@localhost 'source ~/.zshrc && claude --version'
# 2.1.137 (Claude Code)

6. Install maw CLI

Copy the compiled maw binary from nat's setup:

ssh mawjs@localhost 'mkdir -p ~/.local/bin'
scp /Users/nat/.local/bin/maw mawjs@localhost:~/.local/bin/maw
ssh mawjs@localhost 'chmod +x ~/.local/bin/maw'

Verify:

ssh mawjs@localhost 'source ~/.zshrc && maw --version'
# maw v26.5.7-alpha.752

7. ghq (Shared via Homebrew)

ghq is already available at /opt/homebrew/bin/ghq (installed by nat via Homebrew). The .zshrc PATH includes /opt/homebrew/bin, so no separate install needed.

ssh mawjs@localhost 'source ~/.zshrc && ghq --version'
# ghq version 1.10.1

8. Clone Repos

ssh mawjs@localhost 'source ~/.zshrc && ghq get https://github.com/Soul-Brews-Studio/maw-js'
ssh mawjs@localhost 'source ~/.zshrc && ghq get https://github.com/Soul-Brews-Studio/maw-plugin-registry'

Repos land at:

  • ~/Code/github.com/Soul-Brews-Studio/maw-js
  • ~/Code/github.com/Soul-Brews-Studio/maw-plugin-registry

9. maw Config

ssh mawjs@localhost 'mkdir -p ~/.config/maw && cat > ~/.config/maw/maw.config.json << '\''JSON'\''
{
  "host": "local",
  "port": 3457,
  "commands": {
    "default": "claude --dangerously-skip-permissions --continue"
  },
  "sessions": {},
  "env": {}
}
JSON'

Port 3457 avoids collision with nat's maw on port 3456.

10. Link Plugins

Symlink all plugins from the cloned maw-plugin-registry:

ssh mawjs@localhost "bash --norc --noprofile -c '
mkdir -p /Users/mawjs/.maw/plugins
REGISTRY=/Users/mawjs/Code/github.com/Soul-Brews-Studio/maw-plugin-registry/plugins
for p in \$(ls \$REGISTRY); do
  ln -sf \$REGISTRY/\$p /Users/mawjs/.maw/plugins/\$p
done
'"

Verify:

ssh mawjs@localhost "bash --norc --noprofile -c 'ls /Users/mawjs/.maw/plugins/ | wc -l'"
# 74

11. Verification (All-in-One)

ssh mawjs@localhost "bash --norc --noprofile -c '
export PATH=/Users/mawjs/.bun/bin:/Users/mawjs/.local/bin:/opt/homebrew/bin:\$PATH
echo \"bun:     \$(bun --version)\"
echo \"claude:  \$(claude --version 2>&1 | head -1)\"
echo \"maw:     \$(maw --version 2>&1 | head -1)\"
echo \"ghq:     \$(ghq --version 2>&1)\"
echo \"plugins: \$(ls /Users/mawjs/.maw/plugins/ | wc -l | tr -d \" \") linked\"
echo \"repos:   \$(ls /Users/mawjs/Code/github.com/Soul-Brews-Studio/)\"
echo \"TZ:      \$(grep TZ /Users/mawjs/.zshrc)\"
'"

Expected output:

bun:     1.3.13
claude:  2.1.137 (Claude Code)
maw:     maw v26.5.7-alpha.752
ghq:     ghq version 1.10.1 (rev:f600896)
plugins: 74 linked
repos:   maw-js
maw-plugin-registry
TZ:      export TZ="Asia/Bangkok"

Optional: Fleet Configs

If this user needs to run fleet oracles, copy fleet configs:

scp -r /Users/nat/.config/maw/fleet mawjs@localhost:~/.config/maw/fleet

Directory Layout

/Users/mawjs/
├── .bun/bin/bun              # Bun runtime
├── .bun/bin/claude           # Claude CLI (via bun global)
├── .local/bin/maw            # maw CLI (copied binary)
├── .config/maw/
│   └── maw.config.json       # maw configuration (port 3457)
├── .maw/
│   └── plugins/              # 74 symlinks → maw-plugin-registry
├── .zshrc                    # PATH, TZ, GHQ_ROOT
└── Code/github.com/Soul-Brews-Studio/
    ├── maw-js/               # maw source
    └── maw-plugin-registry/  # plugin source (symlink targets)

Troubleshooting

RTK hook interferes with SSH commands: Use bash --norc --noprofile to bypass .zshrc hooks when running admin commands via SSH.

Port collision: nat uses port 3456, mawjs uses 3457. If running both simultaneously, ensure no overlap.

Plugin updates: cd ~/Code/github.com/Soul-Brews-Studio/maw-plugin-registry && git pull — symlinks auto-update.

maw updates: Re-copy binary from nat: scp /Users/nat/.local/bin/maw mawjs@localhost:~/.local/bin/maw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment