## ADDED Requirements ### Requirement: Move card between lists The system SHALL provide a `card move` operation that updates a card's `listId` to move it to a different list. The operation SHALL accept an optional `position` to place the card at a specific position within the target list. The move operation SHALL be implemented as a `PATCH /cards/{id}` call with `listId` and optionally `position` fields. The CLI command SHALL be `pcli card move --list [--position N]`. #### Scenario: Move card to another list - **WHEN** `pcli card move --list ` is executed - **THEN** the system SHALL send `PATCH /cards/{id}` with `{"listId": ""}` - **AND** the system SHALL output the updated card with its new listId #### Scenario: Move card to specific position - **WHEN** `pcli card move --list --position 0` is executed - **THEN** the system SHALL send `PATCH /cards/{id}` with `{"listId": "", "position": 0}` - **AND** the card SHALL appear at the specified position in the target list #### Scenario: Move card missing list flag - **WHEN** `pcli card move ` is executed without `--list` - **THEN** the system SHALL print an error indicating `--list` is required and exit with code 1 ### Requirement: Duplicate card The system SHALL provide a `card duplicate` operation that creates a copy of an existing card. The operation SHALL call `POST /cards/{id}/duplicate`. The CLI command SHALL be `pcli card duplicate [--name ] [--position N]`. If `--name` is not provided, the API determines the name of the duplicate. #### Scenario: Duplicate card with defaults - **WHEN** `pcli card duplicate ` is executed - **THEN** the system SHALL send `POST /cards/{id}/duplicate` - **AND** the system SHALL output the newly created duplicate card #### Scenario: Duplicate card with custom name - **WHEN** `pcli card duplicate --name "Copy of task"` is executed - **THEN** the system SHALL send `POST /cards/{id}/duplicate` with `{"name": "Copy of task"}` - **AND** the duplicate card SHALL have the specified name ### Requirement: Assign and unassign card members The system SHALL provide `card assign` and `card unassign` operations to manage card memberships. `card assign` SHALL call `POST /cards/{cardId}/card-memberships` with the user ID. `card unassign` SHALL call `DELETE /cards/{cardId}/card-memberships/userId:{userId}`. #### Scenario: Assign user to card - **WHEN** `pcli card assign --user ` is executed - **THEN** the system SHALL send `POST /cards/{cardId}/card-memberships` with `{"userId": ""}` - **AND** the system SHALL output a success confirmation #### Scenario: Unassign user from card - **WHEN** `pcli card unassign --user ` is executed - **THEN** the system SHALL send `DELETE /cards/{cardId}/card-memberships/userId:{userId}` - **AND** the system SHALL output a success confirmation #### Scenario: Assign missing user flag - **WHEN** `pcli card assign ` is executed without `--user` - **THEN** the system SHALL print an error indicating `--user` is required and exit with code 1 ### Requirement: Add and remove card labels The system SHALL provide `card add-label` and `card remove-label` operations to manage labels on cards. `card add-label` SHALL call `POST /cards/{cardId}/card-labels` with the label ID. `card remove-label` SHALL call `DELETE /cards/{cardId}/card-labels/labelId:{labelId}`. #### Scenario: Add label to card - **WHEN** `pcli card add-label --label ` is executed - **THEN** the system SHALL send `POST /cards/{cardId}/card-labels` with `{"labelId": ""}` - **AND** the system SHALL output a success confirmation #### Scenario: Remove label from card - **WHEN** `pcli card remove-label --label ` is executed - **THEN** the system SHALL send `DELETE /cards/{cardId}/card-labels/labelId:{labelId}` - **AND** the system SHALL output a success confirmation #### Scenario: Add label missing label flag - **WHEN** `pcli card add-label ` is executed without `--label` - **THEN** the system SHALL print an error indicating `--label` is required and exit with code 1 ### Requirement: Enriched board-level card listing The system SHALL provide a `card list --board ` operation that returns all cards across all lists in a board, with each card enriched with the `listName` field. The operation SHALL: (1) call `GET /boards/{id}` to retrieve the board and its included lists, (2) call `GET /lists/{listId}/cards` for each list to retrieve cards (with pagination support), (3) inject `listName` into each card based on the list it belongs to. The `--limit` flag SHALL apply to the total number of cards returned across all lists. #### Scenario: List all cards on a board - **WHEN** `pcli card list --board ` is executed - **THEN** the system SHALL return all cards from all lists in the board - **AND** each card SHALL include a `listName` field with the name of its containing list - **AND** each card SHALL include a `listId` field #### Scenario: Board card listing with limit - **WHEN** `pcli card list --board --limit 10` is executed - **THEN** the system SHALL return at most 10 cards total across all lists - **AND** each card SHALL include the `listName` field #### Scenario: Board with no cards - **WHEN** `pcli card list --board ` is executed on a board with empty lists - **THEN** the system SHALL return an empty array #### Scenario: Board with multiple lists - **WHEN** a board has lists "To Do", "In Progress", and "Done" each containing cards - **THEN** the returned cards SHALL have `listName` set to the respective list name - **AND** cards from all lists SHALL be included in the result