Loading environment from: /Users/danielkobina/Workspace/karrio/patch/.env
CLI Guide
Usage:
1$ [OPTIONS] COMMAND [ARGS]...
Options:
--install-completion
: Install completion for the current shell.--show-completion
: Show completion for the current shell, to copy it or customize the installation.--help
: Show this message and exit.
Commands:
login
: Configure a connection to a Karrio instance.logout
: Remove the saved Karrio configuration.status
: Check the current login status and…carriers
: Manage carriers.connections
: Manage carrier connections.shipments
: Manage shipments.trackers
: Manage trackers.orders
: Manage orders.logs
: View API request logs.events
: View system events.sdk
: SDK-related commands.codegen
: Code generation utilities.plugins
: Manage plugins.agent
: Karrio AI agent.
login
Configure a connection to a Karrio instance.
Example:
1kcli login --host http://localhost:5002 --api-key your_api_key_here | jq '{message: "Login successful", host: .host}'
Usage:
1$ login [OPTIONS]
Options:
--host TEXT
: The URL of the Karrio instance [default: http://localhost:5002]--api-key TEXT
: Your Karrio API key [required]--help
: Show this message and exit.
logout
Remove the saved Karrio configuration.
Example:
1kcli logout | jq '{message: "Logout successful"}'
Usage:
1$ logout [OPTIONS]
Options:
--help
: Show this message and exit.
status
Check the current login status and connection to Karrio.
Example:
1kcli status | jq '{status: "Connected", host: .host, api_key: "********"}'
Usage:
1$ status [OPTIONS]
Options:
--help
: Show this message and exit.
carriers
Manage carriers.
Usage:
1$ carriers [OPTIONS] COMMAND [ARGS]...
Options:
--help
: Show this message and exit.
Commands:
list
: List all carriers.retrieve
: Retrieve a carrier by name.
carriers list
List all carriers.
Examples:
Get all carriers and display as a table1kcli carriers list | jq -r ".results[] | [.name, .display_name, .capabilities[]] | @tsv" | column -t -s $" "
Get carriers and extract specific fields1kcli carriers list | jq ".results[] | {name, display_name, capabilities}"
Example Output:
1{ 2 "count": 3, 3 "next": null, 4 "previous": null, 5 "results": [ 6 { 7 "name": "ups", 8 "display_name": "UPS", 9 "capabilities": ["rating", "shipping", "tracking"], 10 "services": { 11 "ups_standard": "11", 12 "ups_express": "01", 13 "ups_expedited": "02" 14 }, 15 "requirements": ["api_key", "password", "account_number"] 16 } 17 ] 18}
Usage:
1$ carriers list [OPTIONS]
Options:
-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
carriers retrieve
Retrieve a carrier by name.
Example:
1kcli carriers retrieve ups | jq "{name, display_name, capabilities, services: .services | length}"
Example Output:
1{ 2 "name": "ups", 3 "display_name": "UPS", 4 "capabilities": ["rating", "shipping", "tracking"], 5 "services": { 6 "ups_standard": "11", 7 "ups_express": "01", 8 "ups_expedited": "02", 9 "ups_express_plus": "14", 10 "ups_worldwide_express": "07", 11 "ups_worldwide_expedited": "08", 12 "ups_standard_international": "65" 13 }, 14 "requirements": ["api_key", "password", "account_number"], 15 "metadata": { 16 "test_mode_supported": true, 17 "multi_piece_supported": true 18 } 19}
Usage:
1$ carriers retrieve [OPTIONS] CARRIER_NAME
Arguments:
CARRIER_NAME
: [required]
Options:
-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
connections
Manage carrier connections.
Usage:
1$ connections [OPTIONS] COMMAND [ARGS]...
Options:
--help
: Show this message and exit.
Commands:
list
: List all carrier connections with optional…retrieve
: Retrieve a carrier connection by ID.create
: Create a new carrier connection.update
: Update a carrier connection by ID.delete
: Delete a carrier connection by ID.
connections list
List all carrier connections with optional filters and pagination.
Examples:
Get all connections and display as a table1kcli connections list | jq -r ".results[] | [.id, .carrier_name, .test_mode] | @tsv" | column -t -s $" "
Get connections for a specific carrier1kcli connections list --carrier-name ups | jq ".results[] | {id, carrier_name, test_mode}"
Example Output:
1{ 2 "count": 2, 3 "next": null, 4 "previous": null, 5 "results": [ 6 { 7 "id": "conn_123456789", 8 "carrier_name": "ups", 9 "test_mode": true, 10 "active": true, 11 "capabilities": ["rating", "shipping", "tracking"], 12 "metadata": {} 13 } 14 ] 15}
Usage:
1$ connections list [OPTIONS]
Options:
--carrier-name TEXT
--system-only
: Filter for system connections only--limit INTEGER
: Number of results to return per page [default: 20]--offset INTEGER
: The initial index from which to return the results [default: 0]-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
connections retrieve
Retrieve a carrier connection by ID.
Example:
1kcli connections retrieve conn_123456789 | jq "{id, carrier_name, test_mode, active}"
Example Output:
1{ 2 "id": "conn_123456789", 3 "carrier_name": "ups", 4 "test_mode": true, 5 "active": true, 6 "capabilities": ["rating", "shipping", "tracking"], 7 "credentials": { 8 "api_key": "YOUR_API_KEY", 9 "password": "YOUR_PASSWORD", 10 "account_number": "YOUR_ACCOUNT" 11 }, 12 "metadata": {} 13}
Usage:
1$ connections retrieve [OPTIONS] CONNECTION_ID
Arguments:
CONNECTION_ID
: [required]
Options:
-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
connections create
Create a new carrier connection.
Example:
1kcli connections create \ 2 -d carrier_name=ups \ 3 -d test_mode=true \ 4 -d credentials=YOUR_API_KEY \ 5 -d credentials=YOUR_PASSWORD \ 6 -d credentials=YOUR_ACCOUNT | jq "{id, carrier_name, test_mode}"
Example Output:
1{ 2 "id": "conn_123456789", 3 "carrier_name": "ups", 4 "test_mode": true, 5 "active": true, 6 "capabilities": ["rating", "shipping", "tracking"], 7 "credentials": { 8 "api_key": "YOUR_API_KEY", 9 "password": "YOUR_PASSWORD", 10 "account_number": "YOUR_ACCOUNT" 11 } 12}
Usage:
1$ connections create [OPTIONS]
Options:
-d, --property TEXT
: Set nested properties (e.g. -d carrier_name=ups -d credentials=xxx)-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
connections update
Update a carrier connection by ID.
Example:
1kcli connections update conn_123456789 \ 2 -d test_mode=false \ 3 -d credentials=NEW_API_KEY | jq "{id, carrier_name, test_mode}"
Example Output:
1{ 2 "id": "conn_123456789", 3 "carrier_name": "ups", 4 "test_mode": false, 5 "active": true, 6 "credentials": { 7 "api_key": "NEW_API_KEY", 8 "password": "YOUR_PASSWORD", 9 "account_number": "YOUR_ACCOUNT" 10 } 11}
Usage:
1$ connections update [OPTIONS] CONNECTION_ID
Arguments:
CONNECTION_ID
: [required]
Options:
-d, --property TEXT
: Set nested properties (e.g. -d credentials=newvalue)-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
connections delete
Delete a carrier connection by ID.
Example:
1kcli connections delete conn_123456789 | jq "{message: "Connection deleted successfully"}"
Example Output:
1{ 2 "message": "Connection deleted successfully" 3}
Usage:
1$ connections delete [OPTIONS] CONNECTION_ID
Arguments:
CONNECTION_ID
: [required]
Options:
-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
shipments
Manage shipments.
Usage:
1$ shipments [OPTIONS] COMMAND [ARGS]...
Options:
--help
: Show this message and exit.
Commands:
list
: List all shipments with optional filters…retrieve
: Retrieve a shipment by ID.buy-label
: Purchase a label for a shipment.cancel
: Cancel a shipment.fetch-rates
: Fetch rates for a shipment.
shipments list
List all shipments with optional filters and pagination.
Examples:
Get all shipments and display as a table1kcli shipments list --limit 10 | jq -r '.results[] | [.id, .status, .carrier_name, .tracking_number] | @tsv' | column -t -s $' '
Get pending shipments and extract specific fields1kcli shipments list --status pending --limit 5 | jq '.results[] | {id, status, carrier: .carrier_name, tracking: .tracking_number}'
Usage:
1$ shipments list [OPTIONS]
Options:
--address TEXT
--carrier-name TEXT
--created-after [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]
--created-before [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]
--has-manifest / --no-has-manifest
--has-tracker / --no-has-tracker
--id TEXT
--keyword TEXT
--meta-key TEXT
--meta-value TEXT
--metadata-key TEXT
--metadata-value TEXT
--option-key TEXT
--option-value TEXT
--reference TEXT
--service TEXT
--status TEXT
--tracking-number TEXT
--limit INTEGER
: Number of results to return per page [default: 20]--offset INTEGER
: The initial index from which to return the results [default: 0]-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
shipments retrieve
Retrieve a shipment by ID.
Example:
1kcli shipments retrieve shp_123456789 | jq '{id, status, carrier: .carrier_name, tracking: .tracking_number, created: .created_at}'
Usage:
1$ shipments retrieve [OPTIONS] SHIPMENT_ID
Arguments:
SHIPMENT_ID
: [required]
Options:
-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
shipments buy-label
Purchase a label for a shipment.
Example:
1kcli shipments buy-label shp_123456789 --selected-rate-id rate_987654321 --label-type PDF -d payment=sender -d payment=USD -d reference=order_12345 -d metadata=cust_9876 | jq '{id, status, label: .label_url, tracking: .tracking_number}'
Usage:
1$ shipments buy-label [OPTIONS] SHIPMENT_ID
Arguments:
SHIPMENT_ID
: [required]
Options:
--selected-rate-id TEXT
: The ID of the selected rate [required]--label-type TEXT
: The type of label to generate [default: PDF]-d, --property TEXT
: Set nested properties (e.g. -d payment=sender)-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
shipments cancel
Cancel a shipment.
Example:
1kcli shipments cancel shp_123456789 | jq '{id, status, message: .cancellation.message}'
Usage:
1$ shipments cancel [OPTIONS] SHIPMENT_ID
Arguments:
SHIPMENT_ID
: [required]
Options:
-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
shipments fetch-rates
Fetch rates for a shipment.
Example:
1kcli shipments fetch-rates shp_123456789 | jq '.[] | {carrier: .carrier_name, service: .service, total_charge: .total_charge}'
Usage:
1$ shipments fetch-rates [OPTIONS] SHIPMENT_ID
Arguments:
SHIPMENT_ID
: [required]
Options:
-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
trackers
Manage trackers.
Usage:
1$ trackers [OPTIONS] COMMAND [ARGS]...
Options:
--help
: Show this message and exit.
Commands:
list
: List all trackers with optional filters…retrieve
: Retrieve a tracker by ID.create
: Create a new tracker.update
: Update an existing tracker.delete
: Delete a tracker.
trackers list
List all trackers with optional filters and pagination.
Examples:
Get all trackers and display as a table1kcli trackers list --limit 10 | jq -r ".results[] | [.id, .tracking_number, .carrier_name, .status] | @tsv" | column -t -s $" "
Get in-transit trackers and extract specific fields1kcli trackers list --status in_transit --limit 5 | jq ".results[] | {id, tracking: .tracking_number, carrier: .carrier_name, status}"
Example Output:
1{ 2 "count": 10, 3 "next": "/v1/trackers?limit=10&offset=10", 4 "previous": null, 5 "results": [ 6 { 7 "id": "trk_123456789", 8 "tracking_number": "1Z999AA1234567890", 9 "carrier_name": "ups", 10 "status": "in_transit", 11 "created_at": "2024-03-20T10:30:00Z", 12 "events": [ 13 { 14 "date": "2024-03-20T10:30:00Z", 15 "description": "Package picked up", 16 "location": "San Francisco, CA", 17 "code": "PU" 18 } 19 ], 20 "metadata": {} 21 } 22 ] 23}
Usage:
1$ trackers list [OPTIONS]
Options:
--carrier-name TEXT
--tracking-number TEXT
--status TEXT
--created-after [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]
--created-before [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]
--limit INTEGER
: Number of results to return per page [default: 20]--offset INTEGER
: The initial index from which to return the results [default: 0]-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
trackers retrieve
Retrieve a tracker by ID.
Example:
1kcli trackers retrieve trk_123456789 | jq "{id, tracking: .tracking_number, carrier: .carrier_name, status, last_event: .events[-1].description}"
Example Output:
1{ 2 "id": "trk_123456789", 3 "tracking_number": "1Z999AA1234567890", 4 "carrier_name": "ups", 5 "status": "delivered", 6 "created_at": "2024-03-19T15:45:00Z", 7 "events": [ 8 { 9 "date": "2024-03-20T14:30:00Z", 10 "description": "Package delivered", 11 "location": "New York, NY", 12 "code": "DL" 13 } 14 ], 15 "metadata": { 16 "order_id": "ORD12345" 17 } 18}
Usage:
1$ trackers retrieve [OPTIONS] TRACKER_ID
Arguments:
TRACKER_ID
: [required]
Options:
-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
trackers create
Create a new tracker.
Example:
1kcli trackers create --tracking-number 1Z999AA1234567890 --carrier-name ups \ 2 -d info="John Doe" \ 3 -d info=ORD12345 \ 4 -d metadata=website | jq "{id, tracking: .tracking_number, carrier: .carrier_name, status}"
Example Output:
1{ 2 "id": "trk_123456789", 3 "tracking_number": "1Z999AA1234567890", 4 "carrier_name": "ups", 5 "status": "unknown", 6 "created_at": "2024-03-20T10:30:00Z", 7 "info": { 8 "customer_name": "John Doe", 9 "order_id": "ORD12345" 10 }, 11 "metadata": { 12 "source": "website" 13 } 14}
Usage:
1$ trackers create [OPTIONS]
Options:
--tracking-number TEXT
: The tracking number [required]--carrier-name TEXT
: The carrier name [required]--account-number TEXT
: The account number--reference TEXT
: A reference for the tracker-d, --property TEXT
: Set nested properties (e.g. -d info=John Doe)-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
trackers update
Update an existing tracker.
Example:
1kcli trackers update trk_123456789 \ 2 -d info="Package delayed" \ 3 -d metadata=delayed | jq "{id, tracking: .tracking_number, status, note: .info.note}"
Example Output:
1{ 2 "id": "trk_123456789", 3 "tracking_number": "1Z999AA1234567890", 4 "status": "in_transit", 5 "info": { 6 "note": "Package delayed" 7 }, 8 "metadata": { 9 "status": "delayed" 10 } 11}
Usage:
1$ trackers update [OPTIONS] TRACKER_ID
Arguments:
TRACKER_ID
: [required]
Options:
-d, --property TEXT
: Set nested properties (e.g. -d info=John Doe)-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
trackers delete
Delete a tracker.
Example:
1kcli trackers delete trk_123456789 | jq "{message: "Tracker deleted successfully"}"
Example Output:
1{ 2 "message": "Tracker deleted successfully" 3}
Usage:
1$ trackers delete [OPTIONS] TRACKER_ID
Arguments:
TRACKER_ID
: [required]
Options:
-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
orders
Manage orders.
Usage:
1$ orders [OPTIONS] COMMAND [ARGS]...
Options:
--help
: Show this message and exit.
Commands:
list
: List all orders with optional filters and…retrieve
: Retrieve an order by ID.cancel
: Cancel an order.
orders list
List all orders with optional filters and pagination.
Examples:
Get all orders and display as a table1kcli orders list --limit 15 | jq -r ".results[] | [.id, .status, .created_at, .total_charge.amount] | @tsv" | column -t -s $" "
Get pending orders and extract specific fields1kcli orders list --status pending --limit 5 | jq ".results[] | {id, status, created: .created_at, total: .total_charge.amount}"
Example Output:
1{ 2 "count": 15, 3 "next": "/v1/orders?limit=15&offset=15", 4 "previous": null, 5 "results": [ 6 { 7 "id": "ord_123456789", 8 "status": "pending", 9 "created_at": "2024-03-20T10:30:00Z", 10 "total_charge": { 11 "amount": 25.50, 12 "currency": "USD" 13 }, 14 "line_items": [], 15 "metadata": {} 16 } 17 ] 18}
Usage:
1$ orders list [OPTIONS]
Options:
--created-after [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]
--created-before [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]
--status TEXT
--reference TEXT
--metadata-key TEXT
--metadata-value TEXT
--limit INTEGER
: Number of results to return per page [default: 20]--offset INTEGER
: The initial index from which to return the results [default: 0]-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
orders retrieve
Retrieve an order by ID.
Example:
1kcli orders retrieve ord_987654321 | jq "{id, status, created: .created_at, total: .total_charge.amount, items: .line_items | length}"
Usage:
1$ orders retrieve [OPTIONS] ORDER_ID
Arguments:
ORDER_ID
: [required]
Options:
-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
orders cancel
Cancel an order.
Example:
1kcli orders cancel ord_987654321 -d reason=customer_request | jq "{id, status, cancel_reason: .cancellation.reason}"
Usage:
1$ orders cancel [OPTIONS] ORDER_ID
Arguments:
ORDER_ID
: [required]
Options:
-d, --property TEXT
: Set nested properties (e.g. -d reason=customer_request)-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
logs
View API request logs.
Usage:
1$ logs [OPTIONS] COMMAND [ARGS]...
Options:
--help
: Show this message and exit.
Commands:
list
: List all logs with optional filters and…retrieve
: Retrieve a log by ID.
logs list
List all logs with optional filters and pagination.
Examples:
Get all logs and display as a table1kcli logs list --limit 10 | jq -r ".logs.edges[].node | [.id, .method, .status_code, .path] | @tsv" | column -t -s $" "
Get logs for a specific entity1kcli logs list --entity-id shp_123456789 --limit 5 | jq ".logs.edges[].node | {id, method, status_code, path}"
Example Output:
1{ 2 "logs": { 3 "edges": [ 4 { 5 "node": { 6 "id": "123", 7 "method": "POST", 8 "status_code": 200, 9 "path": "/v1/shipments", 10 "request": { 11 "headers": {}, 12 "body": {} 13 }, 14 "response": { 15 "headers": {}, 16 "body": {} 17 }, 18 "response_ms": 245, 19 "requested_at": "2024-03-20T10:30:00Z" 20 } 21 } 22 ], 23 "pageInfo": { 24 "hasNextPage": true, 25 "hasPreviousPage": false, 26 "startCursor": "YXJyYXljb25uZWN0aW9uOjA=", 27 "endCursor": "YXJyYXljb25uZWN0aW9uOjk=" 28 } 29 } 30}
Usage:
1$ logs list [OPTIONS]
Options:
--entity-id TEXT
--method TEXT
--status-code TEXT
--created-after [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]
--created-before [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]
--limit INTEGER
: Number of results to return per page [default: 20]--offset INTEGER
: The initial index from which to return the results [default: 0]-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
logs retrieve
Retrieve a log by ID.
Example:
1kcli logs retrieve 123 | jq "{id, method, status_code, path, response_ms, requested_at}"
Example Output:
1{ 2 "log": { 3 "id": "123", 4 "method": "POST", 5 "status_code": 200, 6 "path": "/v1/shipments", 7 "request": { 8 "headers": { 9 "Content-Type": "application/json", 10 "Authorization": "Token <redacted>" 11 }, 12 "body": { 13 "shipment_id": "shp_123456789" 14 } 15 }, 16 "response": { 17 "headers": { 18 "Content-Type": "application/json" 19 }, 20 "body": { 21 "id": "shp_123456789", 22 "status": "created" 23 } 24 }, 25 "response_ms": 245, 26 "requested_at": "2024-03-20T10:30:00Z" 27 } 28}
Usage:
1$ logs retrieve [OPTIONS] LOG_ID
Arguments:
LOG_ID
: [required]
Options:
-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
events
View system events.
Usage:
1$ events [OPTIONS] COMMAND [ARGS]...
Options:
--help
: Show this message and exit.
Commands:
list
: List all events with optional filters and…retrieve
: Retrieve an event by ID.
events list
List all events with optional filters and pagination.
Examples:
Get all events and display as a table1kcli events list --limit 10 | jq -r ".events.edges[].node | [.id, .type, .created_at] | @tsv" | column -t -s $" "
Get events of a specific type1kcli events list --type shipment_purchased --limit 5 | jq ".events.edges[].node | {id, type, created_at, data}"
Example Output:
1{ 2 "events": { 3 "edges": [ 4 { 5 "node": { 6 "id": "evt_123456789", 7 "type": "shipment_purchased", 8 "data": { 9 "shipment_id": "shp_123456789", 10 "status": "purchased" 11 }, 12 "test_mode": false, 13 "pending_webhooks": 0, 14 "created_at": "2024-03-20T10:30:00Z" 15 } 16 } 17 ], 18 "page_info": { 19 "count": 1, 20 "has_next_page": false, 21 "has_previous_page": false, 22 "start_cursor": "YXJyYXljb25uZWN0aW9uOjA=", 23 "end_cursor": "YXJyYXljb25uZWN0aW9uOjA=" 24 } 25 } 26}
Usage:
1$ events list [OPTIONS]
Options:
--type TEXT
: Event type (e.g. shipment_created, order_created, tracker_created)--created-after [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]
--created-before [%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]
--limit INTEGER
: Number of results to return per page [default: 20]--offset INTEGER
: The initial index from which to return the results [default: 0]-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
events retrieve
Retrieve an event by ID.
Example:
1kcli events retrieve evt_123456789 | jq "{id, type, created_at, data}"
Example Output:
1{ 2 "event": { 3 "id": "evt_123456789", 4 "type": "shipment_purchased", 5 "data": { 6 "shipment_id": "shp_123456789", 7 "status": "purchased" 8 }, 9 "test_mode": false, 10 "pending_webhooks": 0, 11 "created_at": "2024-03-20T10:30:00Z" 12 } 13}
Usage:
1$ events retrieve [OPTIONS] EVENT_ID
Arguments:
EVENT_ID
: [required]
Options:
-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
sdk
SDK-related commands.
Usage:
1$ sdk [OPTIONS] COMMAND [ARGS]...
Options:
--help
: Show this message and exit.
Commands:
add-extension
add-features
sdk add-extension
Usage:
1$ sdk add-extension [OPTIONS]
Options:
-p, --path TEXT
: Path where the extension will be created [required]--carrier-slug TEXT
: The unique identifier for the carrier (e.g., dhl_express, ups, fedex, canadapost) [required]--display-name TEXT
: The human-readable name for the carrier (e.g., DHL, UPS, FedEx, Canada Post) [required]--features TEXT
: [default: tracking, rating, shipping]--version TEXT
: [default: 2025.6]--is-xml-api / --no-is-xml-api
: [default: no-is-xml-api]--help
: Show this message and exit.
sdk add-features
Usage:
1$ sdk add-features [OPTIONS]
Options:
--carrier-slug TEXT
: The unique identifier for the carrier (e.g., dhl_express, ups, fedex, canadapost) [required]--display-name TEXT
: The human-readable name for the carrier (e.g., DHL, UPS, FedEx, Canada Post) [required]--features TEXT
: [default: tracking, rating, shipping]--is-xml-api / --no-is-xml-api
: [default: no-is-xml-api]-p, --path TEXT
: Path where the features will be created [required]--help
: Show this message and exit.
codegen
Code generation utilities.
Usage:
1$ codegen [OPTIONS] COMMAND [ARGS]...
Options:
--help
: Show this message and exit.
Commands:
transform
: Transform Python code generated by…generate
: Generate Python code with jstruct from a…create-tree
: Generate a Python code tree from a class…
codegen transform
Transform Python code generated by quicktype (using dataclasses) into code that uses attrs and jstruct decorators.
Usage:
1$ codegen transform [OPTIONS] [INPUT_FILE] [OUTPUT_FILE]
Arguments:
[INPUT_FILE]
: Input file path. If not provided, reads from stdin.[OUTPUT_FILE]
: Output file path. If not provided, writes to stdout.
Options:
--append-type-suffix / --no-append-type-suffix
: Append ‘Type’ to class names [default: append-type-suffix]--help
: Show this message and exit.
codegen generate
Generate Python code with jstruct from a JSON schema file using quicktype.
Usage:
1$ codegen generate [OPTIONS] INPUT_FILE [OUTPUT_FILE]
Arguments:
INPUT_FILE
: Input JSON schema file path [required][OUTPUT_FILE]
: Output Python file path. If not provided, writes to stdout.
Options:
--python-version TEXT
: Python version to target [default: 3.11]--just-types / --no-just-types
: Generate just the type definitions without serialization code [default: just-types]--append-type-suffix / --no-append-type-suffix
: Append ‘Type’ to class names [default: append-type-suffix]--nice-property-names / --no-nice-property-names
: Use nice property names [default: no-nice-property-names]--help
: Show this message and exit.
codegen create-tree
Generate a Python code tree from a class definition.
This command imports a class from a specified module and generates a Python code snippet that shows how to construct an instance of that class with all its nested properties.
Usage:
1$ codegen create-tree [OPTIONS]
Options:
--module TEXT
: Module containing the class [required]--class-name TEXT
: Class name to generate a tree for [required]--module-alias TEXT
: Optional alias for the module in the output--help
: Show this message and exit.
plugins
Manage plugins.
Usage:
1$ plugins [OPTIONS] COMMAND [ARGS]...
Options:
--help
: Show this message and exit.
Commands:
list
: List all plugins with short description…show
: Show full details for a plugin by ID.enable
: Enable a plugin by updating the Django…disable
: Disable a plugin by updating the Django…
plugins list
List all plugins with short description and active status.
Examples:
Get all plugins and display as a table (default)1kcli plugins list
Get plugins in JSON format1kcli plugins list --pretty | jq ".[] | {id, label, status, enabled}"
Example Output:
1[ 2 { 3 "id": "plugin_id", 4 "label": "Plugin Name", 5 "status": "active", 6 "enabled": true, 7 "description": "A brief description of the plugin functionality" 8 } 9]
Usage:
1$ plugins list [OPTIONS]
Options:
-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
plugins show
Show full details for a plugin by ID.
Example:
1kcli plugins show plugin_id --pretty | jq "{id, label, description, status, enabled}"
Example Output:
1{ 2 "id": "plugin_id", 3 "label": "Plugin Name", 4 "description": "A detailed description of the plugin functionality", 5 "status": "active", 6 "enabled": true, 7 "version": "1.0.0", 8 "author": "Plugin Author", 9 "website": "https://plugin-website.com", 10 "dependencies": { 11 "python": ">=3.8", 12 "karrio": ">=2024.12" 13 } 14}
Usage:
1$ plugins show [OPTIONS] PLUGIN_ID
Arguments:
PLUGIN_ID
: [required]
Options:
-p, --pretty
: Pretty print the output-n, --line-numbers
: Show line numbers in pretty print--help
: Show this message and exit.
plugins enable
Enable a plugin by updating the Django Constance env var associated.
Example:
1kcli plugins enable plugin_id
Example Output:
1Plugin 'plugin_id' enabled.
Usage:
1$ plugins enable [OPTIONS] PLUGIN_ID
Arguments:
PLUGIN_ID
: [required]
Options:
--help
: Show this message and exit.
plugins disable
Disable a plugin by updating the Django Constance env var associated.
Example:
1kcli plugins disable plugin_id
Example Output:
1Plugin 'plugin_id' disabled.
Usage:
1$ plugins disable [OPTIONS] PLUGIN_ID
Arguments:
PLUGIN_ID
: [required]
Options:
--help
: Show this message and exit.
agent
Karrio AI agent.
Usage:
1$ agent [OPTIONS] COMMAND [ARGS]...
Options:
--help
: Show this message and exit.
Commands:
web
: Launches the Karrio AI agent web UI.
agent web
Launches the Karrio AI agent web UI.
This function loads environment variables, and then uses the adk
command-line
tool to start the agent’s web UI.
Usage:
1$ agent web [OPTIONS]
Options:
--help
: Show this message and exit.