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.20.0"
".": "0.21.0"
}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.21.0](https://github.com/team-telnyx/telnyx-cli/compare/v0.20.0...v0.21.0) (2026-07-03)


### Bug Fixes

* **release:** take first Release-As match (multiline output broke GITHUB_OUTPUT) ([#54](https://github.com/team-telnyx/telnyx-cli/issues/54)) ([1ba5160](https://github.com/team-telnyx/telnyx-cli/commit/1ba5160a07092c4c5ad4b120e7aefdbc579aa383))

## [0.20.0](https://github.com/team-telnyx/telnyx-cli/compare/v0.19.0...v0.20.0) (2026-07-03)


Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/itchyny/json2yaml v0.1.4
github.com/muesli/reflow v0.3.0
github.com/stretchr/testify v1.10.0
github.com/team-telnyx/telnyx-go/v4 v4.85.0
github.com/team-telnyx/telnyx-go/v4 v4.86.0
github.com/tidwall/gjson v1.18.0
github.com/tidwall/pretty v1.2.1
github.com/urfave/cli-docs/v3 v3.0.0-alpha6
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/team-telnyx/telnyx-go/v4 v4.85.0 h1:vtKm3IeZGQ6IxEdOF6C2NfH3ItvfP4yN7TGOoBxD/0w=
github.com/team-telnyx/telnyx-go/v4 v4.85.0/go.mod h1:a8Z4CX3XKpxpziKboMKXe3Ds4hZ1ImAnZ1mQm5QxHyw=
github.com/team-telnyx/telnyx-go/v4 v4.86.0 h1:jjOWx9e+tMq8vw8XVpqGeRU9bl7g0YOXVGcuzpAndpo=
github.com/team-telnyx/telnyx-go/v4 v4.86.0/go.mod h1:a8Z4CX3XKpxpziKboMKXe3Ds4hZ1ImAnZ1mQm5QxHyw=
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
Expand Down
79 changes: 57 additions & 22 deletions pkg/cmd/storagekvkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os"

"github.com/team-telnyx/telnyx-cli/internal/apiquery"
"github.com/team-telnyx/telnyx-cli/internal/binaryparam"
"github.com/team-telnyx/telnyx-cli/internal/requestflag"
"github.com/team-telnyx/telnyx-go/v4"
"github.com/team-telnyx/telnyx-go/v4/option"
Expand Down Expand Up @@ -98,6 +99,10 @@ var storageKvsKeysList = cli.Command{
Usage: "Return only keys that start with this prefix.",
QueryPath: "prefix",
},
&requestflag.Flag[int64]{
Name: "max-items",
Usage: "The maximum number of items to return (use -1 for unlimited).",
},
},
Action: handleStorageKvsKeysList,
HideHelpCommand: true,
Expand Down Expand Up @@ -172,16 +177,26 @@ func handleStorageKvsKeysUpdate(ctx context.Context, cmd *cli.Command) error {
cmd.Set("key", unusedArgs[0])
unusedArgs = unusedArgs[1:]
}
if !cmd.IsSet("body") && len(unusedArgs) > 0 {
cmd.Set("body", unusedArgs[0])
unusedArgs = unusedArgs[1:]
}
if len(unusedArgs) > 0 {
return fmt.Errorf("Unexpected extra arguments: %v", unusedArgs)
}

bodyReader, stdinInUse, err := binaryparam.FileOrStdin(os.Stdin, cmd.Value("body").(string))
if err != nil {
return fmt.Errorf("Failed on param '%s': %w", "body", err)
}
defer bodyReader.Close()

options, err := flagOptions(
cmd,
apiquery.NestedQueryFormatBrackets,
apiquery.ArrayQueryFormatComma,
ApplicationJSON,
false,
ApplicationOctetStream,
stdinInUse,
)
if err != nil {
return err
Expand All @@ -194,6 +209,7 @@ func handleStorageKvsKeysUpdate(ctx context.Context, cmd *cli.Command) error {
return client.Storage.Kvs.Keys.Update(
ctx,
cmd.Value("key").(string),
bodyReader,
params,
options...,
)
Expand Down Expand Up @@ -223,29 +239,48 @@ func handleStorageKvsKeysList(ctx context.Context, cmd *cli.Command) error {

params := telnyx.StorageKvKeyListParams{}

var res []byte
options = append(options, option.WithResponseBodyInto(&res))
_, err = client.Storage.Kvs.Keys.List(
ctx,
cmd.Value("id").(string),
params,
options...,
)
if err != nil {
return err
}

obj := gjson.ParseBytes(res)
format := cmd.Root().String("format")
explicitFormat := cmd.Root().IsSet("format")
transform := cmd.Root().String("transform")
return ShowJSON(obj, ShowJSONOpts{
ExplicitFormat: explicitFormat,
Format: format,
RawOutput: cmd.Root().Bool("raw-output"),
Title: "storage:kvs:keys list",
Transform: transform,
})
if format == "raw" {
var res []byte
options = append(options, option.WithResponseBodyInto(&res))
_, err = client.Storage.Kvs.Keys.List(
ctx,
cmd.Value("id").(string),
params,
options...,
)
if err != nil {
return err
}
obj := gjson.ParseBytes(res)
return ShowJSON(obj, ShowJSONOpts{
ExplicitFormat: explicitFormat,
Format: format,
RawOutput: cmd.Root().Bool("raw-output"),
Title: "storage:kvs:keys list",
Transform: transform,
})
} else {
iter := client.Storage.Kvs.Keys.ListAutoPaging(
ctx,
cmd.Value("id").(string),
params,
options...,
)
maxItems := int64(-1)
if cmd.IsSet("max-items") {
maxItems = cmd.Value("max-items").(int64)
}
return ShowJSONIterator(iter, maxItems, ShowJSONOpts{
ExplicitFormat: explicitFormat,
Format: format,
RawOutput: cmd.Root().Bool("raw-output"),
Title: "storage:kvs:keys list",
Transform: transform,
})
}
}

func handleStorageKvsKeysDelete(ctx context.Context, cmd *cli.Command) error {
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/storagekvkey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func TestStorageKvsKeysList(t *testing.T) {
t,
"--api-key", "string",
"storage:kvs:keys", "list",
"--max-items", "10",
"--id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"--cursor", "cursor",
"--limit", "1",
Expand Down
10 changes: 10 additions & 0 deletions pkg/cmd/uacconnection.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,11 @@ var uacConnectionsCreate = requestflag.WithInnerFlags(cli.Command{
Usage: "Defaults to true.",
InnerField: "sip_compact_headers_enabled",
},
&requestflag.InnerFlag[string]{
Name: "inbound.sip-region",
Usage: "Selects which `sip_region` to receive inbound calls from. If null, the default region (US) will be used.",
InnerField: "sip_region",
},
&requestflag.InnerFlag[int64]{
Name: "inbound.timeout-1xx-secs",
Usage: "Time(sec) before aborting if connection is not made.",
Expand Down Expand Up @@ -650,6 +655,11 @@ var uacConnectionsUpdate = requestflag.WithInnerFlags(cli.Command{
Usage: "Defaults to true.",
InnerField: "sip_compact_headers_enabled",
},
&requestflag.InnerFlag[string]{
Name: "inbound.sip-region",
Usage: "Selects which `sip_region` to receive inbound calls from. If null, the default region (US) will be used.",
InnerField: "sip_region",
},
&requestflag.InnerFlag[int64]{
Name: "inbound.timeout-1xx-secs",
Usage: "Time(sec) before aborting if connection is not made.",
Expand Down
8 changes: 6 additions & 2 deletions pkg/cmd/uacconnection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestUacConnectionsCreate(t *testing.T) {
"--encode-contact-header-enabled=true",
"--encrypted-media", "SRTP",
"--external-uac-settings", "{auth_username: auth8492, expiration_sec: 600, from_user: '8492', outbound_proxy: outbound.sip-pbx.acme.example:5061, password: testtesttest, proxy: sip-pbx.acme.example, transport: TLS, username: ext8492}",
"--inbound", "{ani_number_format: +E.164, channel_limit: 10, codecs: [G722], default_routing_method: sequential, dnis_number_format: +e164, generate_ringback_tone: true, isup_headers_enabled: true, prack_enabled: true, shaken_stir_enabled: true, simultaneous_ringing: disabled, sip_compact_headers_enabled: true, timeout_1xx_secs: 10, timeout_2xx_secs: 20}",
"--inbound", "{ani_number_format: +E.164, channel_limit: 10, codecs: [G722], default_routing_method: sequential, dnis_number_format: +e164, generate_ringback_tone: true, isup_headers_enabled: true, prack_enabled: true, shaken_stir_enabled: true, simultaneous_ringing: disabled, sip_compact_headers_enabled: true, sip_region: US, timeout_1xx_secs: 10, timeout_2xx_secs: 20}",
"--internal-uac-settings", "{destination_uri: 14155550123@acme.sip.telnyx.com}",
"--ios-push-credential-id", "ec0c8e5d-439e-4620-a0c1-9d9c8d02a836",
"--jitter-buffer", "{enable_jitter_buffer: true, jitterbuffer_msec_max: 200, jitterbuffer_msec_min: 60}",
Expand Down Expand Up @@ -84,6 +84,7 @@ func TestUacConnectionsCreate(t *testing.T) {
"--inbound.shaken-stir-enabled=true",
"--inbound.simultaneous-ringing", "disabled",
"--inbound.sip-compact-headers-enabled=true",
"--inbound.sip-region", "US",
"--inbound.timeout-1xx-secs", "10",
"--inbound.timeout-2xx-secs", "20",
"--internal-uac-settings.destination-uri", "14155550123@acme.sip.telnyx.com",
Expand Down Expand Up @@ -153,6 +154,7 @@ func TestUacConnectionsCreate(t *testing.T) {
" shaken_stir_enabled: true\n" +
" simultaneous_ringing: disabled\n" +
" sip_compact_headers_enabled: true\n" +
" sip_region: US\n" +
" timeout_1xx_secs: 10\n" +
" timeout_2xx_secs: 20\n" +
"internal_uac_settings:\n" +
Expand Down Expand Up @@ -229,7 +231,7 @@ func TestUacConnectionsUpdate(t *testing.T) {
"--encode-contact-header-enabled=true",
"--encrypted-media", "SRTP",
"--external-uac-settings", "{auth_username: auth8492, expiration_sec: 600, from_user: '8492', outbound_proxy: outbound.sip-pbx.acme.example:5061, password: testtesttest, proxy: sip-pbx.acme.example, transport: TLS, username: ext8492}",
"--inbound", "{ani_number_format: +E.164, channel_limit: 10, codecs: [G722], default_routing_method: sequential, dnis_number_format: +e164, generate_ringback_tone: true, isup_headers_enabled: true, prack_enabled: true, shaken_stir_enabled: true, simultaneous_ringing: disabled, sip_compact_headers_enabled: true, timeout_1xx_secs: 10, timeout_2xx_secs: 20}",
"--inbound", "{ani_number_format: +E.164, channel_limit: 10, codecs: [G722], default_routing_method: sequential, dnis_number_format: +e164, generate_ringback_tone: true, isup_headers_enabled: true, prack_enabled: true, shaken_stir_enabled: true, simultaneous_ringing: disabled, sip_compact_headers_enabled: true, sip_region: US, timeout_1xx_secs: 10, timeout_2xx_secs: 20}",
"--internal-uac-settings", "{destination_uri: 14155550123@acme.sip.telnyx.com}",
"--ios-push-credential-id", "ec0c8e5d-439e-4620-a0c1-9d9c8d02a836",
"--jitter-buffer", "{enable_jitter_buffer: true, jitterbuffer_msec_max: 200, jitterbuffer_msec_min: 60}",
Expand Down Expand Up @@ -288,6 +290,7 @@ func TestUacConnectionsUpdate(t *testing.T) {
"--inbound.shaken-stir-enabled=true",
"--inbound.simultaneous-ringing", "disabled",
"--inbound.sip-compact-headers-enabled=true",
"--inbound.sip-region", "US",
"--inbound.timeout-1xx-secs", "10",
"--inbound.timeout-2xx-secs", "20",
"--internal-uac-settings.destination-uri", "14155550123@acme.sip.telnyx.com",
Expand Down Expand Up @@ -357,6 +360,7 @@ func TestUacConnectionsUpdate(t *testing.T) {
" shaken_stir_enabled: true\n" +
" simultaneous_ringing: disabled\n" +
" sip_compact_headers_enabled: true\n" +
" sip_region: US\n" +
" timeout_1xx_secs: 10\n" +
" timeout_2xx_secs: 20\n" +
"internal_uac_settings:\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 = "0.20.0" // x-release-please-version
const Version = "0.21.0" // x-release-please-version
Loading