Skip to content
Closed
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 @@
{
".": "3.2.0"
".": "3.3.0"
}
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
# Changelog

## 3.3.0 (2026-04-02)

Full Changelog: [v3.2.0...v3.3.0](https://github.com/trycourier/courier-cli/compare/v3.2.0...v3.3.0)

### Features

* add default description for enum CLI flags without an explicit description ([823fab6](https://github.com/trycourier/courier-cli/commit/823fab6fa75bcfc8ee2e8d5dca70b2f7db36a967))
* **api:** add create/retrieve/archive/publish/replace methods, event-id param to notifications ([f586c70](https://github.com/trycourier/courier-cli/commit/f586c70a88de4be8995c0ef384eefe56a326e1de))
* **api:** add providers CRUD and catalog list endpoints ([63678ee](https://github.com/trycourier/courier-cli/commit/63678ee1d1186dae6503dca94c243144d366b470))
* **api:** add routing-strategies resource ([b890b18](https://github.com/trycourier/courier-cli/commit/b890b182dece67bd2c4d7f85ec800e22bc59c1bd))
* set CLI flag constant values automatically where `x-stainless-const` is set ([614f808](https://github.com/trycourier/courier-cli/commit/614f808e7334e3adae68d5496319a666f50be09c))


### Bug Fixes

* avoid reading from stdin unless request body is form encoded or json ([492dabf](https://github.com/trycourier/courier-cli/commit/492dabffb192428fcd123625cdbc5272c7aee16a))
* better support passing client args in any position ([1dad6ae](https://github.com/trycourier/courier-cli/commit/1dad6ae70c2fa1647dc1ba5fce44c53bef9fd00a))
* cli no longer hangs when stdin is attached to a pipe with empty input ([5fe52d1](https://github.com/trycourier/courier-cli/commit/5fe52d1a064f7c4b2346bbacc350ac737ead2081))
* fix for off-by-one error in pagination logic ([07c0b32](https://github.com/trycourier/courier-cli/commit/07c0b323427405e86bc80b01d489e79b1b6db3d5))
* handle empty data set using `--format explore` ([4f47249](https://github.com/trycourier/courier-cli/commit/4f4724971e9e79203aecada10d2f04316270ae70))
* improve linking behavior when developing on a branch not in the Go SDK ([4dd8baf](https://github.com/trycourier/courier-cli/commit/4dd8bafb13bed2cf62ff5f3ea77e92a151d11154))
* improved workflow for developing on branches ([f99f909](https://github.com/trycourier/courier-cli/commit/f99f909d00174b9325924e53d23c8e0939d2b1b7))
* no longer require an API key when building on production repos ([d125b34](https://github.com/trycourier/courier-cli/commit/d125b3498d30b59ee7c28a062ff54c3df942e9e0))
* only set client options when the corresponding CLI flag or env var is explicitly set ([a428dd5](https://github.com/trycourier/courier-cli/commit/a428dd5b300cb862478eab3a6f40cbe30af4a9bd))
* use `RawJSON` when iterating items with `--format explore` in the CLI ([0398a54](https://github.com/trycourier/courier-cli/commit/0398a549a026f6c6facbd23c7585efc01b83eb9f))


### Chores

* **ci:** skip lint on metadata-only changes ([b5909a3](https://github.com/trycourier/courier-cli/commit/b5909a34bd3d5322acb1d0d3da42c8907372e12a))
* **internal:** regenerate SDK with no functional changes ([310af9f](https://github.com/trycourier/courier-cli/commit/310af9fe454d1f9d69021cb9a505e6990899bdcb))
* **internal:** tweak CI branches ([8302597](https://github.com/trycourier/courier-cli/commit/83025978a62b26ceac906e634c3e68af4ee9f1ad))
* **internal:** update gitignore ([fd4e24e](https://github.com/trycourier/courier-cli/commit/fd4e24e16d3cd271b9b75121b38b792f86490e33))
* omit full usage information when missing required CLI parameters ([f4fe315](https://github.com/trycourier/courier-cli/commit/f4fe3151a945021ad870b883fe1c7fe00a19b4ad))


### Documentation

* add AGENTS.md for AI coding assistants ([b846ec0](https://github.com/trycourier/courier-cli/commit/b846ec0c161d736684ac085157bb56a2b896aaf0))
* document next branch for Stainless and CI parity ([94b0b79](https://github.com/trycourier/courier-cli/commit/94b0b79e0d2c4eeb5d918ffd8cf7e21e6b998d5a))

## 3.2.0 (2026-03-12)

Full Changelog: [v3.1.6...v3.2.0](https://github.com/trycourier/courier-cli/compare/v3.1.6...v3.2.0)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/stretchr/testify v1.10.0
github.com/tidwall/gjson v1.18.0
github.com/tidwall/pretty v1.2.1
github.com/trycourier/courier-go/v4 v4.7.0
github.com/trycourier/courier-go/v4 v4.8.0
github.com/urfave/cli-docs/v3 v3.0.0-alpha6
github.com/urfave/cli/v3 v3.3.2
golang.org/x/sys v0.38.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
github.com/trycourier/courier-go/v4 v4.7.0 h1:2PNUWuZoun/fiszbU3YEyZf7cos4fzdsH8CbPMJTGcE=
github.com/trycourier/courier-go/v4 v4.7.0/go.mod h1:0ZQyZUNupRxUytcf9bLyIjCyssOKl0vT+wqjjaMaw6k=
github.com/trycourier/courier-go/v4 v4.8.0 h1:qcPTcJqg2HeG7XtggJNBW/STmR2XqNZ64dUECnKamcg=
github.com/trycourier/courier-go/v4 v4.8.0/go.mod h1:0ZQyZUNupRxUytcf9bLyIjCyssOKl0vT+wqjjaMaw6k=
github.com/urfave/cli-docs/v3 v3.0.0-alpha6 h1:w/l/N0xw1rO/aHRIGXJ0lDwwYFOzilup1qGvIytP3BI=
github.com/urfave/cli-docs/v3 v3.0.0-alpha6/go.mod h1:p7Z4lg8FSTrPB9GTaNyTrK3ygffHZcK3w0cU2VE+mzU=
github.com/urfave/cli/v3 v3.3.2 h1:BYFVnhhZ8RqT38DxEYVFPPmGFTEf7tJwySTXsVRrS/o=
Expand Down
34 changes: 31 additions & 3 deletions internal/jsonview/explorer.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package jsonview

import (
"bytes"
"encoding/json"
"errors"
"fmt"
Expand Down Expand Up @@ -309,6 +310,10 @@ func ExploreJSON(title string, json gjson.Result) error {
return err
}

type hasRawJSON interface {
RawJSON() string
}

// ExploreJSONStream explores JSON data loaded incrementally via an iterator
func ExploreJSONStream[T any](title string, it Iterator[T]) error {
anyIt := genericToAnyIterator(it)
Expand All @@ -327,12 +332,12 @@ func ExploreJSONStream[T any](title string, it Iterator[T]) error {
return err
}

// Convert items to JSON array
jsonBytes, err := json.Marshal(items)
arrayJSONBytes, err := marshalItemsToJSONArray(items)
if err != nil {
return err
}
arrayJSON := gjson.ParseBytes(jsonBytes)

arrayJSON := gjson.ParseBytes(arrayJSONBytes)
view, err := newTableView("", arrayJSON, false)
if err != nil {
return err
Expand All @@ -352,6 +357,29 @@ func ExploreJSONStream[T any](title string, it Iterator[T]) error {
return err
}

func marshalItemsToJSONArray(items []any) ([]byte, error) {
var buf bytes.Buffer
buf.WriteByte('[')

for i, item := range items {
if i > 0 {
buf.WriteByte(',')
}
if hasRaw, ok := item.(hasRawJSON); ok {
buf.WriteString(hasRaw.RawJSON())
} else {
jsonData, err := json.Marshal(item)
if err != nil {
return nil, err
}
buf.Write(jsonData)
}
}

buf.WriteByte(']')
return buf.Bytes(), nil
}

func (v *JSONViewer) current() JSONView { return v.stack[len(v.stack)-1] }
func (v *JSONViewer) Init() tea.Cmd { return nil }

Expand Down
26 changes: 26 additions & 0 deletions internal/jsonview/explorer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import (
"github.com/tidwall/gjson"
)

type rawJSONItem struct{ raw string }

func (r rawJSONItem) RawJSON() string { return r.raw }

func TestNewTextView(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -457,3 +461,25 @@ func TestFormatObjectKey(t *testing.T) {
})
}
}

func TestMarshalItemsToJSONArray_WithHasRawJSON(t *testing.T) {
items := []any{
rawJSONItem{raw: `{"id":1,"name":"alice"}`},
rawJSONItem{raw: `{"id":2,"name":"bob"}`},
}

got, err := marshalItemsToJSONArray(items)
require.NoError(t, err)
require.JSONEq(t, `[{"id":1,"name":"alice"},{"id":2,"name":"bob"}]`, string(got))
}

func TestMarshalItemsToJSONArray_WithoutHasRawJSON(t *testing.T) {
items := []any{
map[string]any{"id": 1, "name": "alice"},
map[string]any{"id": 2, "name": "bob"},
}

got, err := marshalItemsToJSONArray(items)
require.NoError(t, err)
require.JSONEq(t, `[{"id":1,"name":"alice"},{"id":2,"name":"bob"}]`, string(got))
}
6 changes: 3 additions & 3 deletions pkg/cmd/cmdutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func countTerminalLines(data []byte, terminalWidth int) int {
return bytes.Count([]byte(wrap.String(string(data), terminalWidth)), []byte("\n"))
}

type HasRawJSON interface {
type hasRawJSON interface {
RawJSON() string
}

Expand All @@ -398,7 +398,7 @@ func ShowJSONIterator[T any](stdout *os.File, title string, iter jsonview.Iterat
for itemsToDisplay != 0 && iter.Next() {
item := iter.Current()
var obj gjson.Result
if hasRaw, ok := any(item).(HasRawJSON); ok {
if hasRaw, ok := any(item).(hasRawJSON); ok {
obj = gjson.Parse(hasRaw.RawJSON())
} else {
jsonData, err := json.Marshal(item)
Expand Down Expand Up @@ -445,7 +445,7 @@ func ShowJSONIterator[T any](stdout *os.File, title string, iter jsonview.Iterat
}
item := iter.Current()
var obj gjson.Result
if hasRaw, ok := any(item).(HasRawJSON); ok {
if hasRaw, ok := any(item).(hasRawJSON); ok {
obj = gjson.Parse(hasRaw.RawJSON())
} else {
jsonData, err := json.Marshal(item)
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 = "3.2.0" // x-release-please-version
const Version = "3.3.0" // x-release-please-version
Loading