Skip to content

Commit 654791f

Browse files
authored
Merge pull request #22 from context-dot-dev/release-please--branches--main--changes--next
release: 1.6.0
2 parents 8431a98 + b111d48 commit 654791f

17 files changed

Lines changed: 370 additions & 87 deletions

‎.release-please-manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.5.0"
2+
".": "1.6.0"
33
}

‎.stats.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 40
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-a0dda03bbb600917cfb9add468cc4c8c84351a8dbbf61644dbc353263ca1748f.yml
3-
openapi_spec_hash: c24264f32a46d9317aac5af9d6a396f7
4-
config_hash: 920678668dd2da6f8966fbf1b8fde4e2
1+
configured_endpoints: 41
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-5dbe631ce516ca688273053ddcb58870561bd6dc76fa75df354c954d7af65a3c.yml
3+
openapi_spec_hash: 53a74c4cccbdec8590db38183840a446
4+
config_hash: 0fb0ceca5946298c416cec0cca5260c7

‎CHANGELOG.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## 1.6.0 (2026-08-17)
4+
5+
Full Changelog: [v1.5.0...v1.6.0](https://github.com/context-dot-dev/context-dev-cli/compare/v1.5.0...v1.6.0)
6+
7+
### Features
8+
9+
* **api:** api update ([7e6e3b7](https://github.com/context-dot-dev/context-dev-cli/commit/7e6e3b7c6d540b53660b82ec81cf1d92fc4fe1b5))
10+
* **api:** api update ([eb22b56](https://github.com/context-dot-dev/context-dev-cli/commit/eb22b56ccf04e0c18195a7bc0f5289de452c2952))
11+
* **api:** api update ([18adfb0](https://github.com/context-dot-dev/context-dev-cli/commit/18adfb09e23af7efc8a64370e13d5cc38fe73859))
12+
* **api:** api update ([df232b5](https://github.com/context-dot-dev/context-dev-cli/commit/df232b58f81c68fd6a914e7fe63882a0f3de9fd4))
13+
* **api:** manual updates ([6a9b2f5](https://github.com/context-dot-dev/context-dev-cli/commit/6a9b2f59ae223e0e70e61a8e63012c8c4160a431))
14+
315
## 1.5.0 (2026-08-07)
416

517
Full Changelog: [v1.4.0...v1.5.0](https://github.com/context-dot-dev/context-dev-cli/compare/v1.4.0...v1.5.0)

‎go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/charmbracelet/bubbletea v1.3.6
88
github.com/charmbracelet/lipgloss v1.1.0
99
github.com/charmbracelet/x/term v0.2.1
10-
github.com/context-dot-dev/context-go-sdk/v2 v2.8.0
10+
github.com/context-dot-dev/context-go-sdk/v2 v2.9.0
1111
github.com/goccy/go-yaml v1.18.0
1212
github.com/itchyny/json2yaml v0.1.4
1313
github.com/muesli/reflow v0.3.0

‎go.sum‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91 h1:payR
1818
github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
1919
github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
2020
github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
21-
github.com/context-dot-dev/context-go-sdk/v2 v2.8.0 h1:K7a/NQIXa4C3VLiF+1cCDyAMGIEnsva2CdkKaYqzC5Q=
22-
github.com/context-dot-dev/context-go-sdk/v2 v2.8.0/go.mod h1:CvRANWLP0FHj5XyUwzEVX79ujdwr/2Jy375UVzKNQm8=
21+
github.com/context-dot-dev/context-go-sdk/v2 v2.9.0 h1:Lv27NRJ1PyQF9QKNjMLYvrc1uRKaBjFD3sj7YHOnGgw=
22+
github.com/context-dot-dev/context-go-sdk/v2 v2.9.0/go.mod h1:CvRANWLP0FHj5XyUwzEVX79ujdwr/2Jy375UVzKNQm8=
2323
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
2424
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
2525
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=

‎pkg/cmd/batch_test.go‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func TestBatchSubmit(t *testing.T) {
8282
t,
8383
"--api-key", "string",
8484
"batch", "submit",
85-
"--input", "{data: {format: markdown, urls: [{url: https://example.com/products/anvil, itemId: sku-1, meta: {category: bar}}, {url: https://example.com/products/hammer, itemId: sku-2, meta: {foo: bar}}], options: {country: de, excludeSelectors: [x], includeImages: true, includeLinks: true, includeSelectors: [x], maxAgeMs: 0, pdf: {end: 1, ocr: 'true', shouldParse: 'true', start: 1}, settleAnimations: true, shortenBase64Images: true, useMainContentOnly: true, waitForMs: 0}}, mode: scrape}",
85+
"--input", "{data: {format: markdown, urls: [{url: https://example.com/products/anvil, itemId: sku-1, meta: {category: bar}}, {url: https://example.com/products/hammer, itemId: sku-2, meta: {foo: bar}}], options: {country: de, excludeSelectors: [x], includeHTML: true, includeImages: true, includeLinks: true, includeSelectors: [x], maxAgeMs: 0, pdf: {end: 1, ocr: true, shouldParse: true, start: 1}, settleAnimations: true, shortenBase64Images: true, useMainContentOnly: true, waitForMs: 0}}, mode: scrape}",
8686
"--tag", "docs",
8787
"--tag", "competitor",
8888
"--webhook-url", "webhookUrl",
@@ -109,15 +109,16 @@ func TestBatchSubmit(t *testing.T) {
109109
" country: de\n" +
110110
" excludeSelectors:\n" +
111111
" - x\n" +
112+
" includeHTML: true\n" +
112113
" includeImages: true\n" +
113114
" includeLinks: true\n" +
114115
" includeSelectors:\n" +
115116
" - x\n" +
116117
" maxAgeMs: 0\n" +
117118
" pdf:\n" +
118119
" end: 1\n" +
119-
" ocr: 'true'\n" +
120-
" shouldParse: 'true'\n" +
120+
" ocr: true\n" +
121+
" shouldParse: true\n" +
121122
" start: 1\n" +
122123
" settleAnimations: true\n" +
123124
" shortenBase64Images: true\n" +

‎pkg/cmd/brand.go‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,20 +154,38 @@ var brandRetrieveSimplified = cli.Command{
154154

155155
var brandSearch = cli.Command{
156156
Name: "search",
157-
Usage: "Search brands by name or domain and get back up to 10 lightweight matches\n(domain, name, logo). Name matches rank ahead of domain matches; within each\ngroup the most popular brands come first: by Tranco rank, then market cap for\nbrands outside the Tranco list, with text relevance breaking ties. Matching is\nprefix-based with no typo tolerance, so it is suited to autocomplete. Only\nbrands already in the Context.dev index are returned — use /brand/retrieve to\nfetch (and index) a specific domain. Free on Pro and Scale plans; costs 1 credit\nper request on the Free and Starter plans.",
157+
Usage: "Search indexed brands by name or domain",
158158
Suggest: true,
159159
Flags: []cli.Flag{
160160
&requestflag.Flag[string]{
161161
Name: "query",
162-
Usage: "Search term, matched against brand names and domains by prefix (e.g. 'nike', 'nike.com', 'nik').",
162+
Usage: "Search term, matched against the fields selected by queryBy (e.g. 'nike', 'nike.com', 'nik').",
163163
Required: true,
164164
QueryPath: "query",
165165
},
166+
&requestflag.Flag[bool]{
167+
Name: "autocomplete",
168+
Usage: "Whether the search term matches by prefix, so partial words match as they are typed (e.g. 'nik' matches Nike). Set to false to match whole words only.",
169+
Default: true,
170+
QueryPath: "autocomplete",
171+
},
172+
&requestflag.Flag[[]string]{
173+
Name: "query-by",
174+
Usage: "Fields to match the search term against, as a comma-separated list or repeated parameter: 'name', 'domain', or both. Defaults to both.",
175+
Default: []string{"name", "domain"},
176+
QueryPath: "queryBy",
177+
},
166178
&requestflag.Flag[[]string]{
167179
Name: "tag",
168180
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.",
169181
QueryPath: "tags",
170182
},
183+
&requestflag.Flag[int64]{
184+
Name: "typo-tolerance",
185+
Usage: "Maximum number of typos tolerated when matching, from 0 to 2. Defaults to 0 (no typo tolerance).",
186+
Default: 0,
187+
QueryPath: "typoTolerance",
188+
},
171189
},
172190
Action: handleBrandSearch,
173191
HideHelpCommand: true,

‎pkg/cmd/brand_test.go‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,11 @@ func TestBrandSearch(t *testing.T) {
7171
"--api-key", "string",
7272
"brand", "search",
7373
"--query", "x",
74+
"--autocomplete=true",
75+
"--query-by", "name",
7476
"--tag", "production",
7577
"--tag", "team-alpha",
78+
"--typo-tolerance", "0",
7679
)
7780
})
7881
}

‎pkg/cmd/cmd.go‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,14 @@ func init() {
187187
&peopleEnrich,
188188
},
189189
},
190+
{
191+
Name: "news",
192+
Category: "API RESOURCE",
193+
Suggest: true,
194+
Commands: []*cli.Command{
195+
&newsSearch,
196+
},
197+
},
190198
{
191199
Name: "@manpages",
192200
Usage: "Generate documentation for 'man'",

‎pkg/cmd/news.go‎

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
package cmd
4+
5+
import (
6+
"context"
7+
"fmt"
8+
9+
"github.com/context-dot-dev/context-dev-cli/internal/apiquery"
10+
"github.com/context-dot-dev/context-dev-cli/internal/requestflag"
11+
"github.com/context-dot-dev/context-go-sdk/v2"
12+
"github.com/context-dot-dev/context-go-sdk/v2/option"
13+
"github.com/tidwall/gjson"
14+
"github.com/urfave/cli/v3"
15+
)
16+
17+
var newsSearch = requestflag.WithInnerFlags(cli.Command{
18+
Name: "search",
19+
Usage: "Searches live and historical company news for one company, identified in\nsearchBy by name, domain, ticker (optionally disambiguated by exchange), or\nISIN. Results can be filtered by publisher domain, publisher country, article\nlanguage, article type, and published-at date, and include stable story IDs,\nsource metadata, verified entity relevance, and cursor pagination.",
20+
Suggest: true,
21+
Flags: []cli.Flag{
22+
&requestflag.Flag[map[string]any]{
23+
Name: "search-by",
24+
Usage: "What to search for.",
25+
Required: true,
26+
BodyPath: "searchBy",
27+
},
28+
&requestflag.Flag[*string]{
29+
Name: "cursor",
30+
Usage: "Opaque next_cursor from the previous response, or null for the first page.",
31+
BodyPath: "cursor",
32+
},
33+
&requestflag.Flag[map[string]any]{
34+
Name: "filter-by",
35+
Usage: "Optional result filters.",
36+
Default: map[string]any{},
37+
BodyPath: "filterBy",
38+
},
39+
&requestflag.Flag[int64]{
40+
Name: "limit",
41+
Usage: "Maximum results to return. Defaults to 10.",
42+
Default: 10,
43+
BodyPath: "limit",
44+
},
45+
&requestflag.Flag[map[string]any]{
46+
Name: "sort-by",
47+
Usage: "Result ordering. Defaults to newest.",
48+
Default: map[string]any{"type": "newest"},
49+
BodyPath: "sortBy",
50+
},
51+
&requestflag.Flag[[]string]{
52+
Name: "tag",
53+
Usage: "Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.",
54+
BodyPath: "tags",
55+
},
56+
},
57+
Action: handleNewsSearch,
58+
HideHelpCommand: true,
59+
}, map[string][]requestflag.HasOuterFlag{
60+
"search-by": {
61+
&requestflag.InnerFlag[map[string]any]{
62+
Name: "search-by.entity",
63+
Usage: "The company to search news for, identified by name, domain, ticker, or ISIN.",
64+
InnerField: "entity",
65+
},
66+
&requestflag.InnerFlag[string]{
67+
Name: "search-by.type",
68+
Usage: "How to search. Only entity search is supported.",
69+
InnerField: "type",
70+
},
71+
},
72+
"filter-by": {
73+
&requestflag.InnerFlag[[]string]{
74+
Name: "filter-by.article-language",
75+
Usage: "Article languages to include. Up to 3.",
76+
InnerField: "articleLanguage",
77+
},
78+
&requestflag.InnerFlag[[]string]{
79+
Name: "filter-by.article-type",
80+
Usage: "Article types to include. Up to 3.",
81+
InnerField: "articleType",
82+
},
83+
&requestflag.InnerFlag[map[string]any]{
84+
Name: "filter-by.date",
85+
Usage: "Published-at window in epoch milliseconds.",
86+
InnerField: "date",
87+
},
88+
&requestflag.InnerFlag[[]string]{
89+
Name: "filter-by.source-country",
90+
Usage: "Publisher countries to include, as lowercase ISO 3166-1 alpha-2 codes. Up to 3.",
91+
InnerField: "sourceCountry",
92+
},
93+
&requestflag.InnerFlag[[]string]{
94+
Name: "filter-by.source-domain",
95+
Usage: "Publisher domains to include. Up to 3.",
96+
InnerField: "sourceDomain",
97+
},
98+
},
99+
"sort-by": {
100+
&requestflag.InnerFlag[string]{
101+
Name: "sort-by.type",
102+
Usage: "Result ordering.",
103+
InnerField: "type",
104+
},
105+
},
106+
})
107+
108+
func handleNewsSearch(ctx context.Context, cmd *cli.Command) error {
109+
client := contextdev.NewClient(getDefaultRequestOptions(cmd)...)
110+
unusedArgs := cmd.Args().Slice()
111+
112+
if len(unusedArgs) > 0 {
113+
return fmt.Errorf("Unexpected extra arguments: %v", unusedArgs)
114+
}
115+
116+
options, err := flagOptions(
117+
cmd,
118+
apiquery.NestedQueryFormatBrackets,
119+
apiquery.ArrayQueryFormatComma,
120+
ApplicationJSON,
121+
false,
122+
)
123+
if err != nil {
124+
return err
125+
}
126+
127+
params := contextdev.NewsSearchParams{}
128+
129+
var res []byte
130+
options = append(options, option.WithResponseBodyInto(&res))
131+
_, err = client.News.Search(ctx, params, options...)
132+
if err != nil {
133+
return err
134+
}
135+
136+
obj := gjson.ParseBytes(res)
137+
format := cmd.Root().String("format")
138+
explicitFormat := cmd.Root().IsSet("format")
139+
transform := cmd.Root().String("transform")
140+
return ShowJSON(obj, ShowJSONOpts{
141+
ExplicitFormat: explicitFormat,
142+
Format: format,
143+
RawOutput: cmd.Root().Bool("raw-output"),
144+
Title: "news search",
145+
Transform: transform,
146+
})
147+
}

0 commit comments

Comments
 (0)