| name | phab |
| description | Use phab CLI for Phabricator task management, code review workflows, revision creation and updates, with Git integration and auto-detection features. |
Phabricator CLI Skill
You are a Phabricator workflow specialist using the phab CLI tool. This skill provides comprehensive guidance for working with Phabricator tasks, revisions, diffs, and other operations from the command line.
Core Capabilities
The phab CLI provides comprehensive Phabricator integration:
- Tasks: Create, search, edit, comment, view task trees and edges (relationships)
- Revisions: Create, update, search, view diffs and comments
- Projects: Search and edit projects
- Users: Search users and view current user info
- Repositories: Search, edit, and manage repository URIs
- Diffs: Search and view diff details
- MCP Server: Integration with Model Context Protocol
- LSP: Language Server Protocol for editor integration
Task Operations
Searching Tasks
phab task search
phab task search --ids T123,T456
phab task search --author username
phab task search --assigned username
phab task search --status open
phab task search --status resolved
phab task search --priority high
phab task search --priority 100
phab task search --project project-slug
phab task search --query "bug in login"
phab task search --created-start 2025-01-01
phab task search --modified-end 2025-01-31
phab task search --assigned myusername --status open --project backend
phab task search --order priority
phab task search --order updated
phab task search --order newest
phab task search --limit 20
phab task search --output json
phab task search --output jsonl
phab task search --output table
phab task search --output markdown
phab task search --attach-projects
phab task search --attach-subscribers
Creating Tasks
phab task create --title "Fix login bug"
phab task create --title "Add feature" --description "Detailed description here"
phab task create --title "Urgent fix" --priority 100
phab task create --title "New task" --owner username
phab task create --title "Task" --status open
phab task create --title "Task" --projects "backend,frontend"
phab task create \
--title "Implement user authentication" \
--description "Add OAuth2 support for user login" \
--priority 80 \
--owner developer \
--projects "backend,security" \
--status open
Editing Tasks
phab task edit T123 --title "New title"
phab task edit T123 --description "Updated description"
phab task edit T123 --priority 90
phab task edit T123 --owner newuser
phab task edit T123 --status resolved
phab task edit T123 --add-projects "qa,testing"
phab task edit T123 --remove-projects "deprecated"
phab task edit T123 \
--title "Updated title" \
--priority 100 \
--status "in progress" \
--add-projects "urgent"
Viewing Tasks
phab task view T123
phab task view T123 --no-front-matter
phab task view T123 --transactions-only
phab task view T123 --output-json
Commenting on Tasks
phab task comment T123 --comment "This is fixed in D456"
phab task comment T123 --comment "$(cat <<'EOF'
This has been resolved.
Testing notes:
- Verified on staging
- All tests pass
EOF
)"
Viewing Task Comments
phab task get-comments T123
phab task get-comments T123 --json
Task Edges (Relationships)
Task edges represent relationships between tasks, such as parent/child, blocking/blocked by, and related tasks.
phab task edges T123
phab task edges T123 --json
Use Cases:
phab task edges T123
phab task edges T123 | grep "subtask"
phab task edges T123 | grep "blocks\|depends-on"
phab task edges T123 --json | jq '.edges[] | select(.type == "subtask")'
phab task edges T123 --json | jq '.edges[] | select(.type == "parent")'
phab task edges T123 --json | jq '.edges[] | select(.type == "duplicate")'
Integration with Task Trees:
Use phab task edges to see raw relationship data, while phab task tree provides a formatted hierarchical view:
phab task edges T123
phab task tree T123
Task Trees
phab task tree T123
Revision Operations
Creating Revisions
phab revision create
phab revision create HEAD~3..HEAD
phab revision create --title "Add new feature"
phab revision create --summary "This adds support for X"
phab revision create --test-plan "Tested manually on local dev"
phab revision create --reviewers "user1,user2,team-name"
phab revision create --draft
phab revision create --publish
phab revision create --base origin/develop
phab revision create --browse
phab revision create \
--title "Implement user authentication" \
--summary "Adds OAuth2 support with token refresh" \
--test-plan "Unit tests added, manual testing completed" \
--reviewers "security-team,backend-lead" \
--publish \
--browse
Updating Revisions
phab revision update
phab revision update D123
phab revision update 123
phab revision update D123 --title "Updated title"
phab revision update D123 --summary "New description"
phab revision update D123 --test-plan "Additional tests added"
phab revision update D123 --reviewers "user1,user2"
phab revision update D123 --publish
phab revision update D123 --base origin/main
phab revision update D123 --browse
phab revision update D123 \
--title "Updated implementation" \
--summary "Addressed review feedback" \
--test-plan "All edge cases now covered" \
--publish \
--browse
Searching Revisions
phab revision search
phab revision search --ids D123,D456
phab revision search --author username
phab revision search --reviewer username
phab revision search --status "needs-review"
phab revision search --status accepted
phab revision search --status published
phab revision search --repository repo-name
phab revision search --created-start 2025-01-01
phab revision search --modified-end 2025-01-31
phab revision search --author me --status "needs-review"
phab revision search --order updated
phab revision search --order newest
phab revision search --order created
phab revision search --limit 10
phab revision search --output markdown
phab revision search --output json
phab revision search --output table
phab revision search --attach-projects
phab revision search --attach-reviewers
phab revision search --attach-subscribers
Viewing Revision Diffs
phab revision diff D123
phab revision diff D123 --json
Viewing Revision Comments
phab revision comments D123
phab revision comments D123 --json
Editing Revisions
phab revision edit D123 --title "New title"
phab revision edit D123 --summary "Updated description"
phab revision edit D123 --status accepted
phab revision edit D123 --status abandoned
phab revision edit D123 --reviewers "user1,user2"
Project Operations
Searching Projects
phab project search
phab project search --query "backend"
phab project search --json
Editing Projects
phab project edit PROJECT-SLUG --name "New Name"
phab project edit PROJECT-SLUG --json
User Operations
Searching Users
phab user search
phab user search --usernames "user1,user2"
phab user search --json
Current User Info
phab user whoami
phab user whoami --json
Repository Operations
Searching Repositories
phab repository search
phab repository search --query "backend"
phab repository search --json
Repository URIs
phab repository uri REPO-NAME
phab repository uri REPO-NAME --json
Common Workflows
Workflow 1: Create and Submit Code Review
git checkout -b feature/new-thing
git add .
git commit -m "Add new feature"
phab revision create \
--title "Add new feature" \
--summary "Implements X, Y, and Z" \
--test-plan "Tested locally, unit tests added" \
--reviewers "team-backend" \
--browse
git add .
git commit -m "Address review feedback"
phab revision update --publish
Workflow 2: Review Pending Revisions
phab revision search --reviewer me --status "needs-review"
phab revision diff D123
phab revision comments D123
Workflow 3: Track Task Progress
phab task search --assigned me --status open
phab task view T123
phab task comment T123 --comment "Working on this now"
phab task edit T123 --status "in progress"
phab task edit T123 --status resolved --comment "Completed in D456"
Workflow 4: Create Task from Bug Report
phab task create \
--title "Bug: Login fails with special characters" \
--description "Users report login failures when password contains @#$" \
--priority 90 \
--projects "bugs,backend,urgent" \
--owner me
git checkout -b fix/login-special-chars
phab revision create \
--title "Fix login with special characters" \
--summary "Fixes T789 - properly escape special characters" \
--test-plan "Added unit tests for special character passwords"
phab task comment T789 --comment "Fix available in D456"
Workflow 5: Find Related Work
phab task search --project backend --status open
phab revision search --author colleague --order updated --limit 5
phab task tree T123
phab revision search --repository main-repo --order updated --limit 10
Workflow 6: Monitor Project Activity
phab task search \
--project myproject \
--order updated \
--limit 20
phab revision search \
--repository myrepo \
--status "needs-review" \
--order updated
phab task search \
--project myproject \
--priority high \
--status open
Output Formats
Markdown Format (Default)
Most commands default to markdown tables for human-readable output:
phab task search --assigned me
JSON Format
For programmatic processing:
phab task search --assigned me --output json | jq '.data[].fields.name'
JSON Lines Format
One JSON object per line:
phab revision search --output jsonl | while read line; do
echo "$line" | jq '.id'
done
Table Format
Compact table view:
phab task search --output table
Best Practices
Task Management
- Use descriptive titles: Make tasks searchable
- Add to projects: Organize work properly
- Set appropriate priority: Default is 50
- Assign ownership: Clear responsibility
- Update status: Keep team informed
- Comment regularly: Document progress
Revision Workflow
- Create from feature branch: Keep main clean
- Write good summaries: Explain what and why
- Include test plan: Help reviewers understand testing
- Add appropriate reviewers: Get right expertise
- Use draft for WIP: Publish when ready for review
- Update regularly: Don't let reviews go stale
Search Best Practices
- Use filters: Narrow results with --status, --project, etc.
- Limit results: Use --limit for large result sets
- Sort appropriately: --order updated for recent work
- Attach data selectively: Only use --attach-* when needed
- Use output formats: JSON for scripts, markdown for viewing
Integration with Git Workflow
Typical Development Flow
git checkout -b feature/new-thing
git add .
git commit -m "Implement feature"
phab revision create \
--title "Add new feature" \
--reviewers "team-name"
git add .
git commit -m "Address review feedback"
phab revision update
Auto-detection Features
The phab CLI includes smart auto-detection:
For revisions:
- Detects fork point from main/master branch
- Reads commit messages for title/summary
- Finds existing revision ID from git config or commit messages
- Auto-detects base branch (origin/master by default)
For tasks:
- Parses task IDs from commit messages
- Links revisions to tasks automatically
Advanced Features
Fork-Point Detection
phab revision create
phab revision create --base origin/develop
phab revision create HEAD~5..HEAD
Browser Integration
phab revision create --browse
phab revision update --browse
Pagination
For large result sets:
phab task search --limit 100
phab task search --after <cursor-from-previous-response>
phab task search --before <cursor>
Raw API Output
For debugging or advanced use:
phab task search --raw
Common Patterns
Pattern 1: Daily Standup Prep
phab task search --assigned me --status open --order priority
phab revision search --author me --status "needs-review"
phab revision search --reviewer me --status "needs-review"
Pattern 2: Project Health Check
phab task search --project myproject --status open --order priority
phab revision search --repository myrepo --status "needs-review"
phab task search --project myproject --order updated --limit 10
Pattern 3: Bug Triage
phab task search --project bugs --status open --order priority
phab task search --project bugs --priority high --status open
phab task search --project bugs --status open | grep "Unassigned"
Pattern 4: Code Review Queue
phab revision search --reviewer me --status "needs-review" --order updated
phab revision search --author me --status "needs-revision" --order updated
phab revision search --author me --status accepted --order updated
Pattern 5: Linking Work
TASK_ID=$(phab task create --title "Feature X" --json | jq -r '.object.id')
phab revision create --summary "Implements $TASK_ID"
phab task comment $TASK_ID --comment "Implementation in D123"
Configuration
The phab CLI typically uses configuration from:
~/.arcrc (Arcanist config)
- Environment variables
- Project-specific
.arcconfig
Required Configuration
Ensure you have:
- Phabricator API token configured
- Proper authentication set up
- Repository callsign/PHID mapping (for revision operations)
Troubleshooting
Issue: "Not authenticated"
Solution: Configure API token in ~/.arcrc or environment variables
Issue: "Repository not found"
Solution: Ensure repository is configured in Phabricator and callsign is correct
Issue: "Cannot detect fork point"
Solution: Specify explicit commit range or base branch:
phab revision create --base origin/main
phab revision create HEAD~3..HEAD
Issue: "Revision not found when updating"
Solution: Specify explicit revision ID:
phab revision update D123
Quick Reference
phab task search --assigned me --status open
phab task create --title "Title" --description "Desc"
phab task edit T123 --status resolved
phab task comment T123 --comment "Comment"
phab task view T123
phab task edges T123
phab task tree T123
phab revision create --title "Title" --reviewers "team"
phab revision update D123 --publish
phab revision search --author me --status "needs-review"
phab revision diff D123
phab revision comments D123
phab project search --query "name"
phab user search
phab user whoami
phab repository search --query "name"
phab repository uri REPO-NAME
Integration with Phabricator Ticket Writer Agent
When creating tasks programmatically, you can use the phabricator-ticket-writer agent for well-structured task creation with proper formatting.
Summary
Primary commands:
phab task search - Find tasks
phab task create - Create new task
phab revision create - Submit code for review
phab revision update - Update existing review
phab revision search - Find revisions
Key features:
- Auto-detection of branches and changes
- Multiple output formats (markdown, JSON, table)
- Rich filtering and search capabilities
- Git workflow integration
- Browser integration with --browse flag
Best practices:
- Use descriptive titles and summaries
- Include test plans in revisions
- Keep tasks organized in projects
- Update work regularly
- Link related tasks and revisions