Overview
Add a Pearls adapter to enable work CLI to manage issues in repositories using Pearls - a git-native, local-first issue tracker designed for agentic development.
Why Pearls?
Pearls aligns perfectly with work CLI's philosophy:
- Local-first: Issues stored in
.pearls/issues.jsonl alongside code
- Stateless: No daemon, single binary (
prl), fast Rust implementation
- Agent-ready: Strict schema, structured JSON data, finite-state transitions
- Git-native: Built-in merge driver and hooks for real workflows
- Lightweight: No cloud dependencies, works offline
Integration Benefits
- Natural fit: Both tools prioritize stateless execution, local-first design, and AI agent support
- Complementary: Pearls handles git-native storage, work CLI provides unified interface across backends
- Agent workflows: Enables mixed teams to use work CLI with repositories already using Pearls
- Zero dependencies: Pearls is a single binary, minimal installation friction
Proposed Implementation
Adapter Structure
src/adapters/pearls/
├── index.ts # PearlsAdapter implementing WorkAdapter interface
├── cli-wrapper.ts # Spawn prl commands, parse JSON output
├── mapper.ts # Map Pearls data model to work CLI WorkItem
└── types.ts # Pearls-specific types
Data Model Mapping
| work CLI |
Pearls |
Notes |
id |
id |
prl-xxxxxx format |
title |
title |
Direct mapping |
description |
description |
Direct mapping |
state |
status |
Open→new, InProgress→active, Closed→closed |
assignee |
metadata.assignee |
Via prl meta commands |
priority |
priority |
P0-P4 → map to work CLI priority levels |
labels |
labels |
Direct array mapping |
created_at |
created_at |
Unix timestamp |
updated_at |
updated_at |
Unix timestamp |
Relation Mapping
| work CLI |
Pearls Dependency Type |
blocks |
blocks |
parent |
parent_child |
relates_to |
related |
Context Configuration
# Add Pearls context pointing to repo root
work context add my-pearls-repo --tool pearls --path /path/to/repo
# work CLI will execute: prl --root /path/to/repo <command>
Core Operations
List items
// Execute: prl list --format json
// Parse JSON array, convert to WorkItem[]
Create item
// Execute: prl create "title" --description "desc" --priority 2 --label tag1,tag2
// Parse output to extract prl-xxxxxx ID
Update item
// Execute: prl update prl-abc123 --title "new" --status in_progress
// For metadata: prl meta set prl-abc123 assignee "user"
Link items
// Execute: prl link prl-abc123 prl-def456 blocks
Prerequisites Check
Before adapter implementation:
Implementation Phases
Phase 1: Core Adapter (MVP)
Phase 2: Relations & Metadata
Phase 3: Advanced Features
Phase 4: Documentation & Examples
Testing Strategy
tests/
├── unit/adapters/pearls/
│ ├── cli-wrapper.test.ts # Mock prl command execution
│ ├── mapper.test.ts # Data model conversion
│ └── adapter.test.ts # Core adapter logic
├── integration/adapters/pearls/
│ └── full-workflow.test.ts # Real prl commands in test repo
└── e2e/
└── pearls-workflow.test.ts # Complete user journey
Error Handling
- Missing
prl binary → Clear installation instructions
- Invalid repo path → Check for
.pearls/ directory
- JSONL corruption → Run
prl doctor --fix
- Git conflicts → Defer to Pearls merge driver
- State transition errors → Map to work CLI error types
Documentation Updates
Success Criteria
✅ All core lifecycle operations work (create, update, close)
✅ Relations and dependencies properly mapped
✅ Query engine filters Pearls data correctly
✅ >60% test coverage maintained
✅ Documentation complete with examples
✅ No breaking changes to existing adapters
Future Enhancements
- Real-time sync detection via
.pearls/issues.jsonl file watch
- Bulk operations optimization (single prl call for multiple items)
- Import existing Pearls issues on context creation
- Export work CLI data to Pearls format
References
- Pearls repository: https://github.com/mrorigo/pearls
- Pearls USER-GUIDE.md: Core commands and data model
- Pearls WHITEPAPER.md: Architecture and design philosophy
- work CLI adapter architecture: docs/work-adapter-architecture.md
Related: Complements existing local-fs (#28) and GitHub (#995) adapters.
Complexity: Medium - CLI wrapper pattern similar to GitHub adapter, but simpler auth.
Priority: P2 - Valuable for git-native workflows and agentic development teams.
Overview
Add a Pearls adapter to enable work CLI to manage issues in repositories using Pearls - a git-native, local-first issue tracker designed for agentic development.
Why Pearls?
Pearls aligns perfectly with work CLI's philosophy:
.pearls/issues.jsonlalongside codeprl), fast Rust implementationIntegration Benefits
Proposed Implementation
Adapter Structure
Data Model Mapping
ididtitletitledescriptiondescriptionstatestatusassigneemetadata.assigneeprl metacommandspriorityprioritylabelslabelscreated_atcreated_atupdated_atupdated_atRelation Mapping
blocksblocksparentparent_childrelates_torelatedContext Configuration
Core Operations
List items
Create item
Update item
Link items
// Execute: prl link prl-abc123 prl-def456 blocksPrerequisites Check
Before adapter implementation:
prlbinary is available in PATH.pearls/issues.jsonlexistsprl doctorfor integrity validationImplementation Phases
Phase 1: Core Adapter (MVP)
prlcommand executionPhase 2: Relations & Metadata
prl link/unlink)prl metaPhase 3: Advanced Features
prl ready)prl compact)prl doctorvalidation)Phase 4: Documentation & Examples
Testing Strategy
Error Handling
prlbinary → Clear installation instructions.pearls/directoryprl doctor --fixDocumentation Updates
Success Criteria
✅ All core lifecycle operations work (create, update, close)
✅ Relations and dependencies properly mapped
✅ Query engine filters Pearls data correctly
✅ >60% test coverage maintained
✅ Documentation complete with examples
✅ No breaking changes to existing adapters
Future Enhancements
.pearls/issues.jsonlfile watchReferences
Related: Complements existing local-fs (#28) and GitHub (#995) adapters.
Complexity: Medium - CLI wrapper pattern similar to GitHub adapter, but simpler auth.
Priority: P2 - Valuable for git-native workflows and agentic development teams.