Skip to content
Open
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 @@
{
".": "1.1.0"
".": "1.2.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: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-242450ea46eb8c3e843fd6c4bf87e73192b5f62f6da697cd091d13c6aa7a991b.yml
openapi_spec_hash: c1c561976de1abcacede71fd5ab9b3d9
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-91f4286859fc23813c5255b877395c87dd81520c3913fdfdae3cfa343e1a4873.yml
openapi_spec_hash: 71746b5b65f20617ee021e071d5f7f92
config_hash: 70e7e80b5e87f94981bee396c6cd41e8
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 1.2.0 (2026-07-27)

Full Changelog: [v1.1.0...v1.2.0](https://github.com/context-dot-dev/context-dev-cli/compare/v1.1.0...v1.2.0)

### Features

* **api:** api update ([b8de4ec](https://github.com/context-dot-dev/context-dev-cli/commit/b8de4ec1e8a39c97e3bbf04dd259c9fa3e8aa44f))
* **api:** api update ([3c2c3c2](https://github.com/context-dot-dev/context-dev-cli/commit/3c2c3c2daf40ad8df4df6b9861ed88291b539f91))
* **api:** api update ([0b487b1](https://github.com/context-dot-dev/context-dev-cli/commit/0b487b175434d6db1ce66501382164a55b68c557))


### Chores

* **internal:** codegen related update ([87780eb](https://github.com/context-dot-dev/context-dev-cli/commit/87780eb7d4bbb0df65fde3ecfbc74bfa191c04b7))

## 1.1.0 (2026-07-22)

Full Changelog: [v1.0.0...v1.1.0](https://github.com/context-dot-dev/context-dev-cli/compare/v1.0.0...v1.1.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/v2 v2.4.0
github.com/context-dot-dev/context-go-sdk/v2 v2.5.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/v2 v2.4.0 h1:mehuyGuUzgflR7rQpSlPaH7lNj2A8hdtf1+WG4U4h1I=
github.com/context-dot-dev/context-go-sdk/v2 v2.4.0/go.mod h1:CvRANWLP0FHj5XyUwzEVX79ujdwr/2Jy375UVzKNQm8=
github.com/context-dot-dev/context-go-sdk/v2 v2.5.0 h1:FK79MDMznyABXAUjRGO44Xmvl6Bi0nz1HBSlwYyMU6U=
github.com/context-dot-dev/context-go-sdk/v2 v2.5.0/go.mod h1:CvRANWLP0FHj5XyUwzEVX79ujdwr/2Jy375UVzKNQm8=
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
22 changes: 10 additions & 12 deletions pkg/cmd/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,32 @@ var monitorsCreate = requestflag.WithInnerFlags(cli.Command{
Usage: "Creates a monitor. The request body is a union of the supported target/change\ndetection combinations. The monitor runs immediately after creation to create\nits initial baseline.",
Suggest: true,
Flags: []cli.Flag{
&requestflag.Flag[map[string]any]{
Name: "change-detection",
Usage: "Discriminated union describing how changes are detected.",
Required: true,
BodyPath: "change_detection",
},
&requestflag.Flag[string]{
Name: "name",
Required: true,
BodyPath: "name",
},
&requestflag.Flag[map[string]any]{
Name: "schedule",
Usage: "Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.",
Required: true,
BodyPath: "schedule",
},
&requestflag.Flag[map[string]any]{
Name: "target",
Usage: "Discriminated union describing what the monitor watches.",
Required: true,
BodyPath: "target",
},
&requestflag.Flag[map[string]any]{
Name: "change-detection",
Usage: "Discriminated union describing how changes are detected.",
BodyPath: "change_detection",
},
&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[map[string]any]{
Name: "schedule",
Usage: "Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.",
BodyPath: "schedule",
},
&requestflag.Flag[[]string]{
Name: "tag",
Usage: "User-defined tags for grouping and filtering monitors and their changes. Duplicates are removed.",
Expand Down
34 changes: 20 additions & 14 deletions pkg/cmd/monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ func TestMonitorsCreate(t *testing.T) {
t,
"--api-key", "string",
"monitors", "create",
"--change-detection", "{type: exact}",
"--name", "Acme pricing page",
"--schedule", "{frequency: 6, type: interval, unit: hours}",
"--target", "{type: page, url: https://acme.com/pricing, normalize_whitespace: true}",
"--target", "{type: page, url: https://acme.com/pricing, instructions: 'Report pricing or plan availability changes. Ignore counters, timestamps, testimonials, and navigation.', normalize_whitespace: true}",
"--change-detection", "{type: exact}",
"--mode", "web",
"--schedule", "{frequency: 6, type: interval, unit: hours}",
"--tag", "pricing",
"--tag", "competitor",
"--webhook", "{url: https://example.com/webhook, events: [change.detected, run.completed]}",
Expand All @@ -36,13 +36,13 @@ func TestMonitorsCreate(t *testing.T) {
t,
"--api-key", "string",
"monitors", "create",
"--change-detection", "{type: exact}",
"--name", "Acme pricing page",
"--target", "{type: page, url: https://acme.com/pricing, instructions: 'Report pricing or plan availability changes. Ignore counters, timestamps, testimonials, and navigation.', normalize_whitespace: true}",
"--change-detection", "{type: exact}",
"--mode", "web",
"--schedule.frequency", "6",
"--schedule.type", "interval",
"--schedule.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 @@ -53,18 +53,21 @@ func TestMonitorsCreate(t *testing.T) {
t.Run("piping data", func(t *testing.T) {
// Test piping YAML data over stdin
pipeData := []byte("" +
"change_detection:\n" +
" type: exact\n" +
"name: Acme pricing page\n" +
"schedule:\n" +
" frequency: 6\n" +
" type: interval\n" +
" unit: hours\n" +
"target:\n" +
" type: page\n" +
" url: https://acme.com/pricing\n" +
" instructions: >-\n" +
" Report pricing or plan availability changes. Ignore counters, timestamps,\n" +
" testimonials, and navigation.\n" +
" normalize_whitespace: true\n" +
"change_detection:\n" +
" type: exact\n" +
"mode: web\n" +
"schedule:\n" +
" frequency: 6\n" +
" type: interval\n" +
" unit: hours\n" +
"tags:\n" +
" - pricing\n" +
" - competitor\n" +
Expand Down Expand Up @@ -107,7 +110,7 @@ func TestMonitorsUpdate(t *testing.T) {
"--status", "active",
"--tag", "pricing",
"--tag", "competitor",
"--target", "{type: page, url: https://acme.com/pricing, normalize_whitespace: true}",
"--target", "{type: page, url: https://acme.com/pricing, instructions: 'Report pricing or plan availability changes. Ignore counters, timestamps, testimonials, and navigation.', normalize_whitespace: true}",
"--webhook", "{url: https://example.com/webhook, events: [change.detected, run.completed]}",
)
})
Expand All @@ -130,7 +133,7 @@ func TestMonitorsUpdate(t *testing.T) {
"--status", "active",
"--tag", "pricing",
"--tag", "competitor",
"--target", "{type: page, url: https://acme.com/pricing, normalize_whitespace: true}",
"--target", "{type: page, url: https://acme.com/pricing, instructions: 'Report pricing or plan availability changes. Ignore counters, timestamps, testimonials, and navigation.', normalize_whitespace: true}",
"--webhook.url", "https://example.com/webhook",
"--webhook.events", "[change.detected, run.completed]",
)
Expand All @@ -153,6 +156,9 @@ func TestMonitorsUpdate(t *testing.T) {
"target:\n" +
" type: page\n" +
" url: https://acme.com/pricing\n" +
" instructions: >-\n" +
" Report pricing or plan availability changes. Ignore counters, timestamps,\n" +
" testimonials, and navigation.\n" +
" normalize_whitespace: true\n" +
"webhook:\n" +
" url: https://example.com/webhook\n" +
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 = "1.1.0" // x-release-please-version
const Version = "1.2.0" // x-release-please-version
Loading