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.1.0-alpha.74"
".": "0.1.0-alpha.75"
}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.1.0-alpha.75 (2026-02-25)

Full Changelog: [v0.1.0-alpha.74...v0.1.0-alpha.75](https://github.com/stainless-api/stainless-api-cli/compare/v0.1.0-alpha.74...v0.1.0-alpha.75)

### Bug Fixes

* don't log tty error ([e5409eb](https://github.com/stainless-api/stainless-api-cli/commit/e5409eb8fd0a7109dc15523b63f4cdf42d180b13))
* pin formatting for headers to always use repeat/dot formats ([40924d6](https://github.com/stainless-api/stainless-api-cli/commit/40924d6fecfcd4cadd6b4baab9792fbce5eb3e48))


### Chores

* update readme with better instructions for installing with homebrew ([2322bbb](https://github.com/stainless-api/stainless-api-cli/commit/2322bbb40f839258b7ee41123c8a248ddec18496))

## 0.1.0-alpha.74 (2026-02-25)

Full Changelog: [v0.1.0-alpha.73...v0.1.0-alpha.74](https://github.com/stainless-api/stainless-api-cli/compare/v0.1.0-alpha.73...v0.1.0-alpha.74)
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ It is generated with [Stainless](https://www.stainless.com/).
### Installing with Homebrew

```sh
brew tap stainless-api/tap
brew install stl
brew install stainless-api/tap/stl
```

### Installing with Go
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ func handleBuildsCreate(ctx context.Context, cmd *cli.Command) error {
Build: buildModel,
WaitMode: waitMode,
})
model, err = tea.NewProgram(model).Run()
model, err = console.NewProgram(model).Run()
if err != nil {
console.Warn("%s", err.Error())
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/cmd/dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"strings"
"time"

tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/huh"
"github.com/stainless-api/stainless-api-cli/pkg/components/build"
"github.com/stainless-api/stainless-api-cli/pkg/components/dev"
Expand Down Expand Up @@ -255,7 +254,7 @@ func runDevBuild(ctx context.Context, client stainless.Client, wc workspace.Conf
cmd.Bool("watch"),
)

p := tea.NewProgram(model)
p := console.NewProgram(model)
finalModel, err := p.Run()

if err != nil {
Expand Down
6 changes: 5 additions & 1 deletion pkg/cmd/flagoptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,11 @@ func flagOptions(
}

// Add header parameters
if values, err := apiquery.MarshalWithSettings(flagContents.Headers, querySettings); err != nil {
headerSettings := apiquery.QuerySettings{
NestedFormat: apiquery.NestedQueryFormatDots,
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
}
if values, err := apiquery.MarshalWithSettings(flagContents.Headers, headerSettings); err != nil {
return nil, err
} else {
for k, vs := range values {
Expand Down
3 changes: 1 addition & 2 deletions pkg/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"github.com/stainless-api/stainless-api-cli/pkg/workspace"
"github.com/stainless-api/stainless-api-go/option"

tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/huh"
"github.com/charmbracelet/lipgloss"
"github.com/charmbracelet/x/term"
Expand Down Expand Up @@ -432,7 +431,7 @@ func initializeWorkspace(ctx context.Context, cmd *cli.Command, client stainless
WaitMode: WaitCommit,
}

_, err = tea.NewProgram(model).Run()
_, err = console.NewProgram(model).Run()
if err != nil {
console.Warn("%s", err.Error())
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/cmd/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"github.com/stainless-api/stainless-api-cli/pkg/components/build"
"github.com/stainless-api/stainless-api-cli/pkg/console"
"github.com/stainless-api/stainless-api-cli/pkg/workspace"
"github.com/stainless-api/stainless-api-go"
"github.com/urfave/cli/v3"
Expand Down Expand Up @@ -211,7 +212,7 @@ func runLinter(ctx context.Context, cmd *cli.Command, canSkip bool) error {
help: help.New(),
}

p := tea.NewProgram(m, tea.WithContext(ctx))
p := console.NewProgram(m, tea.WithContext(ctx))

// Start the diagnostics process
go func() {
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.1.0-alpha.74" // x-release-please-version
const Version = "0.1.0-alpha.75" // x-release-please-version
19 changes: 18 additions & 1 deletion pkg/console/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,25 @@ import (
"github.com/charmbracelet/x/ansi"
"github.com/logrusorgru/aurora/v4"
"github.com/urfave/cli/v3"
"golang.org/x/term"
)

// NewProgram wraps tea.NewProgram with better handling for tty environments
func NewProgram(model tea.Model, opts ...tea.ProgramOption) *tea.Program {
// Always output to stderr, in case we want to also output JSON so that the json is redirectable e.g. to jq.
opts = append(opts, tea.WithOutput(os.Stderr))

// If not a TTY, use stdin and disable renderer
if !term.IsTerminal(int(os.Stderr.Fd())) {
opts = append(opts,
tea.WithInput(os.Stdin),
tea.WithoutRenderer(),
)
}

return tea.NewProgram(model, opts...)
}

// Group represents a nested logging group
type Group struct {
prefix string
Expand Down Expand Up @@ -255,7 +272,7 @@ func spinnerWithIndent(indent int, message string, operation func() error) error
execute: operation,
}

finalModel, err := tea.NewProgram(model).Run()
finalModel, err := NewProgram(model).Run()
if err != nil {
return err
}
Expand Down
Loading