Added list management commands, board filtering by project name, and enhanced skill documentation with bootstrap workflow and error handling patterns. Also added plumbing in to "pcli" binary for status syncing with Planka

This commit is contained in:
Steve Cliff
2026-02-18 20:06:56 +00:00
parent ad384fe749
commit 46b03e1a22
21 changed files with 1074 additions and 124 deletions
+74
View File
@@ -103,6 +103,15 @@ pcli task update <task-id> [--name "..."] [--position N] [--completed]
pcli task delete <task-id>
```
### Lists
```bash
pcli list create --board <board-id> --name "List Name" --position 65536 [--type active|closed]
pcli list get <list-id>
pcli list update <list-id> [--name "..."] [--position N] [--type active|closed] [--color "..."] [--board <board-id>]
pcli list delete <list-id>
```
### Labels
```bash
@@ -111,6 +120,31 @@ pcli label update <label-id> [--name "..."] [--color "..."] [--position N]
pcli label delete <label-id>
```
## API Response Structure
### Board Get Response
Board details include lists directly in `.data.lists[]`, not in an `included` section:
```bash
pcli board get <board-id> | jq '.data.lists[] | {id, name, position}'
```
### Project Get Response
Project details include boards in `.data.included.boards[]`:
```bash
pcli project get <project-id> | jq '.data.included.boards[] | {id, name}'
```
## Error Handling
### Project Configuration
- Always strip quotes from yq output: `yq '.planka.project' project.yaml | tr -d '"'`
- Exit with error if configured project cannot be found or created
- The project name in project.yaml is the authoritative source
### Idempotent Operations
- Use `2>/dev/null || true` for create operations that should not fail if resources already exist
- Check for empty results before attempting operations: `if [ -z "$PROJECT_ID" ]; then`
## Extracting IDs from Output
All responses use `{"data": ..., "error": null}`. Extract IDs with jq:
@@ -121,10 +155,50 @@ pcli card create --list <id> --name "X" | jq -r '.data.id'
# Array
pcli card list --board <id> | jq -r '.data[].id'
# With error checking
RESULT=$(pcli project list | jq -r --arg name "$PROJECT_NAME" '.data[] | select(.name == $name) | .id')
if [ -z "$RESULT" ]; then
echo "Not found"
else
echo "Found: $RESULT"
fi
```
## Common Workflows
### Bootstrap Project Infrastructure
```bash
# Read project configuration
PROJECT_NAME=$(yq '.planka.project' project.yaml | tr -d '"')
BOARD_NAME=$(yq '.planka.board' project.yaml | tr -d '"')
# Find or create project (exit with error if fails)
PROJECT_ID=$(pcli project list | jq -r --arg name "$PROJECT_NAME" '.data[] | select(.name == $name) | .id')
if [ -z "$PROJECT_ID" ]; then
echo "Error: Project '$PROJECT_NAME' not found and creation failed"
exit 1
fi
# Find or create board
BOARD_ID=$(pcli project get $PROJECT_ID | jq -r --arg name "$BOARD_NAME" '.data.included.boards[] | select(.name == $name) | .id')
if [ -z "$BOARD_ID" ]; then
BOARD_ID=$(pcli board create --project $PROJECT_ID --name "$BOARD_NAME" | jq -r '.data.id')
fi
# Create required lists (skip if exists)
pcli list create --board $BOARD_ID --name "Backlog" --position 65536 2>/dev/null || true
pcli list create --board $BOARD_ID --name "To Do" --position 131072 2>/dev/null || true
pcli list create --board $BOARD_ID --name "Planning" --position 196608 2>/dev/null || true
pcli list create --board $BOARD_ID --name "In Progress" --position 262144 2>/dev/null || true
pcli list create --board $BOARD_ID --name "Review" --position 327680 2>/dev/null || true
pcli list create --board $BOARD_ID --name "Done" --position 393216 2>/dev/null || true
# Create agent label
pcli label create --board $BOARD_ID --name "agent" --color "berry-red" 2>/dev/null || true
```
### Create a card with a checklist
```bash