chatbase 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -115,7 +115,7 @@ EXAMPLES
115
115
  $ chatbase agents auto-retrain --enabled
116
116
  ```
117
117
 
118
- _See code: [src/commands/agents/auto-retrain.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/agents/auto-retrain.ts)_
118
+ _See code: [src/commands/agents/auto-retrain.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/agents/auto-retrain.ts)_
119
119
 
120
120
  ## `chatbase agents clone AGENTID`
121
121
 
@@ -145,7 +145,7 @@ EXAMPLES
145
145
  $ chatbase agents clone agt_123
146
146
  ```
147
147
 
148
- _See code: [src/commands/agents/clone.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/agents/clone.ts)_
148
+ _See code: [src/commands/agents/clone.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/agents/clone.ts)_
149
149
 
150
150
  ## `chatbase agents create`
151
151
 
@@ -180,7 +180,7 @@ EXAMPLES
180
180
  $ chatbase agents create --data @agent.json
181
181
  ```
182
182
 
183
- _See code: [src/commands/agents/create.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/agents/create.ts)_
183
+ _See code: [src/commands/agents/create.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/agents/create.ts)_
184
184
 
185
185
  ## `chatbase agents delete AGENTID`
186
186
 
@@ -211,7 +211,7 @@ EXAMPLES
211
211
  $ chatbase agents delete agt_123 --confirm agt_123
212
212
  ```
213
213
 
214
- _See code: [src/commands/agents/delete.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/agents/delete.ts)_
214
+ _See code: [src/commands/agents/delete.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/agents/delete.ts)_
215
215
 
216
216
  ## `chatbase agents get [AGENTID]`
217
217
 
@@ -246,7 +246,7 @@ EXAMPLES
246
246
  $ chatbase agents get
247
247
  ```
248
248
 
249
- _See code: [src/commands/agents/get.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/agents/get.ts)_
249
+ _See code: [src/commands/agents/get.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/agents/get.ts)_
250
250
 
251
251
  ## `chatbase agents list`
252
252
 
@@ -279,7 +279,7 @@ EXAMPLES
279
279
  $ chatbase agents list --json
280
280
  ```
281
281
 
282
- _See code: [src/commands/agents/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/agents/list.ts)_
282
+ _See code: [src/commands/agents/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/agents/list.ts)_
283
283
 
284
284
  ## `chatbase agents styles [AGENTID]`
285
285
 
@@ -316,7 +316,7 @@ EXAMPLES
316
316
  $ chatbase agents styles --data @styles.json
317
317
  ```
318
318
 
319
- _See code: [src/commands/agents/styles.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/agents/styles.ts)_
319
+ _See code: [src/commands/agents/styles.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/agents/styles.ts)_
320
320
 
321
321
  ## `chatbase agents train [AGENTID]`
322
322
 
@@ -351,7 +351,7 @@ EXAMPLES
351
351
  $ chatbase agents train
352
352
  ```
353
353
 
354
- _See code: [src/commands/agents/train.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/agents/train.ts)_
354
+ _See code: [src/commands/agents/train.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/agents/train.ts)_
355
355
 
356
356
  ## `chatbase agents update [AGENTID]`
357
357
 
@@ -393,7 +393,7 @@ EXAMPLES
393
393
  $ chatbase agents update agt_123 --data @agent.json
394
394
  ```
395
395
 
396
- _See code: [src/commands/agents/update.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/agents/update.ts)_
396
+ _See code: [src/commands/agents/update.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/agents/update.ts)_
397
397
 
398
398
  ## `chatbase api METHOD PATH`
399
399
 
@@ -434,7 +434,7 @@ EXAMPLES
434
434
  $ chatbase api PATCH /agents/agt_123 --body @patch.json
435
435
  ```
436
436
 
437
- _See code: [src/commands/api.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/api.ts)_
437
+ _See code: [src/commands/api.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/api.ts)_
438
438
 
439
439
  ## `chatbase auth login`
440
440
 
@@ -467,7 +467,7 @@ EXAMPLES
467
467
  cat key.txt | chatbase auth login --with-token
468
468
  ```
469
469
 
470
- _See code: [src/commands/auth/login.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/auth/login.ts)_
470
+ _See code: [src/commands/auth/login.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/auth/login.ts)_
471
471
 
472
472
  ## `chatbase auth logout`
473
473
 
@@ -494,7 +494,7 @@ EXAMPLES
494
494
  $ chatbase auth logout
495
495
  ```
496
496
 
497
- _See code: [src/commands/auth/logout.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/auth/logout.ts)_
497
+ _See code: [src/commands/auth/logout.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/auth/logout.ts)_
498
498
 
499
499
  ## `chatbase auth status`
500
500
 
@@ -521,7 +521,7 @@ EXAMPLES
521
521
  $ chatbase auth status
522
522
  ```
523
523
 
524
- _See code: [src/commands/auth/status.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/auth/status.ts)_
524
+ _See code: [src/commands/auth/status.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/auth/status.ts)_
525
525
 
526
526
  ## `chatbase chat`
527
527
 
@@ -563,7 +563,7 @@ EXAMPLES
563
563
  $ chatbase chat -a agt_123 -m "hi" --json
564
564
  ```
565
565
 
566
- _See code: [src/commands/chat/index.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/chat/index.ts)_
566
+ _See code: [src/commands/chat/index.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/chat/index.ts)_
567
567
 
568
568
  ## `chatbase chat retry`
569
569
 
@@ -598,7 +598,7 @@ EXAMPLES
598
598
  $ chatbase chat retry --conversation c_123 -a agt_123 --message-id msg_456 --no-stream
599
599
  ```
600
600
 
601
- _See code: [src/commands/chat/retry.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/chat/retry.ts)_
601
+ _See code: [src/commands/chat/retry.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/chat/retry.ts)_
602
602
 
603
603
  ## `chatbase config get KEY`
604
604
 
@@ -630,7 +630,7 @@ EXAMPLES
630
630
  $ chatbase config get timeout
631
631
  ```
632
632
 
633
- _See code: [src/commands/config/get.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/config/get.ts)_
633
+ _See code: [src/commands/config/get.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/config/get.ts)_
634
634
 
635
635
  ## `chatbase config list`
636
636
 
@@ -657,7 +657,7 @@ EXAMPLES
657
657
  $ chatbase config list
658
658
  ```
659
659
 
660
- _See code: [src/commands/config/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/config/list.ts)_
660
+ _See code: [src/commands/config/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/config/list.ts)_
661
661
 
662
662
  ## `chatbase config set KEY [VALUE]`
663
663
 
@@ -692,7 +692,7 @@ EXAMPLES
692
692
  $ chatbase config set timeout 60000
693
693
  ```
694
694
 
695
- _See code: [src/commands/config/set.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/config/set.ts)_
695
+ _See code: [src/commands/config/set.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/config/set.ts)_
696
696
 
697
697
  ## `chatbase conversations export`
698
698
 
@@ -701,19 +701,28 @@ Export conversations from every source, with full message history
701
701
  ```
702
702
  USAGE
703
703
  $ chatbase conversations export [--json] [--plain] [-q] [--verbose] [--no-input] [--no-color] [--agent-name <value> | -a
704
- <value>] [--cursor <value>] [--limit <value>] [--all] [-o <value>]
704
+ <value>] [--cursor <value>] [--limit <value>] [--all] [-o <value>] [--start-date <value>] [--end-date <value>]
705
+ [--conversation <value>] [--include summary|messages] [--source <value>]
705
706
 
706
707
  FLAGS
707
- -a, --agent=<value> Agent ID (or set CHATBASE_AGENT_ID)
708
- -o, --output=<value> Write export JSON to a file instead of stdout
709
- -q, --quiet Suppress non-essential output
710
- --agent-name=<value> Agent display name (looked up to an ID)
711
- --all Fetch every page
712
- --cursor=<value> Opaque cursor from a previous response
713
- --limit=<value> Items per page (1-20, default 20)
714
- --no-color Disable colored output
715
- --no-input Never prompt; fail instead
716
- --verbose Verbose diagnostics
708
+ -a, --agent=<value> Agent ID (or set CHATBASE_AGENT_ID)
709
+ -o, --output=<value> Write export JSON to a file instead of stdout
710
+ -q, --quiet Suppress non-essential output
711
+ --agent-name=<value> Agent display name (looked up to an ID)
712
+ --all Fetch every page
713
+ --conversation=<value> Export only this conversation ID, from any source (widget, API, WhatsApp, …)
714
+ --cursor=<value> Opaque cursor from a previous response
715
+ --end-date=<value> Only conversations created at or before this YYYY-MM-DD date (inclusive) or ISO 8601
716
+ date-time
717
+ --include=<option> Whether to embed message bodies; summary omits them for a cheaper triage pass
718
+ <options: summary|messages>
719
+ --limit=<value> Items per page (1-20, default 20)
720
+ --no-color Disable colored output
721
+ --no-input Never prompt; fail instead
722
+ --source=<value> Restrict to these conversation sources (comma-separated, e.g. "Widget or
723
+ Iframe,WhatsApp"). Omit for all sources
724
+ --start-date=<value> Only conversations created at or after this YYYY-MM-DD date or ISO 8601 date-time
725
+ --verbose Verbose diagnostics
717
726
 
718
727
  OUTPUT FLAGS
719
728
  --json Output raw API JSON
@@ -734,9 +743,15 @@ EXAMPLES
734
743
  $ chatbase conversations export -a agt_123
735
744
 
736
745
  $ chatbase conversations export -a agt_123 --all -o export.json
746
+
747
+ $ chatbase conversations export -a agt_123 --start-date 2024-01-01 --end-date 2024-01-31
748
+
749
+ $ chatbase conversations export -a agt_123 --include summary --source Widget,WhatsApp
750
+
751
+ $ chatbase conversations export -a agt_123 --conversation conv_123
737
752
  ```
738
753
 
739
- _See code: [src/commands/conversations/export.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/conversations/export.ts)_
754
+ _See code: [src/commands/conversations/export.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/conversations/export.ts)_
740
755
 
741
756
  ## `chatbase conversations get [CONVERSATIONID]`
742
757
 
@@ -772,7 +787,7 @@ EXAMPLES
772
787
  $ chatbase conversations get --conversation conv_123 -a agt_123
773
788
  ```
774
789
 
775
- _See code: [src/commands/conversations/get.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/conversations/get.ts)_
790
+ _See code: [src/commands/conversations/get.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/conversations/get.ts)_
776
791
 
777
792
  ## `chatbase conversations list`
778
793
 
@@ -781,7 +796,7 @@ List an agent’s API-created conversations
781
796
  ```
782
797
  USAGE
783
798
  $ chatbase conversations list [--json] [--plain] [-q] [--verbose] [--no-input] [--no-color] [--agent-name <value> | -a
784
- <value>] [--limit <value>] [--cursor <value>] [--all] [--user <value>]
799
+ <value>] [--limit <value>] [--cursor <value>] [--all] [--user <value>] [--start-date <value>] [--end-date <value>]
785
800
 
786
801
  FLAGS
787
802
  -a, --agent=<value> Agent ID (or set CHATBASE_AGENT_ID)
@@ -789,9 +804,12 @@ FLAGS
789
804
  --agent-name=<value> Agent display name (looked up to an ID)
790
805
  --all Fetch every page
791
806
  --cursor=<value> Pagination cursor from a previous page
807
+ --end-date=<value> Only conversations created at or before this YYYY-MM-DD date (inclusive) or ISO 8601
808
+ date-time
792
809
  --limit=<value> Maximum items per page
793
810
  --no-color Disable colored output
794
811
  --no-input Never prompt; fail instead
812
+ --start-date=<value> Only conversations created at or after this YYYY-MM-DD date or ISO 8601 date-time
795
813
  --user=<value> List conversations for a specific user (uses GET /users/{userId}/conversations)
796
814
  --verbose Verbose diagnostics
797
815
 
@@ -815,10 +833,12 @@ EXAMPLES
815
833
 
816
834
  $ chatbase conversations list -a agt_123 --user usr_456
817
835
 
836
+ $ chatbase conversations list -a agt_123 --start-date 2024-01-01 --end-date 2024-01-31
837
+
818
838
  $ chatbase conversations list -a agt_123 --all --json
819
839
  ```
820
840
 
821
- _See code: [src/commands/conversations/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/conversations/list.ts)_
841
+ _See code: [src/commands/conversations/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/conversations/list.ts)_
822
842
 
823
843
  ## `chatbase conversations tool-result [CONVERSATIONID]`
824
844
 
@@ -862,7 +882,7 @@ EXAMPLES
862
882
  $ chatbase conversations tool-result conv_123 --tool-call-id tc_1 -a agt_123
863
883
  ```
864
884
 
865
- _See code: [src/commands/conversations/tool-result.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/conversations/tool-result.ts)_
885
+ _See code: [src/commands/conversations/tool-result.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/conversations/tool-result.ts)_
866
886
 
867
887
  ## `chatbase health`
868
888
 
@@ -891,7 +911,7 @@ EXAMPLES
891
911
  $ chatbase health --json
892
912
  ```
893
913
 
894
- _See code: [src/commands/health.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/health.ts)_
914
+ _See code: [src/commands/health.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/health.ts)_
895
915
 
896
916
  ## `chatbase help [COMMAND]`
897
917
 
@@ -941,7 +961,7 @@ EXAMPLES
941
961
  $ chatbase helpdesk statuses -a agt_123
942
962
  ```
943
963
 
944
- _See code: [src/commands/helpdesk/statuses.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/helpdesk/statuses.ts)_
964
+ _See code: [src/commands/helpdesk/statuses.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/helpdesk/statuses.ts)_
945
965
 
946
966
  ## `chatbase helpdesk teams`
947
967
 
@@ -971,7 +991,7 @@ EXAMPLES
971
991
  $ chatbase helpdesk teams -a agt_123
972
992
  ```
973
993
 
974
- _See code: [src/commands/helpdesk/teams.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/helpdesk/teams.ts)_
994
+ _See code: [src/commands/helpdesk/teams.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/helpdesk/teams.ts)_
975
995
 
976
996
  ## `chatbase messages feedback [MESSAGEID]`
977
997
 
@@ -1010,7 +1030,7 @@ EXAMPLES
1010
1030
  $ chatbase messages feedback --conversation conv_123 --message msg_1 --rating clear -a agt_123
1011
1031
  ```
1012
1032
 
1013
- _See code: [src/commands/messages/feedback.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/messages/feedback.ts)_
1033
+ _See code: [src/commands/messages/feedback.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/messages/feedback.ts)_
1014
1034
 
1015
1035
  ## `chatbase messages list`
1016
1036
 
@@ -1046,7 +1066,7 @@ EXAMPLES
1046
1066
  $ chatbase messages list --conversation conv_123 -a agt_123 --all --json
1047
1067
  ```
1048
1068
 
1049
- _See code: [src/commands/messages/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/messages/list.ts)_
1069
+ _See code: [src/commands/messages/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/messages/list.ts)_
1050
1070
 
1051
1071
  ## `chatbase sources create`
1052
1072
 
@@ -1093,7 +1113,7 @@ EXAMPLES
1093
1113
  $ chatbase sources create --file ./guide.pdf -a agt_123
1094
1114
  ```
1095
1115
 
1096
- _See code: [src/commands/sources/create.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/sources/create.ts)_
1116
+ _See code: [src/commands/sources/create.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/sources/create.ts)_
1097
1117
 
1098
1118
  ## `chatbase sources delete SOURCEID`
1099
1119
 
@@ -1126,7 +1146,7 @@ EXAMPLES
1126
1146
  $ chatbase sources delete src_1 -a agt_1
1127
1147
  ```
1128
1148
 
1129
- _See code: [src/commands/sources/delete.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/sources/delete.ts)_
1149
+ _See code: [src/commands/sources/delete.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/sources/delete.ts)_
1130
1150
 
1131
1151
  ## `chatbase sources get SOURCEID`
1132
1152
 
@@ -1159,7 +1179,7 @@ EXAMPLES
1159
1179
  $ chatbase sources get src_123 -a agt_123
1160
1180
  ```
1161
1181
 
1162
- _See code: [src/commands/sources/get.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/sources/get.ts)_
1182
+ _See code: [src/commands/sources/get.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/sources/get.ts)_
1163
1183
 
1164
1184
  ## `chatbase sources list`
1165
1185
 
@@ -1196,7 +1216,7 @@ EXAMPLES
1196
1216
  $ chatbase sources list -a agt_123 --all --json
1197
1217
  ```
1198
1218
 
1199
- _See code: [src/commands/sources/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/sources/list.ts)_
1219
+ _See code: [src/commands/sources/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/sources/list.ts)_
1200
1220
 
1201
1221
  ## `chatbase sources restore SOURCEID`
1202
1222
 
@@ -1229,7 +1249,7 @@ EXAMPLES
1229
1249
  $ chatbase sources restore src_1 -a agt_1
1230
1250
  ```
1231
1251
 
1232
- _See code: [src/commands/sources/restore.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/sources/restore.ts)_
1252
+ _See code: [src/commands/sources/restore.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/sources/restore.ts)_
1233
1253
 
1234
1254
  ## `chatbase sources summary`
1235
1255
 
@@ -1259,7 +1279,7 @@ EXAMPLES
1259
1279
  $ chatbase sources summary -a agt_123
1260
1280
  ```
1261
1281
 
1262
- _See code: [src/commands/sources/summary.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/sources/summary.ts)_
1282
+ _See code: [src/commands/sources/summary.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/sources/summary.ts)_
1263
1283
 
1264
1284
  ## `chatbase sources update SOURCEID`
1265
1285
 
@@ -1297,7 +1317,7 @@ EXAMPLES
1297
1317
  $ chatbase sources update src_1 --file ./updated.pdf -a agt_1
1298
1318
  ```
1299
1319
 
1300
- _See code: [src/commands/sources/update.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/sources/update.ts)_
1320
+ _See code: [src/commands/sources/update.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/sources/update.ts)_
1301
1321
 
1302
1322
  ## `chatbase tickets create`
1303
1323
 
@@ -1335,7 +1355,7 @@ EXAMPLES
1335
1355
  $ chatbase tickets create --subject "Export failing" --data '{"description":"Customer cannot export.","customer":{"email":"jane@example.com"}}' -a agt_123
1336
1356
  ```
1337
1357
 
1338
- _See code: [src/commands/tickets/create.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/tickets/create.ts)_
1358
+ _See code: [src/commands/tickets/create.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/tickets/create.ts)_
1339
1359
 
1340
1360
  ## `chatbase tickets get TICKETNUMBER`
1341
1361
 
@@ -1368,7 +1388,7 @@ EXAMPLES
1368
1388
  $ chatbase tickets get 42 -a agt_123
1369
1389
  ```
1370
1390
 
1371
- _See code: [src/commands/tickets/get.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/tickets/get.ts)_
1391
+ _See code: [src/commands/tickets/get.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/tickets/get.ts)_
1372
1392
 
1373
1393
  ## `chatbase tickets list`
1374
1394
 
@@ -1418,7 +1438,7 @@ EXAMPLES
1418
1438
  $ chatbase tickets list -a agt_123 --all --json
1419
1439
  ```
1420
1440
 
1421
- _See code: [src/commands/tickets/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/tickets/list.ts)_
1441
+ _See code: [src/commands/tickets/list.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/tickets/list.ts)_
1422
1442
 
1423
1443
  ## `chatbase tickets messages [TICKETNUMBER]`
1424
1444
 
@@ -1461,7 +1481,7 @@ EXAMPLES
1461
1481
  $ chatbase tickets messages 42 -a agt_123 --all --json
1462
1482
  ```
1463
1483
 
1464
- _See code: [src/commands/tickets/messages.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/tickets/messages.ts)_
1484
+ _See code: [src/commands/tickets/messages.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/tickets/messages.ts)_
1465
1485
 
1466
1486
  ## `chatbase tickets reply [TICKETNUMBER]`
1467
1487
 
@@ -1500,7 +1520,7 @@ EXAMPLES
1500
1520
  $ chatbase tickets reply 42 -m "On it" --author-email sam@example.com -a agt_123
1501
1521
  ```
1502
1522
 
1503
- _See code: [src/commands/tickets/reply.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/tickets/reply.ts)_
1523
+ _See code: [src/commands/tickets/reply.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/tickets/reply.ts)_
1504
1524
 
1505
1525
  ## `chatbase tickets search QUERY`
1506
1526
 
@@ -1536,7 +1556,7 @@ EXAMPLES
1536
1556
  $ chatbase tickets search "refund" -a agt_123 --limit 10 --json
1537
1557
  ```
1538
1558
 
1539
- _See code: [src/commands/tickets/search.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/tickets/search.ts)_
1559
+ _See code: [src/commands/tickets/search.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/tickets/search.ts)_
1540
1560
 
1541
1561
  ## `chatbase tickets update TICKETNUMBER`
1542
1562
 
@@ -1572,7 +1592,7 @@ EXAMPLES
1572
1592
  $ chatbase tickets update 42 --data '{"statusCategory":"closed"}' -a agt_123
1573
1593
  ```
1574
1594
 
1575
- _See code: [src/commands/tickets/update.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/tickets/update.ts)_
1595
+ _See code: [src/commands/tickets/update.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/tickets/update.ts)_
1576
1596
 
1577
1597
  ## `chatbase whatsapp send-template TEMPLATE`
1578
1598
 
@@ -1616,7 +1636,7 @@ EXAMPLES
1616
1636
  $ chatbase whatsapp send-template order_update --to 14155552671 --language en_US --variables '{"header":{"1":"#1042"},"body":{"1":"Jane","2":"Friday"}}' -a agt_123
1617
1637
  ```
1618
1638
 
1619
- _See code: [src/commands/whatsapp/send-template.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/whatsapp/send-template.ts)_
1639
+ _See code: [src/commands/whatsapp/send-template.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/whatsapp/send-template.ts)_
1620
1640
 
1621
1641
  ## `chatbase whatsapp templates`
1622
1642
 
@@ -1652,5 +1672,5 @@ EXAMPLES
1652
1672
  $ chatbase whatsapp templates -a agt_123 --json
1653
1673
  ```
1654
1674
 
1655
- _See code: [src/commands/whatsapp/templates.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.2.0/src/commands/whatsapp/templates.ts)_
1675
+ _See code: [src/commands/whatsapp/templates.ts](https://github.com/Chatbase-co/chatbase-cli/blob/v0.3.0/src/commands/whatsapp/templates.ts)_
1656
1676
  <!-- commandsstop -->
@@ -16,7 +16,10 @@ export default class ConversationsExport extends AgentCommand {
16
16
  'bubble/integration conversations).';
17
17
  static examples = [
18
18
  '<%= config.bin %> conversations export -a agt_123',
19
- '<%= config.bin %> conversations export -a agt_123 --all -o export.json'
19
+ '<%= config.bin %> conversations export -a agt_123 --all -o export.json',
20
+ '<%= config.bin %> conversations export -a agt_123 --start-date 2024-01-01 --end-date 2024-01-31',
21
+ '<%= config.bin %> conversations export -a agt_123 --include summary --source Widget,WhatsApp',
22
+ '<%= config.bin %> conversations export -a agt_123 --conversation conv_123'
20
23
  ];
21
24
  // Export is a data-export command, not a display one: it always emits
22
25
  // the raw API JSON, in both pretty and --json mode (--plain/--json are
@@ -39,14 +42,50 @@ export default class ConversationsExport extends AgentCommand {
39
42
  output: Flags.string({
40
43
  char: 'o',
41
44
  description: 'Write export JSON to a file instead of stdout'
45
+ }),
46
+ // The API owns the day-boundary semantics (a bare YYYY-MM-DD start is
47
+ // the beginning of that day, an end is the *end* of it) and rejects an
48
+ // inverted window with VALIDATION_INVALID_DATE_RANGE, so these pass
49
+ // through unparsed rather than half-reimplementing that rule here.
50
+ 'start-date': Flags.string({
51
+ description: 'Only conversations created at or after this YYYY-MM-DD date or ISO 8601 date-time'
52
+ }),
53
+ 'end-date': Flags.string({
54
+ description: 'Only conversations created at or before this YYYY-MM-DD date (inclusive) or ISO 8601 date-time'
55
+ }),
56
+ // Named --conversation to match `conversations get`, though the query
57
+ // param is conversationId.
58
+ conversation: Flags.string({
59
+ description: 'Export only this conversation ID, from any source (widget, API, WhatsApp, …)'
60
+ }),
61
+ include: Flags.string({
62
+ description: 'Whether to embed message bodies; summary omits them for a cheaper triage pass',
63
+ options: ['summary', 'messages']
64
+ }),
65
+ source: Flags.string({
66
+ description: 'Restrict to these conversation sources (comma-separated, e.g. "Widget or Iframe,WhatsApp"). Omit for all sources'
42
67
  })
43
68
  };
44
69
  async run() {
45
70
  const { flags } = await this.parse(ConversationsExport);
46
71
  const client = this.apiClient(flags);
47
72
  const agentId = await this.agentId(flags, client);
73
+ const extraQuery = {};
74
+ if (flags['start-date'])
75
+ extraQuery.startDate = flags['start-date'];
76
+ if (flags['end-date'])
77
+ extraQuery.endDate = flags['end-date'];
78
+ if (flags.conversation)
79
+ extraQuery.conversationId = flags.conversation;
80
+ if (flags.include)
81
+ extraQuery.include = flags.include;
82
+ if (flags.source)
83
+ extraQuery.source = flags.source;
48
84
  const { pages, items } = await fetchPages((query) => client.GET('/agents/{agentId}/conversations/export', {
49
- params: { path: { agentId }, query }
85
+ params: {
86
+ path: { agentId },
87
+ query: { ...query, ...extraQuery }
88
+ }
50
89
  }), { limit: flags.limit, cursor: flags.cursor, all: flags.all });
51
90
  const last = pages.at(-1);
52
91
  // Single page stays byte-for-byte the API's envelope; --all merges
@@ -1,6 +1,7 @@
1
1
  import { Flags } from '@oclif/core';
2
2
  import { ListCommand } from '../../base/list-command.js';
3
3
  import { fetchPages } from '../../client/paginate.js';
4
+ import { UsageError } from '../../errors/errors.js';
4
5
  import { formatEpochSeconds } from '../../output/render.js';
5
6
  const COLUMNS = [
6
7
  { key: 'id', header: 'ID' },
@@ -26,12 +27,23 @@ export default class ConversationsList extends ListCommand {
26
27
  static examples = [
27
28
  '<%= config.bin %> conversations list -a agt_123',
28
29
  '<%= config.bin %> conversations list -a agt_123 --user usr_456',
30
+ '<%= config.bin %> conversations list -a agt_123 --start-date 2024-01-01 --end-date 2024-01-31',
29
31
  '<%= config.bin %> conversations list -a agt_123 --all --json'
30
32
  ];
31
33
  static flags = {
32
34
  ...ListCommand.baseFlags,
33
35
  user: Flags.string({
34
36
  description: 'List conversations for a specific user (uses GET /users/{userId}/conversations)'
37
+ }),
38
+ // The API owns the day-boundary semantics (a bare YYYY-MM-DD start is
39
+ // the beginning of that day, an end is the *end* of it) and rejects an
40
+ // inverted window with VALIDATION_INVALID_DATE_RANGE, so these pass
41
+ // through unparsed rather than half-reimplementing that rule here.
42
+ 'start-date': Flags.string({
43
+ description: 'Only conversations created at or after this YYYY-MM-DD date or ISO 8601 date-time'
44
+ }),
45
+ 'end-date': Flags.string({
46
+ description: 'Only conversations created at or before this YYYY-MM-DD date (inclusive) or ISO 8601 date-time'
35
47
  })
36
48
  };
37
49
  async run() {
@@ -41,13 +53,24 @@ export default class ConversationsList extends ListCommand {
41
53
  const fetcherPath = flags.user
42
54
  ? '/agents/{agentId}/users/{userId}/conversations'
43
55
  : '/agents/{agentId}/conversations';
56
+ // The per-user endpoint takes only cursor/limit. Sending a date window
57
+ // there would be dropped server-side and quietly return the unfiltered
58
+ // list, so refuse instead of returning a wrong answer.
59
+ if (flags.user && (flags['start-date'] || flags['end-date'])) {
60
+ throw new UsageError('--start-date/--end-date are not supported with --user. Drop --user to filter by date, then filter the results by userId.');
61
+ }
62
+ const extraQuery = {};
63
+ if (flags['start-date'])
64
+ extraQuery.startDate = flags['start-date'];
65
+ if (flags['end-date'])
66
+ extraQuery.endDate = flags['end-date'];
44
67
  const { pages, items } = await fetchPages((query) => client.GET(fetcherPath, {
45
68
  params: {
46
69
  path: {
47
70
  agentId,
48
71
  ...(flags.user ? { userId: flags.user } : {})
49
72
  },
50
- query
73
+ query: { ...query, ...extraQuery }
51
74
  }
52
75
  }), { limit: flags.limit, cursor: flags.cursor, all: flags.all });
53
76
  // Humans read ISO dates; --plain keeps the raw epoch for scripts.