---
allowed-tools: Bash(asutils p4:*), Bash(p4:*)
description: |
  Reference for asutils p4 CLI commands. Use the p4-explorer AGENT for exploration tasks.
  This skill is a command reference only - invoke the agent for depot exploration.
---

# Perforce CLI Reference

Reference for `asutils p4` commands to explore Epic's Perforce depot.

## When to Use What

| Scenario | Use |
|----------|-----|
| User asks to find/explore depot files | **p4-explorer agent** |
| Need to understand depot structure | **p4-explorer agent** |
| Looking up specific command syntax | This skill (reference) |
| Simple single command you know | Direct Bash call |

**For most Perforce exploration, delegate to the `p4-explorer` agent.**

## Quick Reference

| Action | Command |
|--------|---------|
| **Setup** | `asutils p4 setup` |
| List directory | `asutils p4 ls <path>` |
| List with files | `asutils p4 ls <path> -f` |
| Find files | `asutils p4 find <pattern> -p <path> -l <limit>` |
| Show tree | `asutils p4 tree <path> -d <depth>` |
| File info | `asutils p4 info <path>` |
| File history | `asutils p4 history <path> -l <limit>` |
| Print file | `asutils p4 cat <path>` |
| Print revision | `asutils p4 cat <path> -r <rev>` |
| Changelist | `asutils p4 cl <number>` |
| Local mapping | `asutils p4 where <path>` |
| Show aliases | `asutils p4 aliases` |
| Verify connection | `asutils p4 verify` |
| Show config | `asutils p4 status` |

## Depot Aliases

| Alias | Path |
|-------|------|
| fortnite, fn | //Fortnite/Main/ |
| fortnite-release | //Fortnite/Release-*/ |
| ue5 | //UE5/Main/ |
| ue4 | //UE4/Main/ |
| eos | //EOSSDK/Main/ |
| 3rdparty, thirdparty | //depot/3rdParty/ |
| tools | //depot/InternalTools/ |
| plugins | //GamePlugins/ |

## Command Examples

### Navigation
```bash
asutils p4 ls fortnite              # List //Fortnite/Main/
asutils p4 ls ue5 -f                # List with files
asutils p4 tree fortnite -d 3       # Tree 3 levels deep
```

### Search
```bash
asutils p4 find "*.Build.cs" -p fortnite -l 50
asutils p4 find "*Controller*" -p //Fortnite/Main/Source/
```

### File Operations
```bash
asutils p4 info //Fortnite/Main/Build.cs
asutils p4 history //Fortnite/Main/Build.cs -l 20
asutils p4 cat //Fortnite/Main/Build.cs
```

### Configuration
```bash
asutils p4 aliases    # Show all aliases
asutils p4 verify     # Test connection
asutils p4 status     # Show P4 config
```

## Raw p4 Commands

When the CLI doesn't suffice, use raw p4:

```bash
# List directories
p4 dirs //Fortnite/Main/*

# List files with details
p4 files //Fortnite/Main/Source/...

# File status
p4 fstat //path/to/file

# File history
p4 filelog -l 10 //path/to/file

# Changelist details
p4 describe 12345678

# Print file at revision
p4 print //path/to/file@12345
```

## Environment

Required environment/P4CONFIG:
- P4PORT: `perforce:1666` (internal) or `perforce-proxy-vpn.epicgames.net:1666` (VPN)
- P4USER: firstname.lastname (Okta credentials)
- P4CLIENT: Your workspace name

Check status: `asutils p4 status`
Verify connection: `asutils p4 verify`
