Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.6.0"
".": "0.7.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 36
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-8667763c416101820f5086c97d542bf13bb3bb12b57f5f604da671d9dcea0599.yml
openapi_spec_hash: e33db883d584bc8573897391f3edb105
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-66a3bf68b47ba61c9b61406d36f614a079ff752b8964a8df8062e485391d5598.yml
openapi_spec_hash: b17d6cfe3710dd0605078f3907a1a419
config_hash: 7ec4851ee8d93177947e95df5ae897b5
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 0.7.0 (2026-06-30)

Full Changelog: [v0.6.0...v0.7.0](https://github.com/context-dot-dev/context-dev-cli/compare/v0.6.0...v0.7.0)

### Features

* **api:** api update ([6b8d1cc](https://github.com/context-dot-dev/context-dev-cli/commit/6b8d1cc9593681bdee01369a730094ebca3d6fc4))
* **api:** api update ([1722d54](https://github.com/context-dot-dev/context-dev-cli/commit/1722d543bb09c25729bf6af74de4642c77b3b078))

## 0.6.0 (2026-06-29)

Full Changelog: [v0.5.0...v0.6.0](https://github.com/context-dot-dev/context-dev-cli/compare/v0.5.0...v0.6.0)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/charmbracelet/bubbletea v1.3.6
github.com/charmbracelet/lipgloss v1.1.0
github.com/charmbracelet/x/term v0.2.1
github.com/context-dot-dev/context-go-sdk v1.3.0
github.com/context-dot-dev/context-go-sdk v1.4.0
github.com/goccy/go-yaml v1.18.0
github.com/itchyny/json2yaml v0.1.4
github.com/muesli/reflow v0.3.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91 h1:payR
github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
github.com/context-dot-dev/context-go-sdk v1.3.0 h1:OyRxjHshWXnF8At15QOLpYJ5913Ytt7az7PviGVxbJA=
github.com/context-dot-dev/context-go-sdk v1.3.0/go.mod h1:YwbwUXSpQRB5LdVmgyIyZhIgKyulaeQmVWxylI4KE54=
github.com/context-dot-dev/context-go-sdk v1.4.0 h1:UiQeIP5oCFIRpgklVo+tlZahUh9AsqVi3vek2kLYqSE=
github.com/context-dot-dev/context-go-sdk v1.4.0/go.mod h1:YwbwUXSpQRB5LdVmgyIyZhIgKyulaeQmVWxylI4KE54=
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
Expand Down
54 changes: 29 additions & 25 deletions pkg/cmd/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var monitorsCreate = requestflag.WithInnerFlags(cli.Command{
Flags: []cli.Flag{
&requestflag.Flag[map[string]any]{
Name: "change-detection",
Usage: "Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.",
Usage: "Discriminated union describing how changes are detected.",
Required: true,
BodyPath: "change_detection",
},
Expand All @@ -38,9 +38,15 @@ var monitorsCreate = requestflag.WithInnerFlags(cli.Command{
},
&requestflag.Flag[map[string]any]{
Name: "target",
Usage: "Discriminated union describing what the monitor watches.",
Required: true,
BodyPath: "target",
},
&requestflag.Flag[string]{
Name: "mode",
Usage: "Top-level monitor category. Always `web` today; the concrete behavior is described by `target` and `change_detection`.",
BodyPath: "mode",
},
&requestflag.Flag[[]string]{
Name: "tag",
Usage: "User-defined tags for grouping and filtering monitors and their changes.",
Expand All @@ -54,13 +60,6 @@ var monitorsCreate = requestflag.WithInnerFlags(cli.Command{
Action: handleMonitorsCreate,
HideHelpCommand: true,
}, map[string][]requestflag.HasOuterFlag{
"change-detection": {
&requestflag.InnerFlag[string]{
Name: "change-detection.type",
Usage: `Allowed values: "exact".`,
InnerField: "type",
},
},
"schedule": {
&requestflag.InnerFlag[int64]{
Name: "schedule.frequency",
Expand All @@ -78,22 +77,6 @@ var monitorsCreate = requestflag.WithInnerFlags(cli.Command{
InnerField: "unit",
},
},
"target": {
&requestflag.InnerFlag[string]{
Name: "target.type",
Usage: `Allowed values: "page".`,
InnerField: "type",
},
&requestflag.InnerFlag[string]{
Name: "target.url",
InnerField: "url",
},
&requestflag.InnerFlag[bool]{
Name: "target.normalize-whitespace",
Usage: "Normalize whitespace before comparing or analyzing text.",
InnerField: "normalize_whitespace",
},
},
"webhook": {
&requestflag.InnerFlag[string]{
Name: "webhook.url",
Expand Down Expand Up @@ -204,7 +187,7 @@ var monitorsUpdate = requestflag.WithInnerFlags(cli.Command{

var monitorsList = cli.Command{
Name: "list",
Usage: "List monitors",
Usage: "Lists monitors for the authenticated organization. Supports free-text search\n(`q` over `search_by` fields, `prefix` or `exact` via `search_type`) plus\nstatus/type/tag filters. Results are paginated via the opaque `cursor`.",
Suggest: true,
Flags: []cli.Flag{
&requestflag.Flag[string]{
Expand All @@ -221,6 +204,22 @@ var monitorsList = cli.Command{
Default: 25,
QueryPath: "limit",
},
&requestflag.Flag[string]{
Name: "q",
Usage: "Free-text search term, matched against the fields named in `search_by`.",
QueryPath: "q",
},
&requestflag.Flag[[]string]{
Name: "search-by",
Usage: "Comma-separated fields to search with `q`. Defaults to all of them. Note `query` only exists on semantic monitors.",
QueryPath: "search_by",
},
&requestflag.Flag[string]{
Name: "search-type",
Usage: "`prefix` for as-you-type prefix matching (default), `exact` for full-token matching.",
Default: "prefix",
QueryPath: "search_type",
},
&requestflag.Flag[string]{
Name: "status",
Usage: `Allowed values: "active", "paused", "failed".`,
Expand All @@ -231,6 +230,11 @@ var monitorsList = cli.Command{
Usage: "Filter to items that have this tag.",
QueryPath: "tag",
},
&requestflag.Flag[[]string]{
Name: "tag",
Usage: "Comma-separated list of tags to filter by (matches monitors having any of them).",
QueryPath: "tags",
},
&requestflag.Flag[string]{
Name: "target-type",
Usage: `Allowed values: "page", "sitemap", "extract".`,
Expand Down
19 changes: 12 additions & 7 deletions pkg/cmd/monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ func TestMonitorsCreate(t *testing.T) {
"--api-key", "string",
"monitors", "create",
"--change-detection", "{type: exact}",
"--name", "Acme pricing monitor",
"--name", "Acme pricing page",
"--schedule", "{frequency: 6, type: interval, unit: hours}",
"--target", "{type: page, url: https://acme.com/pricing, normalize_whitespace: true}",
"--mode", "web",
"--tag", "pricing",
"--tag", "competitor",
"--webhook", "{url: https://example.com/webhook}",
Expand All @@ -35,14 +36,13 @@ func TestMonitorsCreate(t *testing.T) {
t,
"--api-key", "string",
"monitors", "create",
"--change-detection.type", "exact",
"--name", "Acme pricing monitor",
"--change-detection", "{type: exact}",
"--name", "Acme pricing page",
"--schedule.frequency", "6",
"--schedule.type", "interval",
"--schedule.unit", "hours",
"--target.type", "page",
"--target.url", "https://acme.com/pricing",
"--target.normalize-whitespace=true",
"--target", "{type: page, url: https://acme.com/pricing, normalize_whitespace: true}",
"--mode", "web",
"--tag", "pricing",
"--tag", "competitor",
"--webhook.url", "https://example.com/webhook",
Expand All @@ -54,7 +54,7 @@ func TestMonitorsCreate(t *testing.T) {
pipeData := []byte("" +
"change_detection:\n" +
" type: exact\n" +
"name: Acme pricing monitor\n" +
"name: Acme pricing page\n" +
"schedule:\n" +
" frequency: 6\n" +
" type: interval\n" +
Expand All @@ -63,6 +63,7 @@ func TestMonitorsCreate(t *testing.T) {
" type: page\n" +
" url: https://acme.com/pricing\n" +
" normalize_whitespace: true\n" +
"mode: web\n" +
"tags:\n" +
" - pricing\n" +
" - competitor\n" +
Expand Down Expand Up @@ -169,8 +170,12 @@ func TestMonitorsList(t *testing.T) {
"--change-detection-type", "exact",
"--cursor", "cursor",
"--limit", "1",
"--q", "q",
"--search-by", "name",
"--search-type", "exact",
"--status", "active",
"--tag", "tag",
"--tag", "string",
"--target-type", "page",
)
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

package cmd

const Version = "0.6.0" // x-release-please-version
const Version = "0.7.0" // x-release-please-version
Loading