Files
pcli/test-list-commands.md
T

2.5 KiB

Testing List Commands

This document demonstrates how to use the new list management commands.

Prerequisites

  1. Set up your Planka API credentials:

    export PLANKA_URL="https://your-planka-instance.com"
    export PLANKA_API_KEY="your-api-key"
    
  2. Have a project and board available. You can create them with:

    ./pcli project create --name "Test Project"
    ./pcli board create --project <project-id> --name "Test Board"
    

List Management Commands

1. Create a new list (column)

# Create an "To Do" list
./pcli list create --board <board-id> --name "To Do" --type "active"

# Create a "Done" list with specific position
./pcli list create --board <board-id> --name "Done" --type "closed" --position 131072

2. Get list details

./pcli list get <list-id>

3. Update a list

# Change the name
./pcli list update <list-id> --name "In Progress"

# Change the color
./pcli list update <list-id> --color "berry-red"

# Move list to a different position
./pcli list update <list-id> --position 98304

# Move list to a different board
./pcli list update <list-id> --board <other-board-id>

4. Delete a list

./pcli list delete <list-id>

Output Formats

All commands support both JSON and table output formats:

# JSON output (default)
./pcli list get <list-id>

# Table output
./pcli list get <list-id> --format table

Example Workflow

# 1. List existing boards to get the board ID
./pcli board list --format table

# 2. Create multiple lists for a Kanban board
./pcli list create --board <board-id> --name "Backlog" --type "active" --position 0
./pcli list create --board <board-id> --name "To Do" --type "active" --position 65536
./pcli list create --board <board-id> --name "In Progress" --type "active" --position 131072
./pcli list create --board <board-id> --name "Done" --type "closed" --position 196608

# 3. View the board with its lists
./pcli board get <board-id> --format table

# 4. Update a list color
./pcli list update <list-id> --color "lagoon-blue"

# 5. Clean up (optional)
./pcli list delete <list-id>

Notes

  • List types can be "active" or "closed"
  • Active lists are for ongoing work
  • Closed lists are for completed/archived items
  • Position determines the order of lists on the board (lower numbers appear first)
  • Colors must be one of the supported Planka list colors
  • Deleting a list moves its cards to a trash list (doesn't permanently delete cards)