Repository navigation
Expand file tree
/
Copy pathweb.go
More file actions
1456 lines (1376 loc) · 57.8 KB
/
Copy pathweb.go
File metadata and controls
1456 lines (1376 loc) · 57.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
package cmd
import (
"context"
"fmt"
"github.com/context-dot-dev/context-dev-cli/internal/apiquery"
"github.com/context-dot-dev/context-dev-cli/internal/requestflag"
"github.com/context-dot-dev/context-go-sdk/v2"
"github.com/context-dot-dev/context-go-sdk/v2/option"
"github.com/tidwall/gjson"
"github.com/urfave/cli/v3"
)
var webExtract = requestflag.WithInnerFlags(cli.Command{
Name: "extract",
Usage: "Crawl a website, use the provided JSON Schema and instructions to prioritize\nrelevant internal links, and extract structured data from the selected pages.",
Suggest: true,
Flags: []cli.Flag{
&requestflag.Flag[map[string]any]{
Name: "schema",
Usage: "JSON Schema for the returned data object. Image fields such as `image_urls` or `product_photos` automatically make page image references available to extraction, so product data and photos can be returned in one call. TypeScript Zod users can pass a JSON Schema generated from a Zod object; Python users can pass the equivalent JSON Schema object.",
Required: true,
BodyPath: "schema",
},
&requestflag.Flag[string]{
Name: "url",
Usage: "The starting website URL to crawl and extract from. Must include http:// or https://.",
Required: true,
BodyPath: "url",
},
&requestflag.Flag[[]map[string]any]{
Name: "action",
Usage: "Optional browser actions executed in order on the requested page after it loads, before links are discovered or additional pages are crawled. Requires a paid plan. When actions are provided and stopAfterMs is omitted, the crawl budget defaults to 110000 ms.",
BodyPath: "actions",
},
&requestflag.Flag[bool]{
Name: "fact-check",
Usage: "When true, every returned value must be grounded in facts stated on the page; fields that cannot be supported by the page are returned as null/empty. When false (default), the model may make reasonable inferences and derivations from the page content (e.g. ideal customer, competitor analysis, recommendations) while keeping verifiable specifics (names, quotes, URLs, dates, metrics) faithful to the source.",
Default: false,
BodyPath: "factCheck",
},
&requestflag.Flag[bool]{
Name: "follow-subdomains",
Usage: "When true, follow links on subdomains of the starting URL's domain.",
Default: false,
BodyPath: "followSubdomains",
},
&requestflag.Flag[bool]{
Name: "include-frames",
Usage: "When true, iframe contents are included in Markdown before extraction.",
Default: false,
BodyPath: "includeFrames",
},
&requestflag.Flag[string]{
Name: "instructions",
Usage: "Optional extraction guidance, such as which facts to prioritize or how to interpret fields in the schema.",
BodyPath: "instructions",
},
&requestflag.Flag[int64]{
Name: "max-age-ms",
Usage: "Return cached scrape results if a prior scrape for the same parameters is younger than this many milliseconds. Defaults to 7 days (604800000 ms).",
Default: 604800000,
BodyPath: "maxAgeMs",
},
&requestflag.Flag[int64]{
Name: "max-depth",
Usage: "Optional maximum link depth from the starting URL (0 = only the starting page). If omitted, there is no crawl depth limit.",
BodyPath: "maxDepth",
},
&requestflag.Flag[int64]{
Name: "max-pages",
Usage: "Maximum number of pages to analyze for extraction. Hard cap: 50. Defaults to 5.",
Default: 5,
BodyPath: "maxPages",
},
&requestflag.Flag[map[string]any]{
Name: "pdf",
Default: map[string]any{"shouldParse": true},
BodyPath: "pdf",
},
&requestflag.Flag[bool]{
Name: "settle-animations",
Usage: "When true, waits briefly for CSS and transition animations to settle before extracting each crawled page. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages.",
Default: false,
BodyPath: "settleAnimations",
},
&requestflag.Flag[int64]{
Name: "stop-after-ms",
Usage: "Soft time budget for the crawl in milliseconds. Min: 10000 (10s). Max: 110000 (110s). Defaults to 80000 (80s), or 110000 (110s) when browser actions are provided.",
Default: 80000,
BodyPath: "stopAfterMs",
},
&requestflag.Flag[[]string]{
Name: "tag",
Usage: "Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.",
BodyPath: "tags",
},
&requestflag.Flag[int64]{
Name: "timeout-ms",
Usage: "Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).",
BodyPath: "timeoutMS",
},
&requestflag.Flag[int64]{
Name: "wait-for-ms",
Usage: "Optional browser wait time in milliseconds after initial page load for each crawled page.",
BodyPath: "waitForMs",
},
},
Action: handleWebExtract,
HideHelpCommand: true,
}, map[string][]requestflag.HasOuterFlag{
"pdf": {
&requestflag.InnerFlag[int64]{
Name: "pdf.end",
Usage: "Last 1-based PDF page to parse. Must be greater than or equal to start when both are provided.",
InnerField: "end",
},
&requestflag.InnerFlag[bool]{
Name: "pdf.should-parse",
Usage: "When true, PDF pages are fetched and parsed. When false, PDF pages are skipped.",
InnerField: "shouldParse",
},
&requestflag.InnerFlag[int64]{
Name: "pdf.start",
Usage: "First 1-based PDF page to parse.",
InnerField: "start",
},
},
})
var webExtractCompetitors = cli.Command{
Name: "extract-competitors",
Usage: "Analyze a company's landing page and web search evidence to return direct\ncompetitors for the same product or market.",
Suggest: true,
Flags: []cli.Flag{
&requestflag.Flag[string]{
Name: "domain",
Usage: "Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted and normalized to their domain.",
Required: true,
QueryPath: "domain",
},
&requestflag.Flag[int64]{
Name: "num-competitors",
Usage: "Exact number of direct competitors to return. Defaults to 5.",
Default: 5,
QueryPath: "numCompetitors",
},
&requestflag.Flag[[]string]{
Name: "tag",
Usage: "Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.",
QueryPath: "tags",
},
&requestflag.Flag[int64]{
Name: "timeout-ms",
Usage: "Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).",
QueryPath: "timeoutMS",
},
},
Action: handleWebExtractCompetitors,
HideHelpCommand: true,
}
var webExtractFonts = cli.Command{
Name: "extract-fonts",
Usage: "Scrape font information from a website including font families, usage\nstatistics, fallbacks, and element/word counts.",
Suggest: true,
Flags: []cli.Flag{
&requestflag.Flag[string]{
Name: "direct-url",
Usage: "A specific URL to fetch fonts from directly, bypassing domain resolution (e.g., 'https://example.com/design-system'). When provided, fonts are extracted from this exact URL. You must provide either 'domain' or 'directUrl', but not both.",
QueryPath: "directUrl",
},
&requestflag.Flag[string]{
Name: "domain",
Usage: "Domain name to extract fonts from (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both.",
QueryPath: "domain",
},
&requestflag.Flag[*int64]{
Name: "max-age-ms",
Usage: "Maximum age in milliseconds for cached brand data before the API performs a hard refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 year.",
Default: requestflag.Ptr[int64](7776000000),
QueryPath: "maxAgeMs",
},
&requestflag.Flag[[]string]{
Name: "tag",
Usage: "Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.",
QueryPath: "tags",
},
&requestflag.Flag[int64]{
Name: "timeout-ms",
Usage: "Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).",
QueryPath: "timeoutMS",
},
},
Action: handleWebExtractFonts,
HideHelpCommand: true,
}
var webExtractStyleguide = cli.Command{
Name: "extract-styleguide",
Usage: "Extract a comprehensive design system from a website including colors,\ntypography, spacing, shadows, and UI components.",
Suggest: true,
Flags: []cli.Flag{
&requestflag.Flag[string]{
Name: "color-scheme",
Usage: "Optional browser color scheme to emulate for websites that respond to prefers-color-scheme. This value is part of the styleguide cache key.",
QueryPath: "colorScheme",
},
&requestflag.Flag[string]{
Name: "direct-url",
Usage: "A specific URL to fetch the styleguide from directly, bypassing domain resolution (e.g., 'https://example.com/design-system'). When provided, the styleguide is extracted from this exact URL. You must provide either 'domain' or 'directUrl', but not both.",
QueryPath: "directUrl",
},
&requestflag.Flag[string]{
Name: "domain",
Usage: "Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both.",
QueryPath: "domain",
},
&requestflag.Flag[*int64]{
Name: "max-age-ms",
Usage: "Maximum age in milliseconds for cached brand data before the API performs a hard refresh. Defaults to 3 months (7776000000 ms). Values below 1 day (86400000 ms) are clamped to 1 day; values above 1 year (31536000000 ms) are clamped to 1 year.",
Default: requestflag.Ptr[int64](7776000000),
QueryPath: "maxAgeMs",
},
&requestflag.Flag[[]string]{
Name: "tag",
Usage: "Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.",
QueryPath: "tags",
},
&requestflag.Flag[int64]{
Name: "timeout-ms",
Usage: "Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).",
QueryPath: "timeoutMS",
},
},
Action: handleWebExtractStyleguide,
HideHelpCommand: true,
}
var webScreenshot = requestflag.WithInnerFlags(cli.Command{
Name: "screenshot",
Usage: "Capture a screenshot of a website.",
Suggest: true,
Flags: []cli.Flag{
&requestflag.Flag[bool]{
Name: "clear-popups",
Usage: "Optional parameter for comprehensive popup cleanup. If 'true', the browser dismisses detected cookie/consent UI and clears other detected obstructive popups and overlays before capture. If 'false' or not provided, this parameter requests no cleanup; handleCookiePopup can still request cookie/consent handling independently.",
Default: false,
QueryPath: "clearPopups",
},
&requestflag.Flag[string]{
Name: "color-scheme",
Usage: "Optional parameter to choose the site's visual theme in the screenshot. Use 'light' or 'dark' when the site offers both appearances.",
QueryPath: "colorScheme",
},
&requestflag.Flag[string]{
Name: "country",
Usage: "Fetch the target page through a residential proxy in this country (ISO 3166-1 alpha-2).",
QueryPath: "country",
},
&requestflag.Flag[string]{
Name: "direct-url",
Usage: "A specific URL to screenshot directly, bypassing domain resolution (e.g., 'https://example.com/pricing'). When provided, the screenshot is taken of this exact URL. You must provide either 'domain' or 'directUrl', but not both.",
QueryPath: "directUrl",
},
&requestflag.Flag[string]{
Name: "domain",
Usage: "Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The domain will be automatically normalized and validated. You must provide either 'domain' or 'directUrl', but not both.",
QueryPath: "domain",
},
&requestflag.Flag[string]{
Name: "full-screenshot",
Usage: "Optional parameter to determine screenshot type. If 'true', takes a full page screenshot capturing all content. If 'false' or not provided, takes a viewport screenshot (standard browser view).",
QueryPath: "fullScreenshot",
},
&requestflag.Flag[bool]{
Name: "handle-cookie-popup",
Usage: "Optional parameter to control cookie/consent popup handling. If 'true', we dismiss cookie banner before capture. If 'false' or not provided, captures the page without that step.",
Default: false,
QueryPath: "handleCookiePopup",
},
&requestflag.Flag[*int64]{
Name: "max-age-ms",
Usage: "Return a cached screenshot if a prior screenshot for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always capture fresh.",
Default: requestflag.Ptr[int64](86400000),
QueryPath: "maxAgeMs",
},
&requestflag.Flag[string]{
Name: "page",
Usage: "Optional parameter to specify which page type to screenshot. If provided, the system will scrape the domain's links and use heuristics to find the most appropriate URL for the specified page type (30 supported languages). If not provided, screenshots the main domain landing page. Only applicable when using 'domain', not 'directUrl'.",
QueryPath: "page",
},
&requestflag.Flag[*int64]{
Name: "scroll-offset",
Usage: "Optional vertical scroll offset in pixels for capturing a long page in viewport-sized chunks. When provided, the full page is captured once and the returned image is the viewport-sized slice that begins at this Y offset (e.g. request scrollOffset=0, then 1080, then 2160 to walk a 1920x1080 landing page top to bottom). The final slice may be shorter than the viewport height. Takes precedence over fullScreenshot. Max: 100000.",
QueryPath: "scrollOffset",
},
&requestflag.Flag[[]string]{
Name: "tag",
Usage: "Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.",
QueryPath: "tags",
},
&requestflag.Flag[int64]{
Name: "timeout-ms",
Usage: "Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).",
QueryPath: "timeoutMS",
},
&requestflag.Flag[map[string]any]{
Name: "viewport",
Usage: "Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.",
Default: map[string]any{"width": 1920, "height": 1080},
QueryPath: "viewport",
},
&requestflag.Flag[*int64]{
Name: "wait-for-ms",
Usage: "Optional browser wait time in milliseconds after initial page load before taking the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when omitted.",
Default: requestflag.Ptr[int64](3000),
QueryPath: "waitForMs",
},
&requestflag.Flag[string]{
Name: "zdr",
Usage: "Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.",
Default: "disabled",
QueryPath: "zdr",
},
},
Action: handleWebScreenshot,
HideHelpCommand: true,
}, map[string][]requestflag.HasOuterFlag{
"viewport": {
&requestflag.InnerFlag[int64]{
Name: "viewport.height",
Usage: "Viewport height in pixels.",
InnerField: "height",
},
&requestflag.InnerFlag[int64]{
Name: "viewport.width",
Usage: "Viewport width in pixels.",
InnerField: "width",
},
},
})
var webSearch = requestflag.WithInnerFlags(cli.Command{
Name: "search",
Usage: "Search the web and optionally scrape each result to Markdown in one round-trip.",
Suggest: true,
Flags: []cli.Flag{
&requestflag.Flag[string]{
Name: "query",
Usage: "Search query. Accepts natural language as well as Google-style search operators such as `site:`, `-site:`, `inurl:`, `intitle:`, quoted phrases, and `OR`.",
Required: true,
BodyPath: "query",
},
&requestflag.Flag[string]{
Name: "country",
Usage: "Two-letter ISO 3166-1 alpha-2 country code to localize results to a specific country (maps to Google's `gl` parameter). Example: \"us\", \"gb\", \"de\".",
BodyPath: "country",
},
&requestflag.Flag[[]string]{
Name: "exclude-domain",
Usage: `Blocklist — drop results from these domains. Example: ["pinterest.com", "reddit.com"].`,
BodyPath: "excludeDomains",
},
&requestflag.Flag[string]{
Name: "freshness",
Usage: "Restrict results to content published within this window.",
BodyPath: "freshness",
},
&requestflag.Flag[[]string]{
Name: "include-domain",
Usage: `Allowlist — only return results from these domains. Example: ["arxiv.org", "github.com"].`,
BodyPath: "includeDomains",
},
&requestflag.Flag[map[string]any]{
Name: "markdown-options",
Usage: "Inline Markdown scraping for each result. Set `enabled: true` to activate.",
BodyPath: "markdownOptions",
},
&requestflag.Flag[int64]{
Name: "num-results",
Usage: "Number of results to request and return (10–100). Defaults to 10.",
Default: 10,
BodyPath: "numResults",
},
&requestflag.Flag[bool]{
Name: "query-fanout",
Usage: "Expand the query into multiple parallel variants for broader recall.",
BodyPath: "queryFanout",
},
&requestflag.Flag[[]string]{
Name: "tag",
Usage: "Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.",
BodyPath: "tags",
},
&requestflag.Flag[int64]{
Name: "timeout-ms",
Usage: "Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).",
BodyPath: "timeoutMS",
},
},
Action: handleWebSearch,
HideHelpCommand: true,
}, map[string][]requestflag.HasOuterFlag{
"markdown-options": {
&requestflag.InnerFlag[bool]{
Name: "markdown-options.enabled",
Usage: "Scrape each result to Markdown. Off by default to keep search cheap and fast.",
InnerField: "enabled",
},
&requestflag.InnerFlag[bool]{
Name: "markdown-options.include-frames",
Usage: "Render iframe contents into the Markdown.",
InnerField: "includeFrames",
},
&requestflag.InnerFlag[bool]{
Name: "markdown-options.include-images",
Usage: "Emit image references in the Markdown.",
InnerField: "includeImages",
},
&requestflag.InnerFlag[bool]{
Name: "markdown-options.include-links",
Usage: "Keep hyperlinks in the Markdown.",
InnerField: "includeLinks",
},
&requestflag.InnerFlag[int64]{
Name: "markdown-options.max-age-ms",
Usage: "Cache TTL in ms for scraped Markdown keyed by URL + options. Default 1 day, max 30 days. Set to 0 to force a fresh scrape.",
InnerField: "maxAgeMs",
},
&requestflag.InnerFlag[map[string]any]{
Name: "markdown-options.pdf",
Usage: "PDF handling. Use start/end to bound text extraction and OCR to a page range.",
InnerField: "pdf",
},
&requestflag.InnerFlag[bool]{
Name: "markdown-options.shorten-base64-images",
Usage: "Truncate inline base64 image payloads to keep responses small.",
InnerField: "shortenBase64Images",
},
&requestflag.InnerFlag[int64]{
Name: "markdown-options.timeout-ms",
Usage: "Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).",
InnerField: "timeoutMS",
},
&requestflag.InnerFlag[bool]{
Name: "markdown-options.use-main-content-only",
Usage: "Strip nav, header, footer, and sidebar — keep only the primary article content.",
InnerField: "useMainContentOnly",
},
&requestflag.InnerFlag[int64]{
Name: "markdown-options.wait-for-ms",
Usage: "Extra wait after page load before rendering, in ms (0–30000). Useful for JS-heavy pages.",
InnerField: "waitForMs",
},
},
})
var webWebCrawlMd = requestflag.WithInnerFlags(cli.Command{
Name: "web-crawl-md",
Usage: "Performs a crawl starting from a given URL, extracts page content as Markdown,\nand returns results for all crawled pages.",
Suggest: true,
Flags: []cli.Flag{
&requestflag.Flag[string]{
Name: "url",
Usage: "The starting URL for the crawl (must include http:// or https:// protocol)",
Required: true,
BodyPath: "url",
},
&requestflag.Flag[string]{
Name: "country",
Usage: "Fetch the target page through a residential proxy in this country (ISO 3166-1 alpha-2).",
BodyPath: "country",
},
&requestflag.Flag[[]string]{
Name: "exclude-selector",
Usage: `CSS selectors to remove before each crawled page is converted to Markdown. Applied after includeSelectors. Exclusion takes precedence: an element matching both is removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]".`,
BodyPath: "excludeSelectors",
},
&requestflag.Flag[bool]{
Name: "follow-subdomains",
Usage: "When true, follow links on subdomains of the starting URL's domain (e.g. docs.example.com when starting from example.com). www and apex are always treated as equivalent.",
Default: false,
BodyPath: "followSubdomains",
},
&requestflag.Flag[bool]{
Name: "include-frames",
Usage: "When true, the contents of iframes are rendered to Markdown for each crawled page.",
Default: false,
BodyPath: "includeFrames",
},
&requestflag.Flag[bool]{
Name: "include-images",
Usage: "Include image references in the Markdown output",
Default: false,
BodyPath: "includeImages",
},
&requestflag.Flag[bool]{
Name: "include-links",
Usage: "Preserve hyperlinks in the Markdown output",
Default: true,
BodyPath: "includeLinks",
},
&requestflag.Flag[[]string]{
Name: "include-selector",
Usage: `CSS selectors. When provided, only matching HTML subtrees (and their descendants) are kept before each crawled page is converted to Markdown. When omitted, the entire document is kept. Examples: "article.main", "#content", "[role=main]".`,
BodyPath: "includeSelectors",
},
&requestflag.Flag[int64]{
Name: "max-age-ms",
Usage: "Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.",
Default: 86400000,
BodyPath: "maxAgeMs",
},
&requestflag.Flag[int64]{
Name: "max-depth",
Usage: "Maximum link depth from the starting URL (0 = only the starting page)",
BodyPath: "maxDepth",
},
&requestflag.Flag[int64]{
Name: "max-pages",
Usage: "Maximum number of pages to crawl. Hard cap: 500.",
Default: 100,
BodyPath: "maxPages",
},
&requestflag.Flag[map[string]any]{
Name: "pdf",
Usage: "PDF parsing controls. Use start/end to limit text extraction and embedded-image detection/OCR to an inclusive 1-based page range.",
Default: map[string]any{"shouldParse": true, "ocr": false},
BodyPath: "pdf",
},
&requestflag.Flag[bool]{
Name: "settle-animations",
Usage: "When true, waits briefly for CSS and transition animations to settle before extracting each crawled page. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages.",
Default: false,
BodyPath: "settleAnimations",
},
&requestflag.Flag[bool]{
Name: "shorten-base64-images",
Usage: "Truncate base64-encoded image data in the Markdown output",
Default: true,
BodyPath: "shortenBase64Images",
},
&requestflag.Flag[int64]{
Name: "stop-after-ms",
Usage: "Soft time budget for the crawl in milliseconds. After each scrape, the crawler checks the elapsed time and, if exceeded, returns the pages collected so far instead of continuing. Min: 10000 (10s). Max: 110000 (110s). Default: 80000 (80s).",
Default: 80000,
BodyPath: "stopAfterMs",
},
&requestflag.Flag[[]string]{
Name: "tag",
Usage: "Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.",
BodyPath: "tags",
},
&requestflag.Flag[int64]{
Name: "timeout-ms",
Usage: "Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).",
BodyPath: "timeoutMS",
},
&requestflag.Flag[string]{
Name: "url-regex",
Usage: "Regex pattern. Only URLs matching this pattern will be followed and scraped. An automatic prefix scope in the form ^<starting URL> follows a redirect of the starting page.",
BodyPath: "urlRegex",
},
&requestflag.Flag[bool]{
Name: "use-main-content-only",
Usage: "Extract only the main content, stripping headers, footers, sidebars, and navigation",
Default: false,
BodyPath: "useMainContentOnly",
},
&requestflag.Flag[int64]{
Name: "wait-for-ms",
Usage: "Browser wait time in milliseconds after initial page load for each crawled page. Defaults to 3500 (3.5 seconds). Min: 0. Max: 30000 (30 seconds).",
Default: 3500,
BodyPath: "waitForMs",
},
&requestflag.Flag[string]{
Name: "zdr",
Usage: "Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.",
Default: "disabled",
BodyPath: "zdr",
},
},
Action: handleWebWebCrawlMd,
HideHelpCommand: true,
}, map[string][]requestflag.HasOuterFlag{
"pdf": {
&requestflag.InnerFlag[int64]{
Name: "pdf.end",
Usage: "Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Must be greater than or equal to start when both are provided.",
InnerField: "end",
},
&requestflag.InnerFlag[bool]{
Name: "pdf.ocr",
Usage: "When true, OCR the selected PDF pages that have no usable text layer (scans), replacing each recovered page's text with the OCR result while pages with a real text layer keep it. Billed at 1 credit per page OCR actually recovered, on top of the base request cost.",
InnerField: "ocr",
},
&requestflag.InnerFlag[bool]{
Name: "pdf.should-parse",
Usage: "When true, PDF pages are fetched and parsed. When false, PDF pages are skipped entirely (not included in results and not counted as failures).",
InnerField: "shouldParse",
},
&requestflag.InnerFlag[int64]{
Name: "pdf.start",
Usage: "First 1-based PDF page to parse. When omitted, parsing starts at the first page.",
InnerField: "start",
},
},
})
var webWebScrapeHTML = requestflag.WithInnerFlags(cli.Command{
Name: "web-scrape-html",
Usage: "Scrapes the given URL and returns the raw HTML content of the page. The base\nrequest costs 1 credit; requests with browser actions cost 2 credits.",
Suggest: true,
Flags: []cli.Flag{
&requestflag.Flag[string]{
Name: "url",
Usage: "Full URL to scrape (must include http:// or https:// protocol)",
Required: true,
QueryPath: "url",
},
&requestflag.Flag[any]{
Name: "action",
Usage: "Optional browser actions executed in array order after the page loads and before content is captured. Requires a paid plan. Send a JSON array in the query parameter. Maximum: 5 actions.",
QueryPath: "actions",
},
&requestflag.Flag[string]{
Name: "country",
Usage: "Fetch the target page through a residential proxy in this country (ISO 3166-1 alpha-2).",
QueryPath: "country",
},
&requestflag.Flag[any]{
Name: "exclude-selector",
Usage: `CSS selectors to remove from the result. Applied after includeSelectors. Exclusion takes precedence: an element matching both is removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]".`,
QueryPath: "excludeSelectors",
},
&requestflag.Flag[map[string]any]{
Name: "headers",
Usage: "Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers[X-Custom]=value. When provided, caching is bypassed: the result is neither read from nor written to cache.",
QueryPath: "headers",
},
&requestflag.Flag[bool]{
Name: "include-frames",
Usage: "When true, iframes are rendered inline into the returned HTML.",
Default: false,
QueryPath: "includeFrames",
},
&requestflag.Flag[any]{
Name: "include-selector",
Usage: `CSS selectors. When provided, only matching subtrees (and their descendants) are kept and everything else is dropped. When omitted, the entire document is kept. Examples: "article.main", "#content", "[role=main]".`,
QueryPath: "includeSelectors",
},
&requestflag.Flag[*int64]{
Name: "max-age-ms",
Usage: "Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.",
Default: requestflag.Ptr[int64](86400000),
QueryPath: "maxAgeMs",
},
&requestflag.Flag[map[string]any]{
Name: "pdf",
Usage: "PDF parsing controls. Use start/end to limit text extraction and embedded-image detection/OCR to an inclusive 1-based page range.",
Default: map[string]any{"shouldParse": true, "ocr": false},
QueryPath: "pdf",
},
&requestflag.Flag[bool]{
Name: "settle-animations",
Usage: "When true, waits briefly for CSS and transition animations to settle before extracting HTML. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages.",
Default: false,
QueryPath: "settleAnimations",
},
&requestflag.Flag[[]string]{
Name: "tag",
Usage: "Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.",
QueryPath: "tags",
},
&requestflag.Flag[int64]{
Name: "timeout-ms",
Usage: "Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).",
QueryPath: "timeoutMS",
},
&requestflag.Flag[bool]{
Name: "use-main-content-only",
Usage: "When true, return only the page's main content in the HTML response, excluding headers, footers, sidebars, and navigation when detectable.",
Default: false,
QueryPath: "useMainContentOnly",
},
&requestflag.Flag[*int64]{
Name: "wait-for-ms",
Usage: "Optional browser wait time in milliseconds after initial page load. Min: 0. Max: 30000 (30 seconds).",
QueryPath: "waitForMs",
},
&requestflag.Flag[string]{
Name: "zdr",
Usage: "Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.",
Default: "disabled",
QueryPath: "zdr",
},
},
Action: handleWebWebScrapeHTML,
HideHelpCommand: true,
}, map[string][]requestflag.HasOuterFlag{
"pdf": {
&requestflag.InnerFlag[int64]{
Name: "pdf.end",
Usage: "Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Must be greater than or equal to start when both are provided.",
InnerField: "end",
},
&requestflag.InnerFlag[bool]{
Name: "pdf.ocr",
Usage: "When true, OCR the selected PDF pages that have no usable text layer (scans), replacing each recovered page's text with the OCR result while pages with a real text layer keep it. Billed at 1 credit per page OCR actually recovered, on top of the base request cost. When false, no OCR runs.",
InnerField: "ocr",
},
&requestflag.InnerFlag[bool]{
Name: "pdf.should-parse",
Usage: "When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and a 400 PDF_SKIPPED is returned.",
InnerField: "shouldParse",
},
&requestflag.InnerFlag[int64]{
Name: "pdf.start",
Usage: "First 1-based PDF page to parse. When omitted, parsing starts at the first page.",
InnerField: "start",
},
},
})
var webWebScrapeImages = requestflag.WithInnerFlags(cli.Command{
Name: "web-scrape-images",
Usage: "Extract image assets from a web page, including standard URLs, inline SVGs, data\nURIs, responsive image sources, metadata, CSS backgrounds, video posters, and\nembeds. The base request costs 1 credit, or 2 credits with browser actions. When\nenrichment is enabled, the entire call costs 5 credits, including requests that\nalso use actions.",
Suggest: true,
Flags: []cli.Flag{
&requestflag.Flag[string]{
Name: "url",
Usage: "Page URL to inspect. Must include http:// or https://.",
Required: true,
QueryPath: "url",
},
&requestflag.Flag[any]{
Name: "action",
Usage: "Optional browser actions executed in array order after the page loads and before content is captured. Requires a paid plan. Send a JSON array in the query parameter. Maximum: 5 actions.",
QueryPath: "actions",
},
&requestflag.Flag[bool]{
Name: "dedupe",
Usage: "When true, visually duplicate images are removed: every image is loaded and perceptually hashed, and only the highest-resolution copy of each duplicate group is kept. Images that cannot be downloaded or hashed are kept. Default: false.",
Default: false,
QueryPath: "dedupe",
},
&requestflag.Flag[map[string]any]{
Name: "enrichment",
Usage: "Optional per-image processing, sent as deep-object query params such as enrichment[resolution]=true.",
QueryPath: "enrichment",
},
&requestflag.Flag[map[string]any]{
Name: "headers",
Usage: "Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers[X-Custom]=value. When provided, caching is bypassed: the result is neither read from nor written to cache.",
QueryPath: "headers",
},
&requestflag.Flag[*int64]{
Name: "max-age-ms",
Usage: "Reuse a cached result this many milliseconds old or newer. Default: 86400000 (1 day). Set to 0 to bypass cache. Maximum: 2592000000 (30 days).",
Default: requestflag.Ptr[int64](86400000),
QueryPath: "maxAgeMs",
},
&requestflag.Flag[[]string]{
Name: "tag",
Usage: "Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.",
QueryPath: "tags",
},
&requestflag.Flag[int64]{
Name: "timeout-ms",
Usage: "Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).",
QueryPath: "timeoutMS",
},
&requestflag.Flag[*int64]{
Name: "wait-for-ms",
Usage: "Optional browser wait time in milliseconds after initial page load before collecting images. Min: 0. Max: 30000 (30 seconds).",
QueryPath: "waitForMs",
},
},
Action: handleWebWebScrapeImages,
HideHelpCommand: true,
}, map[string][]requestflag.HasOuterFlag{
"enrichment": {
&requestflag.InnerFlag[bool]{
Name: "enrichment.classification",
Usage: "Classify each image by visual asset type.",
InnerField: "classification",
},
&requestflag.InnerFlag[bool]{
Name: "enrichment.hosted-url",
Usage: "Host materializable images on the Brand.dev CDN and return their URL and MIME type.",
InnerField: "hostedUrl",
},
&requestflag.InnerFlag[int64]{
Name: "enrichment.max-time-per-ms",
Usage: "Per-image enrichment timeout in milliseconds. Default: 30000. Maximum: 60000.",
InnerField: "maxTimePerMs",
},
&requestflag.InnerFlag[bool]{
Name: "enrichment.resolution",
Usage: "Measure image width and height when possible.",
InnerField: "resolution",
},
},
})
var webWebScrapeMd = requestflag.WithInnerFlags(cli.Command{
Name: "web-scrape-md",
Usage: "Scrapes the given URL into LLM usable Markdown. Inspect key_metadata on JSON\nresponses from a recognized API key; use error_code to distinguish stable\nfailure categories.",
Suggest: true,
Flags: []cli.Flag{
&requestflag.Flag[string]{
Name: "url",
Usage: "Full URL to scrape into LLM usable Markdown (must include http:// or https:// protocol)",
Required: true,
QueryPath: "url",
},
&requestflag.Flag[any]{
Name: "action",
Usage: "Optional browser actions executed in array order after the page loads and before content is captured. Requires a paid plan. Send a JSON array in the query parameter. Maximum: 5 actions.",
QueryPath: "actions",
},
&requestflag.Flag[string]{
Name: "country",
Usage: "Fetch the target page through a residential proxy in this country (ISO 3166-1 alpha-2).",
QueryPath: "country",
},
&requestflag.Flag[any]{
Name: "exclude-selector",
Usage: `CSS selectors to remove before conversion to Markdown. Applied after includeSelectors. Exclusion takes precedence: an element matching both is removed. Examples: "nav", "footer", ".ad-banner", "[aria-hidden=true]".`,
QueryPath: "excludeSelectors",
},
&requestflag.Flag[map[string]any]{
Name: "headers",
Usage: "Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers[X-Custom]=value. When provided, caching is bypassed: the result is neither read from nor written to cache.",
QueryPath: "headers",
},
&requestflag.Flag[bool]{
Name: "include-frames",
Usage: "When true, the contents of iframes are rendered to Markdown.",
Default: false,
QueryPath: "includeFrames",
},
&requestflag.Flag[bool]{
Name: "include-html",
Usage: "When true, the response also includes an `html` field with the page HTML the Markdown was converted from — the same body the Scrape HTML endpoint returns for the equivalent request.",
Default: false,
QueryPath: "includeHTML",
},
&requestflag.Flag[bool]{
Name: "include-images",
Usage: "Include image references in Markdown output",
Default: false,
QueryPath: "includeImages",
},
&requestflag.Flag[bool]{
Name: "include-links",
Usage: "Preserve hyperlinks in Markdown output",
Default: true,
QueryPath: "includeLinks",
},
&requestflag.Flag[any]{
Name: "include-selector",
Usage: `CSS selectors. When provided, only matching HTML subtrees (and their descendants) are kept before conversion to Markdown. When omitted, the entire document is kept. Examples: "article.main", "#content", "[role=main]".`,
QueryPath: "includeSelectors",
},
&requestflag.Flag[*int64]{
Name: "max-age-ms",
Usage: "Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.",
Default: requestflag.Ptr[int64](86400000),
QueryPath: "maxAgeMs",
},
&requestflag.Flag[map[string]any]{
Name: "pdf",
Usage: "PDF parsing controls. Use start/end to limit text extraction and embedded-image detection/OCR to an inclusive 1-based page range.",
Default: map[string]any{"shouldParse": true, "ocr": false},
QueryPath: "pdf",
},
&requestflag.Flag[bool]{
Name: "settle-animations",
Usage: "When true, waits briefly for CSS and transition animations to settle before converting to Markdown. Defaults to false. This adds a bit of latency in exchange for more stable output on animated pages.",
Default: false,
QueryPath: "settleAnimations",
},
&requestflag.Flag[bool]{
Name: "shorten-base64-images",
Usage: "Shorten base64-encoded image data in the Markdown output",
Default: true,
QueryPath: "shortenBase64Images",
},
&requestflag.Flag[[]string]{
Name: "tag",
Usage: "Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.",
QueryPath: "tags",
},
&requestflag.Flag[int64]{
Name: "timeout-ms",
Usage: "Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).",
QueryPath: "timeoutMS",
},
&requestflag.Flag[bool]{
Name: "use-main-content-only",
Usage: "Extract only the main content of the page, excluding headers, footers, sidebars, and navigation",
Default: false,
QueryPath: "useMainContentOnly",
},
&requestflag.Flag[*int64]{
Name: "wait-for-ms",
Usage: "Optional browser wait time in milliseconds after initial page load before converting the page to Markdown. Min: 0. Max: 30000 (30 seconds).",
QueryPath: "waitForMs",
},
&requestflag.Flag[string]{
Name: "zdr",
Usage: "Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.",
Default: "disabled",
QueryPath: "zdr",
},
},
Action: handleWebWebScrapeMd,
HideHelpCommand: true,
}, map[string][]requestflag.HasOuterFlag{
"pdf": {
&requestflag.InnerFlag[int64]{
Name: "pdf.end",
Usage: "Last 1-based PDF page to parse. When omitted, parsing ends at the last page. Must be greater than or equal to start when both are provided.",
InnerField: "end",
},
&requestflag.InnerFlag[bool]{
Name: "pdf.ocr",
Usage: "When true, OCR the selected PDF pages that have no usable text layer (scans), replacing each recovered page's text with the OCR result while pages with a real text layer keep it. Billed at 1 credit per page OCR actually recovered, on top of the base request cost. When false, no OCR runs.",
InnerField: "ocr",
},
&requestflag.InnerFlag[bool]{
Name: "pdf.should-parse",
Usage: "When true, PDF URLs are fetched and parsed. When false, PDF URLs are skipped and a 400 PDF_SKIPPED is returned.",
InnerField: "shouldParse",
},
&requestflag.InnerFlag[int64]{
Name: "pdf.start",
Usage: "First 1-based PDF page to parse. When omitted, parsing starts at the first page.",
InnerField: "start",
},
},
})
var webWebScrapeSitemap = cli.Command{
Name: "web-scrape-sitemap",
Usage: "Crawl an entire website's sitemap and return all discovered page URLs. Pass\n`search` to have the crawled sitemap filtered down to the pages about a phrase\n(for example `pricing and plans` or `api authentication docs`), most relevant\nfirst — a searched crawl scans the whole sitemap and costs 2 credits instead\nof 1.",
Suggest: true,
Flags: []cli.Flag{
&requestflag.Flag[string]{
Name: "domain",
Usage: "Domain to build a sitemap for",
Required: true,
QueryPath: "domain",
},
&requestflag.Flag[map[string]any]{
Name: "headers",
Usage: "Optional outbound HTTP headers forwarded only to the target URL, sent as deep-object query params such as headers[X-Custom]=value. When provided, caching is bypassed: the result is neither read from nor written to cache.",
QueryPath: "headers",
},
&requestflag.Flag[int64]{
Name: "max-links",
Usage: "Maximum number of links to return from the sitemap crawl. Defaults to 10,000. Minimum is 1, maximum is 100,000.",
Default: 10000,
QueryPath: "maxLinks",
},
&requestflag.Flag[string]{
Name: "search",
Usage: "Optional search phrase. When provided, the crawled sitemap is filtered to the pages whose URLs are about that phrase, most relevant first, and the request costs 2 credits instead of 1.",
QueryPath: "search",
},
&requestflag.Flag[string]{
Name: "sitemap-url",
Usage: "Optional explicit sitemap URL. When provided, exactly this sitemap is crawled instead of discovering the domain's sitemaps.",
QueryPath: "sitemapUrl",
},
&requestflag.Flag[[]string]{
Name: "tag",
Usage: "Optional comma-separated caller-defined tags for tracking this request. Tags are recorded on the request's usage log and can be used to filter usage on the dashboard usage page. Up to 20 tags, each 1-50 characters.",
QueryPath: "tags",
},
&requestflag.Flag[int64]{
Name: "timeout-ms",
Usage: "Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).",
QueryPath: "timeoutMS",
},
&requestflag.Flag[string]{
Name: "url-regex",
Usage: "Optional RE2-compatible regex pattern. Only URLs matching this pattern are returned and counted against maxLinks.",
QueryPath: "urlRegex",
},
&requestflag.Flag[string]{
Name: "zdr",
Usage: "Set to enabled to bypass shared caches and omit request and response content from retained usage logs. Requires zero data retention to be enabled for your organization (contact support@context.dev), otherwise the request fails with ZDR_NOT_ENABLED. Successful ZDR responses include X-Context-ZDR: true.",
Default: "disabled",
QueryPath: "zdr",