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.73"
".": "0.1.0-alpha.74"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless%2Fstainless-v0-c05bce23f6a3478a1803494b2c627e0bbf73917a849756eddc42f4607e167c6b.yml
openapi_spec_hash: b9eb999620220d15b176f815f21a67ba
config_hash: 977c436868252591d86546b2127ab8ce
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless%2Fstainless-v0-60fccc45e9e7fac02642f763acadcafbd890990992facb1242864364f7c3fa80.yml
openapi_spec_hash: f4a06d91e54ada059445cd7ab63678b3
config_hash: 4b44da9496c775d2294758cd233f4ecd
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## 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)

### Features

* add CommitOnly option to build model ([93e3e0c](https://github.com/stainless-api/stainless-api-cli/commit/93e3e0cfb46c70982b70b9768200d8ce992326dd))
* **api:** manual updates ([5d1a904](https://github.com/stainless-api/stainless-api-cli/commit/5d1a9048221995d8103d5abc945c9a03f1df520a))
* remove unused dev.TickMsg ([5e5b7cf](https://github.com/stainless-api/stainless-api-cli/commit/5e5b7cfdfc7cb5f1baa72cb2d74b016d7f78558c))


### Bug Fixes

* fix project creation ([27237e2](https://github.com/stainless-api/stainless-api-cli/commit/27237e28927e936ca9efe213baef180933a050ea))
* improve error handling in build errors ([c4d1866](https://github.com/stainless-api/stainless-api-cli/commit/c4d186657c0f944a9dc736df4280d8c4fb77fc38))


### Chores

* **internal:** remove mock server code ([c4dd9e7](https://github.com/stainless-api/stainless-api-cli/commit/c4dd9e705c0e9d7de3df03f42034e7cd9b4322ec))

## 0.1.0-alpha.73 (2026-02-20)

Full Changelog: [v0.1.0-alpha.72...v0.1.0-alpha.73](https://github.com/stainless-api/stainless-api-cli/compare/v0.1.0-alpha.72...v0.1.0-alpha.73)
Expand Down
5 changes: 4 additions & 1 deletion pkg/cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,10 @@ func handleBuildsCreate(ctx context.Context, cmd *cli.Command) error {

if waitMode > WaitNone {
console.Spacer()
buildModel := cbuild.NewModel(client, ctx, *build, cmd.String("branch"), downloadPaths)
buildModel.CommitOnly = waitMode == WaitCommit
model := tea.Model(buildCompletionModel{
Build: cbuild.NewModel(client, ctx, *build, cmd.String("branch"), downloadPaths),
Build: buildModel,
WaitMode: waitMode,
})
model, err = tea.NewProgram(model).Run()
Expand Down Expand Up @@ -541,6 +543,7 @@ func (c buildCompletionModel) IsCompleted() bool {
}

func (c buildCompletionModel) View() string {
c.Build.CommitOnly = c.WaitMode == WaitCommit
return c.Build.View()
}

Expand Down
10 changes: 8 additions & 2 deletions pkg/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func fetchUserProjects(ctx context.Context, client stainless.Client, org string)
// askSelectProject prompts the user to select from existing projects or create a new one
func askSelectProject(projects []stainless.Project) (string, *stainless.Project, error) {
options := make([]huh.Option[*stainless.Project], 0, len(projects)+1)
options = append(options, huh.NewOption("<New Project>", &stainless.Project{}))
options = append(options, huh.NewOption("<New Project>", (*stainless.Project)(nil)))
projects = slices.SortedFunc(slices.Values(projects), func(p1, p2 stainless.Project) int {
if p1.Slug < p2.Slug {
return -1
Expand All @@ -240,6 +240,9 @@ func askSelectProject(projects []stainless.Project) (string, *stainless.Project,
if err != nil {
return "", nil, err
}
if picked == nil {
return "", nil, nil
}
return picked.Slug, picked, nil
}

Expand Down Expand Up @@ -422,8 +425,11 @@ func initializeWorkspace(ctx context.Context, cmd *cli.Command, client stainless
downloadPaths[stainless.Target(targetName)] = targetConfig.OutputPath
}

buildModel := cbuild.NewModel(client, ctx, *build, "main", downloadPaths)
buildModel.CommitOnly = true
model := buildCompletionModel{
Build: cbuild.NewModel(client, ctx, *build, "main", downloadPaths),
Build: buildModel,
WaitMode: WaitCommit,
}

_, err = tea.NewProgram(model).Run()
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.73" // x-release-please-version
const Version = "0.1.0-alpha.74" // x-release-please-version
4 changes: 3 additions & 1 deletion pkg/components/build/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ type Model struct {
Ctx context.Context
Branch string // Optional branch name for git checkout
Downloads map[stainless.Target]DownloadStatus // When a BuildTarget has a commit available, this target will download it, if it has been specified in the initialization.
Err error // This will be populated if the model concludes with an error
Err error // This will be populated if the model concludes with an error
CommitOnly bool // When true, only show the commit step in the pipeline view
}

type DownloadStatus struct {
Expand Down Expand Up @@ -121,6 +122,7 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {

case ErrorMsg:
m.Err = msg
cmds = append(cmds, tea.Quit)
}

return m, tea.Batch(cmds...)
Expand Down
14 changes: 10 additions & 4 deletions pkg/components/build/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,19 @@ import (
)

func (m Model) View() string {
return View(m.Build, m.Downloads)
if m.Err != nil {
return m.Err.Error()
}
return View(m.Build, m.Downloads, m.CommitOnly)
}

func View(build stainless.Build, downloads map[stainless.Target]DownloadStatus) string {
func View(build stainless.Build, downloads map[stainless.Target]DownloadStatus, commitOnly bool) string {
s := strings.Builder{}
buildObj := stainlessutils.NewBuild(build)
languages := buildObj.Languages()
// Target rows with colors
for _, target := range languages {
pipeline := ViewBuildPipeline(build, target, downloads)
pipeline := ViewBuildPipeline(build, target, downloads, commitOnly)
langStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("15")).Bold(true)

s.WriteString(fmt.Sprintf("%s %s\n", langStyle.Render(fmt.Sprintf("%-13s", string(target))), pipeline))
Expand Down Expand Up @@ -50,7 +53,7 @@ func View(build stainless.Build, downloads map[stainless.Target]DownloadStatus)
}

// View renders the build pipeline for a target
func ViewBuildPipeline(build stainless.Build, target stainless.Target, downloads map[stainless.Target]DownloadStatus) string {
func ViewBuildPipeline(build stainless.Build, target stainless.Target, downloads map[stainless.Target]DownloadStatus, commitOnly bool) string {
buildObj := stainlessutils.NewBuild(build)
buildTarget := buildObj.BuildTarget(target)
if buildTarget == nil {
Expand All @@ -61,6 +64,9 @@ func ViewBuildPipeline(build stainless.Build, target stainless.Target, downloads
var pipeline strings.Builder

for _, step := range stepOrder {
if commitOnly && step != "commit" {
continue
}
status, url, conclusion := buildTarget.StepInfo(step)
if status == "" {
continue // Skip steps that don't exist for this target
Expand Down
9 changes: 2 additions & 7 deletions pkg/components/dev/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package dev
import (
"context"
"errors"
"time"

"github.com/charmbracelet/bubbles/help"
"github.com/charmbracelet/bubbles/key"
Expand Down Expand Up @@ -34,7 +33,6 @@ type Model struct {
Diagnostics diagnostics.Model
}

type TickMsg time.Time
type ErrorMsg error
type FileChangeMsg struct{}

Expand All @@ -52,18 +50,15 @@ func NewModel(client stainless.Client, ctx context.Context, branch string, fn fu

func (m Model) Init() tea.Cmd {
return tea.Batch(
tea.Tick(time.Second, func(t time.Time) tea.Msg {
return TickMsg(t)
}),
m.Build.Init(),
m.Diagnostics.Init(),
func() tea.Msg {
res, err := m.start()
if err != nil {
return ErrorMsg(err)
}
return build.FetchBuildMsg(*res)
},
m.Build.Init(),
m.Diagnostics.Init(),
)
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/components/dev/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import (
)

func (m Model) View() string {
if m.Err != nil {
return m.Err.Error()
}

s := strings.Builder{}

idx := slices.IndexFunc(parts, func(part ViewPart) bool {
Expand Down
Loading