Skip to content

Commit 1cdcbf4

Browse files
refactor: move files into pkg/cmd
1 parent a7615b2 commit 1cdcbf4

File tree

15 files changed

+104
-110
lines changed

15 files changed

+104
-110
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
.prism.log
22
dist/
3-
stainless-api-cli
3+
/stainless-api-cli

.goreleaser.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ builds:
66
goos: [darwin]
77
goarch: [amd64, arm64]
88
binary: '{{ .ProjectName }}'
9+
main: ./cmd/stainless-api-cli/main.go
910
mod_timestamp: "{{ .CommitTimestamp }}"
1011
ldflags:
1112
- "-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}"
@@ -16,6 +17,7 @@ builds:
1617
env:
1718
- CGO_ENABLED=0
1819
binary: '{{ .ProjectName }}'
20+
main: ./cmd/stainless-api-cli/main.go
1921
mod_timestamp: "{{ .CommitTimestamp }}"
2022
ldflags:
2123
- "-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}"
@@ -24,6 +26,7 @@ builds:
2426
goos: [windows]
2527
goarch: ['386', amd64, arm64]
2628
binary: '{{ .ProjectName }}'
29+
main: ./cmd/stainless-api-cli/main.go
2730
mod_timestamp: "{{ .CommitTimestamp }}"
2831
ldflags:
2932
- "-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}"

cmd/stainless-api-cli/main.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
package main
4+
5+
import (
6+
"context"
7+
"log"
8+
"os"
9+
10+
"github.com/stainless-api/stainless-api-cli/pkg/cmd"
11+
)
12+
13+
func main() {
14+
app := cmd.Command
15+
if err := app.Run(context.Background(), os.Args); err != nil {
16+
log.Fatal(err)
17+
}
18+
}

main.go

Lines changed: 0 additions & 99 deletions
This file was deleted.

auth.go renamed to pkg/cmd/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
package main
3+
package cmd
44

55
import (
66
"bytes"

build.go renamed to pkg/cmd/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
package main
3+
package cmd
44

55
import (
66
"bytes"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
package main
3+
package cmd
44

55
import (
66
"context"

pkg/cmd/cmd.go

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
package cmd
4+
5+
import (
6+
"github.com/urfave/cli/v3"
7+
)
8+
9+
var Command = cli.Command{
10+
Name: "stainless-api-cli",
11+
Usage: "CLI for the stainless-v0 API",
12+
Commands: []*cli.Command{
13+
{
14+
Name: "projects",
15+
Commands: []*cli.Command{
16+
&projectsRetrieve,
17+
&projectsUpdate,
18+
&projectsList,
19+
},
20+
},
21+
22+
{
23+
Name: "projects:branches",
24+
Commands: []*cli.Command{
25+
&projectsBranchesCreate,
26+
&projectsBranchesRetrieve,
27+
},
28+
},
29+
30+
{
31+
Name: "projects:configs",
32+
Commands: []*cli.Command{
33+
&projectsConfigsRetrieve,
34+
&projectsConfigsGuess,
35+
},
36+
},
37+
38+
{
39+
Name: "projects:snippets",
40+
Commands: []*cli.Command{
41+
&projectsSnippetsCreateRequest,
42+
},
43+
},
44+
45+
{
46+
Name: "builds",
47+
Commands: []*cli.Command{
48+
&buildsCreate,
49+
&buildsRetrieve,
50+
&buildsList,
51+
&buildsCompare,
52+
},
53+
},
54+
55+
{
56+
Name: "build_target_outputs",
57+
Commands: []*cli.Command{
58+
&buildTargetOutputsRetrieve,
59+
},
60+
},
61+
62+
{
63+
Name: "orgs",
64+
Commands: []*cli.Command{
65+
&orgsRetrieve,
66+
&orgsList,
67+
},
68+
},
69+
},
70+
EnableShellCompletion: true,
71+
HideHelpCommand: true,
72+
}

org.go renamed to pkg/cmd/org.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
package main
3+
package cmd
44

55
import (
66
"context"

project.go renamed to pkg/cmd/project.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
package main
3+
package cmd
44

55
import (
66
"context"

0 commit comments

Comments
 (0)