Add comprehensive CLI commands to mirror Krónan Public API#4
Merged
Conversation
New commands added: CATEGORIES: - kronan categories List all categories with hierarchy - kronan category <slug> Browse products by category ORDER MODIFICATIONS: - kronan order delete-lines <token> <lineIds...> - kronan order lower-quantity <token> <lineIds...> --quantity N - kronan order toggle-substitution <token> <lineIds...> PRODUCT LISTS (full CRUD): - kronan lists create <name> [--description ...] - kronan lists view <token> - kronan lists delete <token> [--force] - kronan lists add <list-token> <sku> [qty] - kronan lists remove <list-token> <sku> - kronan lists clear <token> [--force] SHOPPING NOTES (Skundalisti): - kronan notes View shopping note - kronan notes add [--text ...] [--sku SKU] [--quantity N] - kronan notes update <line-token> [--text ...] [--quantity N] - kronan notes remove <line-token> - kronan notes toggle <line-token> - kronan notes clear [--force] - kronan notes archived View completed items PURCHASE STATISTICS: - kronan stats [--limit N] [--offset N] [--include-ignored] - kronan stats ignore <id> - kronan stats unignore <id> Also fixed: - getMe() response handling (object vs array) - getShoppingNote() response handling - Stats command flag parsing The CLI now mirrors the Krónan Public API comprehensively.
Added documentation for all new commands: - Categories (browse by category hierarchy) - Order modifications (delete-lines, lower-quantity, toggle-substitution) - Product Lists (full CRUD: create, view, delete, add/remove items, clear) - Shopping Notes (full CRUD for Skundalisti/Scan and Go) - Purchase Statistics (view history, ignore/unignore products) Also updated: - Version to 0.3.0 - Enhanced AI agent usage examples - Complete API endpoint reference table - Added version history section
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive CLI commands to fully mirror the Krónan Public API, building on the previous API migration.
New Commands Added
📁 Categories
Browse products by category hierarchy:
📝 Order Modifications
Modify active orders before they're fulfilled:
📋 Product Lists (Full CRUD)
Manage saved product collections:
✅ Shopping Notes (Skundalisti)
Manage freeform shopping lists for Scan and Go:
📊 Purchase Statistics
View purchase history and frequency data:
New Files
src/commands/categories.ts- Category browsingsrc/commands/orders-modify.ts- Order modificationssrc/commands/product-lists.ts- Full product list CRUDsrc/commands/shopping-notes.ts- Shopping notes managementsrc/commands/purchase-stats.ts- Purchase statisticsBug Fixes
getMe()to handle both object and array responses from APIgetShoppingNote()to handle both object and array responsesAPI Coverage
Testing
All commands tested and working:
The CLI now comprehensively covers all functionality available in the Krónan Public API.