Skip to content

Commit f28afe7

Browse files
authored
Merge pull request #20 from context-dot-dev/release-please--branches--main--changes--next
release: 1.4.0
2 parents d5562ff + 3e027db commit f28afe7

9 files changed

Lines changed: 95 additions & 9 deletions

File tree

.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.3.0"
2+
".": "1.4.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: 37
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-758c3a2fbd5b7be61c8e6e0ad2e6a5ec30695747bb675960d888c497647d13d7.yml
3-
openapi_spec_hash: 00002d90bde02f67e174368ae470c597
4-
config_hash: 2bea1743c84d63bd61f8501a6ea63065
1+
configured_endpoints: 38
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-155e4761d62255841349c0f8a01b0a9c463ea1d1f2d6c4fd8d1a75c8bef6f226.yml
3+
openapi_spec_hash: ab91f77e7c9d992400cbc7fc8a9e76c1
4+
config_hash: bff282047fafdad771fb7ec685f56944

CHANGELOG.md

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

3+
## 1.4.0 (2026-08-05)
4+
5+
Full Changelog: [v1.3.0...v1.4.0](https://github.com/context-dot-dev/context-dev-cli/compare/v1.3.0...v1.4.0)
6+
7+
### Features
8+
9+
* **api:** api update ([90cad89](https://github.com/context-dot-dev/context-dev-cli/commit/90cad89d5524f42fcd1e84e040bc19ab3e9d1052))
10+
* **api:** manual updates ([0a31daa](https://github.com/context-dot-dev/context-dev-cli/commit/0a31daa87ff77541579b3e9147c08981779c073f))
11+
312
## 1.3.0 (2026-08-01)
413

514
Full Changelog: [v1.2.0...v1.3.0](https://github.com/context-dot-dev/context-dev-cli/compare/v1.2.0...v1.3.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.6.0
10+
github.com/context-dot-dev/context-go-sdk/v2 v2.7.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.6.0 h1:Ek9DAp3uuXNZRKojMOf4Y6I11PHnXuQQFtvT4vi0BDE=
22-
github.com/context-dot-dev/context-go-sdk/v2 v2.6.0/go.mod h1:CvRANWLP0FHj5XyUwzEVX79ujdwr/2Jy375UVzKNQm8=
21+
github.com/context-dot-dev/context-go-sdk/v2 v2.7.0 h1:zc4xevss1ms1jge3wTn0qgynanmORhvFJav8eLfaiIY=
22+
github.com/context-dot-dev/context-go-sdk/v2 v2.7.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/brand.go

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,27 @@ var brandRetrieveSimplified = cli.Command{
152152
HideHelpCommand: true,
153153
}
154154

155+
var brandSearch = cli.Command{
156+
Name: "search",
157+
Usage: "Search brands by name or domain and get back up to 10 lightweight matches\n(domain, name, logo), most popular 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.",
158+
Suggest: true,
159+
Flags: []cli.Flag{
160+
&requestflag.Flag[string]{
161+
Name: "query",
162+
Usage: "Search term, matched against brand names and domains by prefix (e.g. 'nike', 'nike.com', 'nik').",
163+
Required: true,
164+
QueryPath: "query",
165+
},
166+
&requestflag.Flag[[]string]{
167+
Name: "tag",
168+
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.",
169+
QueryPath: "tags",
170+
},
171+
},
172+
Action: handleBrandSearch,
173+
HideHelpCommand: true,
174+
}
175+
155176
func handleBrandRetrieve(ctx context.Context, cmd *cli.Command) error {
156177
client := contextdev.NewClient(getDefaultRequestOptions(cmd)...)
157178
unusedArgs := cmd.Args().Slice()
@@ -233,3 +254,44 @@ func handleBrandRetrieveSimplified(ctx context.Context, cmd *cli.Command) error
233254
Transform: transform,
234255
})
235256
}
257+
258+
func handleBrandSearch(ctx context.Context, cmd *cli.Command) error {
259+
client := contextdev.NewClient(getDefaultRequestOptions(cmd)...)
260+
unusedArgs := cmd.Args().Slice()
261+
262+
if len(unusedArgs) > 0 {
263+
return fmt.Errorf("Unexpected extra arguments: %v", unusedArgs)
264+
}
265+
266+
options, err := flagOptions(
267+
cmd,
268+
apiquery.NestedQueryFormatBrackets,
269+
apiquery.ArrayQueryFormatComma,
270+
EmptyBody,
271+
false,
272+
)
273+
if err != nil {
274+
return err
275+
}
276+
277+
params := contextdev.BrandSearchParams{}
278+
279+
var res []byte
280+
options = append(options, option.WithResponseBodyInto(&res))
281+
_, err = client.Brand.Search(ctx, params, options...)
282+
if err != nil {
283+
return err
284+
}
285+
286+
obj := gjson.ParseBytes(res)
287+
format := cmd.Root().String("format")
288+
explicitFormat := cmd.Root().IsSet("format")
289+
transform := cmd.Root().String("transform")
290+
return ShowJSON(obj, ShowJSONOpts{
291+
ExplicitFormat: explicitFormat,
292+
Format: format,
293+
RawOutput: cmd.Root().Bool("raw-output"),
294+
Title: "brand search",
295+
Transform: transform,
296+
})
297+
}

pkg/cmd/brand_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,17 @@ func TestBrandRetrieveSimplified(t *testing.T) {
6262
)
6363
})
6464
}
65+
66+
func TestBrandSearch(t *testing.T) {
67+
t.Skip("Mock server tests are disabled")
68+
t.Run("regular flags", func(t *testing.T) {
69+
mocktest.TestRunMockTestWithFlags(
70+
t,
71+
"--api-key", "string",
72+
"brand", "search",
73+
"--query", "x",
74+
"--tag", "production",
75+
"--tag", "team-alpha",
76+
)
77+
})
78+
}

pkg/cmd/cmd.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ func init() {
126126
Commands: []*cli.Command{
127127
&brandRetrieve,
128128
&brandRetrieveSimplified,
129+
&brandSearch,
129130
},
130131
},
131132
{

pkg/cmd/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
package cmd
44

5-
const Version = "1.3.0" // x-release-please-version
5+
const Version = "1.4.0" // x-release-please-version

0 commit comments

Comments
 (0)