@@ -103,6 +103,28 @@ var projectsBranchesDelete = cli.Command{
103103 HideHelpCommand : true ,
104104}
105105
106+ var projectsBranchesRebase = cli.Command {
107+ Name : "rebase" ,
108+ Usage : "Rebase a project branch" ,
109+ Flags : []cli.Flag {
110+ & cli.StringFlag {
111+ Name : "project" ,
112+ },
113+ & cli.StringFlag {
114+ Name : "branch" ,
115+ },
116+ & jsonflag.JSONStringFlag {
117+ Name : "base" ,
118+ Config : jsonflag.JSONConfig {
119+ Kind : jsonflag .Query ,
120+ Path : "base" ,
121+ },
122+ },
123+ },
124+ Action : handleProjectsBranchesRebase ,
125+ HideHelpCommand : true ,
126+ }
127+
106128func handleProjectsBranchesCreate (ctx context.Context , cmd * cli.Command ) error {
107129 cc := getAPICommandContext (cmd )
108130 params := stainless.ProjectBranchNewParams {}
@@ -182,3 +204,23 @@ func handleProjectsBranchesDelete(ctx context.Context, cmd *cli.Command) error {
182204 fmt .Printf ("%s\n " , ColorizeJSON (string (res ), os .Stdout ))
183205 return nil
184206}
207+
208+ func handleProjectsBranchesRebase (ctx context.Context , cmd * cli.Command ) error {
209+ cc := getAPICommandContext (cmd )
210+ params := stainless.ProjectBranchRebaseParams {}
211+ if cmd .IsSet ("project" ) {
212+ params .Project = stainless .String (cmd .Value ("project" ).(string ))
213+ }
214+ res , err := cc .client .Projects .Branches .Rebase (
215+ context .TODO (),
216+ cmd .Value ("branch" ).(string ),
217+ params ,
218+ option .WithMiddleware (cc .AsMiddleware ()),
219+ )
220+ if err != nil {
221+ return err
222+ }
223+
224+ fmt .Printf ("%s\n " , ColorizeJSON (res .RawJSON (), os .Stdout ))
225+ return nil
226+ }
0 commit comments