Skip to content

Commit 8431a98

Browse files
authored
Merge pull request #21 from context-dot-dev/release-please--branches--main--changes--next
release: 1.5.0
2 parents f28afe7 + 943665e commit 8431a98

15 files changed

Lines changed: 417 additions & 62 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.4.0"
2+
".": "1.5.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: 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
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

CHANGELOG.md

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

3+
## 1.5.0 (2026-08-07)
4+
5+
Full Changelog: [v1.4.0...v1.5.0](https://github.com/context-dot-dev/context-dev-cli/compare/v1.4.0...v1.5.0)
6+
7+
### Features
8+
9+
* **api:** api update ([e21a8ff](https://github.com/context-dot-dev/context-dev-cli/commit/e21a8ff46d495a59b9c751965bb9d980a0765c78))
10+
* **api:** api update ([48a68cb](https://github.com/context-dot-dev/context-dev-cli/commit/48a68cb9ad422157ee55deef66773a161e320f44))
11+
* **api:** api update ([ad50292](https://github.com/context-dot-dev/context-dev-cli/commit/ad502925051676385440177ba5a4113631ff2dfa))
12+
* **api:** api update ([5650e87](https://github.com/context-dot-dev/context-dev-cli/commit/5650e87248bd4d1dabd6027007f510650684d511))
13+
* **api:** api update ([4ca42b8](https://github.com/context-dot-dev/context-dev-cli/commit/4ca42b8b8bdbe6750a50db1bc39b4ff098346f65))
14+
* **api:** api update ([92be0b6](https://github.com/context-dot-dev/context-dev-cli/commit/92be0b69f74d40bddb2748939d27c5b9f2660f46))
15+
* **api:** manual updates ([35e256a](https://github.com/context-dot-dev/context-dev-cli/commit/35e256a85572f24f11f89dbc452a7fa81640cef3))
16+
317
## 1.4.0 (2026-08-05)
418

519
Full Changelog: [v1.3.0...v1.4.0](https://github.com/context-dot-dev/context-dev-cli/compare/v1.3.0...v1.4.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.7.0
10+
github.com/context-dot-dev/context-go-sdk/v2 v2.8.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.7.0 h1:zc4xevss1ms1jge3wTn0qgynanmORhvFJav8eLfaiIY=
22-
github.com/context-dot-dev/context-go-sdk/v2 v2.7.0/go.mod h1:CvRANWLP0FHj5XyUwzEVX79ujdwr/2Jy375UVzKNQm8=
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=
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.go

Lines changed: 74 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,22 @@ var batchList = cli.Command{
7070
HideHelpCommand: true,
7171
}
7272

73+
var batchDelete = cli.Command{
74+
Name: "delete",
75+
Usage: "Permanently delete a finished batch and its stored results. Active batches must\nsettle first.",
76+
Suggest: true,
77+
Flags: []cli.Flag{
78+
&requestflag.Flag[string]{
79+
Name: "batch-id",
80+
Usage: "ID of the batch to retrieve or cancel.",
81+
Required: true,
82+
PathParam: "batch_id",
83+
},
84+
},
85+
Action: handleBatchDelete,
86+
HideHelpCommand: true,
87+
}
88+
7389
var batchCancel = cli.Command{
7490
Name: "cancel",
7591
Usage: "Stop a batch from starting new pages. In-progress pages finish, and unused\ncredits are refunded.",
@@ -112,39 +128,36 @@ var batchGetResults = cli.Command{
112128
HideHelpCommand: true,
113129
}
114130

115-
var batchSubmit = requestflag.WithInnerFlags(cli.Command{
131+
var batchSubmit = cli.Command{
116132
Name: "submit",
117-
Usage: "Retrieve and normalize a person profile from identifiers.",
133+
Usage: "Scrape 25K URLs or crawl large websites asynchronously.",
118134
Suggest: true,
119135
Flags: []cli.Flag{
120136
&requestflag.Flag[map[string]any]{
121-
Name: "identifiers",
122-
Usage: "Known identifiers for the person. At least one identifier is required.",
137+
Name: "input",
138+
Usage: "Choose a URL list or a site crawl.",
123139
Required: true,
124-
BodyPath: "identifiers",
140+
BodyPath: "input",
125141
},
126142
&requestflag.Flag[[]string]{
127143
Name: "tag",
128-
Usage: "Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.",
144+
Usage: "Tags stored on the batch. Filter the batch list by them later.",
129145
BodyPath: "tags",
130146
},
131-
&requestflag.Flag[int64]{
132-
Name: "timeout-ms",
133-
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).",
134-
BodyPath: "timeoutMS",
147+
&requestflag.Flag[string]{
148+
Name: "webhook-url",
149+
Usage: "URL notified when the batch finishes.",
150+
BodyPath: "webhookUrl",
151+
},
152+
&requestflag.Flag[string]{
153+
Name: "idempotency-key",
154+
Usage: "Any string unique to this submission. Retries with the same key return the original batch.",
155+
HeaderPath: "Idempotency-Key",
135156
},
136157
},
137158
Action: handleBatchSubmit,
138159
HideHelpCommand: true,
139-
}, map[string][]requestflag.HasOuterFlag{
140-
"identifiers": {
141-
&requestflag.InnerFlag[string]{
142-
Name: "identifiers.linkedin-url",
143-
Usage: "LinkedIn profile URL, e.g. https://www.linkedin.com/in/yahia-bakour/.",
144-
InnerField: "linkedinUrl",
145-
},
146-
},
147-
})
160+
}
148161

149162
func handleBatchRetrieve(ctx context.Context, cmd *cli.Command) error {
150163
client := contextdev.NewClient(getDefaultRequestOptions(cmd)...)
@@ -229,6 +242,48 @@ func handleBatchList(ctx context.Context, cmd *cli.Command) error {
229242
})
230243
}
231244

245+
func handleBatchDelete(ctx context.Context, cmd *cli.Command) error {
246+
client := contextdev.NewClient(getDefaultRequestOptions(cmd)...)
247+
unusedArgs := cmd.Args().Slice()
248+
if !cmd.IsSet("batch-id") && len(unusedArgs) > 0 {
249+
cmd.Set("batch-id", unusedArgs[0])
250+
unusedArgs = unusedArgs[1:]
251+
}
252+
if len(unusedArgs) > 0 {
253+
return fmt.Errorf("Unexpected extra arguments: %v", unusedArgs)
254+
}
255+
256+
options, err := flagOptions(
257+
cmd,
258+
apiquery.NestedQueryFormatBrackets,
259+
apiquery.ArrayQueryFormatComma,
260+
EmptyBody,
261+
false,
262+
)
263+
if err != nil {
264+
return err
265+
}
266+
267+
var res []byte
268+
options = append(options, option.WithResponseBodyInto(&res))
269+
_, err = client.Batch.Delete(ctx, cmd.Value("batch-id").(string), options...)
270+
if err != nil {
271+
return err
272+
}
273+
274+
obj := gjson.ParseBytes(res)
275+
format := cmd.Root().String("format")
276+
explicitFormat := cmd.Root().IsSet("format")
277+
transform := cmd.Root().String("transform")
278+
return ShowJSON(obj, ShowJSONOpts{
279+
ExplicitFormat: explicitFormat,
280+
Format: format,
281+
RawOutput: cmd.Root().Bool("raw-output"),
282+
Title: "batch delete",
283+
Transform: transform,
284+
})
285+
}
286+
232287
func handleBatchCancel(ctx context.Context, cmd *cli.Command) error {
233288
client := contextdev.NewClient(getDefaultRequestOptions(cmd)...)
234289
unusedArgs := cmd.Args().Slice()

pkg/cmd/batch_test.go

Lines changed: 52 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"testing"
77

88
"github.com/context-dot-dev/context-dev-cli/internal/mocktest"
9-
"github.com/context-dot-dev/context-dev-cli/internal/requestflag"
109
)
1110

1211
func TestBatchRetrieve(t *testing.T) {
@@ -38,6 +37,18 @@ func TestBatchList(t *testing.T) {
3837
})
3938
}
4039

40+
func TestBatchDelete(t *testing.T) {
41+
t.Skip("Mock server tests are disabled")
42+
t.Run("regular flags", func(t *testing.T) {
43+
mocktest.TestRunMockTestWithFlags(
44+
t,
45+
"--api-key", "string",
46+
"batch", "delete",
47+
"--batch-id", "batch_9f2c8a",
48+
)
49+
})
50+
}
51+
4152
func TestBatchCancel(t *testing.T) {
4253
t.Skip("Mock server tests are disabled")
4354
t.Run("regular flags", func(t *testing.T) {
@@ -71,42 +82,57 @@ func TestBatchSubmit(t *testing.T) {
7182
t,
7283
"--api-key", "string",
7384
"batch", "submit",
74-
"--identifiers", "{linkedinUrl: https://www.linkedin.com/in/yahia-bakour/}",
75-
"--tag", "production",
76-
"--tag", "team-alpha",
77-
"--timeout-ms", "1000",
78-
)
79-
})
80-
81-
t.Run("inner flags", func(t *testing.T) {
82-
// Check that inner flags have been set up correctly
83-
requestflag.CheckInnerFlags(batchSubmit)
84-
85-
// Alternative argument passing style using inner flags
86-
mocktest.TestRunMockTestWithFlags(
87-
t,
88-
"--api-key", "string",
89-
"batch", "submit",
90-
"--identifiers.linkedin-url", "https://www.linkedin.com/in/yahia-bakour/",
91-
"--tag", "production",
92-
"--tag", "team-alpha",
93-
"--timeout-ms", "1000",
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}",
86+
"--tag", "docs",
87+
"--tag", "competitor",
88+
"--webhook-url", "webhookUrl",
89+
"--idempotency-key", "Idempotency-Key",
9490
)
9591
})
9692

9793
t.Run("piping data", func(t *testing.T) {
9894
// Test piping YAML data over stdin
9995
pipeData := []byte("" +
100-
"identifiers:\n" +
101-
" linkedinUrl: https://www.linkedin.com/in/yahia-bakour/\n" +
96+
"input:\n" +
97+
" data:\n" +
98+
" format: markdown\n" +
99+
" urls:\n" +
100+
" - url: https://example.com/products/anvil\n" +
101+
" itemId: sku-1\n" +
102+
" meta:\n" +
103+
" category: bar\n" +
104+
" - url: https://example.com/products/hammer\n" +
105+
" itemId: sku-2\n" +
106+
" meta:\n" +
107+
" foo: bar\n" +
108+
" options:\n" +
109+
" country: de\n" +
110+
" excludeSelectors:\n" +
111+
" - x\n" +
112+
" includeImages: true\n" +
113+
" includeLinks: true\n" +
114+
" includeSelectors:\n" +
115+
" - x\n" +
116+
" maxAgeMs: 0\n" +
117+
" pdf:\n" +
118+
" end: 1\n" +
119+
" ocr: 'true'\n" +
120+
" shouldParse: 'true'\n" +
121+
" start: 1\n" +
122+
" settleAnimations: true\n" +
123+
" shortenBase64Images: true\n" +
124+
" useMainContentOnly: true\n" +
125+
" waitForMs: 0\n" +
126+
" mode: scrape\n" +
102127
"tags:\n" +
103-
" - production\n" +
104-
" - team-alpha\n" +
105-
"timeoutMS: 1000\n")
128+
" - docs\n" +
129+
" - competitor\n" +
130+
"webhookUrl: webhookUrl\n")
106131
mocktest.TestRunMockTestWithPipeAndFlags(
107132
t, pipeData,
108133
"--api-key", "string",
109134
"batch", "submit",
135+
"--idempotency-key", "Idempotency-Key",
110136
)
111137
})
112138
}

pkg/cmd/brand.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ 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), 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.",
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.",
158158
Suggest: true,
159159
Flags: []cli.Flag{
160160
&requestflag.Flag[string]{

pkg/cmd/cmd.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,20 @@ func init() {
173173
Commands: []*cli.Command{
174174
&batchRetrieve,
175175
&batchList,
176+
&batchDelete,
176177
&batchCancel,
177178
&batchGetResults,
178179
&batchSubmit,
179180
},
180181
},
182+
{
183+
Name: "people",
184+
Category: "API RESOURCE",
185+
Suggest: true,
186+
Commands: []*cli.Command{
187+
&peopleEnrich,
188+
},
189+
},
181190
{
182191
Name: "@manpages",
183192
Usage: "Generate documentation for 'man'",

pkg/cmd/parse.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ var parseHandle = requestflag.WithInnerFlags(cli.Command{
5151
},
5252
&requestflag.Flag[any]{
5353
Name: "ocr",
54-
Usage: "When true for PDF inputs, detect and OCR images embedded in the selected pages, inserting recognized text at each image's position in page reading order while preserving the PDF text layer. pdf.start/pdf.end limit the inclusive page range. When false, all OCR is disabled, including the automatic scanned-PDF fallback.",
54+
Usage: "When true for PDF inputs, OCR the selected 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. pdf.start/pdf.end limit the inclusive page range. Billed at 1 credit per page OCR actually recovered, on top of the base request cost. When false, no OCR runs.",
5555
Default: false,
5656
QueryPath: "ocr",
5757
},

0 commit comments

Comments
 (0)