@pippit-dev/cli 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/checksums.txt +6 -6
- package/cmd/root.go +3 -2
- package/cmd/short_drama_test.go +22 -12
- package/package.json +1 -1
- package/cmd/version/version.go +0 -21
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ matching prebuilt binary for macOS, Linux, or Windows:
|
|
|
10
10
|
```bash
|
|
11
11
|
npx @pippit-dev/cli@latest install
|
|
12
12
|
export XYQ_ACCESS_KEY="<access-key>"
|
|
13
|
-
pippit-cli version
|
|
13
|
+
pippit-cli --version
|
|
14
14
|
pippit-cli short-drama +submit-run --message "写一个赛博朋克短剧开头"
|
|
15
15
|
pippit-cli short-drama +upload-file --path ./story.md
|
|
16
16
|
pippit-cli short-drama +get-thread --thread-id thread_123 --run-id run_456 --after-seq 0
|
|
@@ -24,7 +24,7 @@ Submit a Run task for the short drama scene:
|
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
26
|
export XYQ_ACCESS_KEY="<access-key>"
|
|
27
|
-
go run . version
|
|
27
|
+
go run . --version
|
|
28
28
|
go run . short-drama +submit-run --message "写一个赛博朋克短剧开头"
|
|
29
29
|
go run . short-drama +upload-file --path ./story.md
|
|
30
30
|
go run . short-drama +get-thread --thread-id thread_123 --run-id run_456 --after-seq 0
|
package/checksums.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
ebff380937bb2269a116272d4bb0c5aaef0a176c2ffcfb6f337733411db34ddc pippit-cli-0.0.11-darwin-amd64.tar.gz
|
|
2
|
+
de27b844d0df2b112a2a78a24184d023cdf72b145d969497dd351924348161e4 pippit-cli-0.0.11-darwin-arm64.tar.gz
|
|
3
|
+
65da00716f772d3bbb823e10f36e87b73810c8d6f76d5f0c648274d43657f634 pippit-cli-0.0.11-linux-amd64.tar.gz
|
|
4
|
+
420dc63f6ea642c20b0a22f666c652d633d4ddad274b85096b51f74602e85a81 pippit-cli-0.0.11-linux-arm64.tar.gz
|
|
5
|
+
06350f1d74f4130bb420c237e5f804b4df1f358dfc195b659a70ddfd2d48832b pippit-cli-0.0.11-windows-amd64.zip
|
|
6
|
+
6919d1de3bec32499379bbcc820ccf3bafb3e843fdfa4cb9e826f90fae00feb2 pippit-cli-0.0.11-windows-arm64.zip
|
package/cmd/root.go
CHANGED
|
@@ -7,7 +7,6 @@ import (
|
|
|
7
7
|
// authcmd "github.com/Pippit-dev/pippit-cli/cmd/auth"
|
|
8
8
|
"github.com/Pippit-dev/pippit-cli/cmd/short_drama"
|
|
9
9
|
updatecmd "github.com/Pippit-dev/pippit-cli/cmd/update"
|
|
10
|
-
versioncmd "github.com/Pippit-dev/pippit-cli/cmd/version"
|
|
11
10
|
"github.com/Pippit-dev/pippit-cli/internal/common"
|
|
12
11
|
"github.com/Pippit-dev/pippit-cli/internal/config"
|
|
13
12
|
"github.com/Pippit-dev/pippit-cli/internal/version"
|
|
@@ -30,15 +29,17 @@ func newRootCommand(stdout, stderr io.Writer, runner *common.Runner) *cobra.Comm
|
|
|
30
29
|
root := &cobra.Command{
|
|
31
30
|
Use: "pippit-cli",
|
|
32
31
|
Short: "Pippit CLI",
|
|
32
|
+
Long: "Pippit CLI submits short-drama workflows, downloads generated assets, and updates the installed CLI package.",
|
|
33
33
|
Version: version.Current(),
|
|
34
34
|
SilenceUsage: true,
|
|
35
35
|
SilenceErrors: true,
|
|
36
36
|
}
|
|
37
|
+
root.CompletionOptions.DisableDefaultCmd = true
|
|
38
|
+
root.SetVersionTemplate("{{.Version}}\n")
|
|
37
39
|
root.SetOut(stdout)
|
|
38
40
|
root.SetErr(stderr)
|
|
39
41
|
// root.AddCommand(authcmd.NewCommand(stdout, stderr, runner)) // temporarily disabled; auth is via access key injection
|
|
40
42
|
root.AddCommand(short_drama.NewCommand(stdout, stderr, runner))
|
|
41
43
|
root.AddCommand(updatecmd.NewCommand(stdout, stderr))
|
|
42
|
-
root.AddCommand(versioncmd.NewCommand(stdout))
|
|
43
44
|
return root
|
|
44
45
|
}
|
package/cmd/short_drama_test.go
CHANGED
|
@@ -91,28 +91,38 @@ func TestRootIncludesUpdateCommand(t *testing.T) {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
func
|
|
94
|
+
func TestRootDoesNotIncludeVersionCommand(t *testing.T) {
|
|
95
95
|
var stdout, stderr bytes.Buffer
|
|
96
96
|
root := NewRootCommand(&stdout, &stderr)
|
|
97
97
|
cmd, _, err := root.Find([]string{"version"})
|
|
98
|
-
if err
|
|
99
|
-
t.Fatalf("Find(version)
|
|
100
|
-
}
|
|
101
|
-
if cmd == nil || cmd.Name() != "version" {
|
|
102
|
-
t.Fatalf("Find(version) = %#v, want version command", cmd)
|
|
98
|
+
if err == nil || cmd != root {
|
|
99
|
+
t.Fatalf("Find(version) = (%#v, %v), want unknown command", cmd, err)
|
|
103
100
|
}
|
|
104
101
|
}
|
|
105
102
|
|
|
106
|
-
func
|
|
103
|
+
func TestRootHelpListsSupportedCommands(t *testing.T) {
|
|
107
104
|
var stdout, stderr bytes.Buffer
|
|
108
105
|
root := NewRootCommand(&stdout, &stderr)
|
|
109
|
-
root.SetArgs([]string{"
|
|
106
|
+
root.SetArgs([]string{"--help"})
|
|
110
107
|
|
|
111
108
|
if err := root.Execute(); err != nil {
|
|
112
109
|
t.Fatalf("Execute() error = %v, stderr = %s", err, stderr.String())
|
|
113
110
|
}
|
|
114
|
-
|
|
115
|
-
|
|
111
|
+
got := stdout.String()
|
|
112
|
+
for _, want := range []string{
|
|
113
|
+
"Pippit CLI submits short-drama workflows",
|
|
114
|
+
"short-drama",
|
|
115
|
+
"update",
|
|
116
|
+
"--version",
|
|
117
|
+
} {
|
|
118
|
+
if !strings.Contains(got, want) {
|
|
119
|
+
t.Fatalf("help output = %q, want %q", got, want)
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
for _, unwanted := range []string{"completion", "version "} {
|
|
123
|
+
if strings.Contains(got, unwanted) {
|
|
124
|
+
t.Fatalf("help output = %q, should not contain %q", got, unwanted)
|
|
125
|
+
}
|
|
116
126
|
}
|
|
117
127
|
}
|
|
118
128
|
|
|
@@ -124,8 +134,8 @@ func TestVersionFlagPrintsVersion(t *testing.T) {
|
|
|
124
134
|
if err := root.Execute(); err != nil {
|
|
125
135
|
t.Fatalf("Execute() error = %v, stderr = %s", err, stderr.String())
|
|
126
136
|
}
|
|
127
|
-
if got := stdout.String();
|
|
128
|
-
t.Fatalf("version flag output = %q, want
|
|
137
|
+
if got := strings.TrimSpace(stdout.String()); got != version.Current() {
|
|
138
|
+
t.Fatalf("version flag output = %q, want %s", got, version.Current())
|
|
129
139
|
}
|
|
130
140
|
}
|
|
131
141
|
|
package/package.json
CHANGED
package/cmd/version/version.go
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
package versioncmd
|
|
2
|
-
|
|
3
|
-
import (
|
|
4
|
-
"fmt"
|
|
5
|
-
"io"
|
|
6
|
-
|
|
7
|
-
"github.com/Pippit-dev/pippit-cli/internal/version"
|
|
8
|
-
"github.com/spf13/cobra"
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
func NewCommand(stdout io.Writer) *cobra.Command {
|
|
12
|
-
return &cobra.Command{
|
|
13
|
-
Use: "version",
|
|
14
|
-
Short: "Print pippit-cli version",
|
|
15
|
-
Args: cobra.NoArgs,
|
|
16
|
-
RunE: func(cmd *cobra.Command, _ []string) error {
|
|
17
|
-
_, err := fmt.Fprintln(stdout, version.Current())
|
|
18
|
-
return err
|
|
19
|
-
},
|
|
20
|
-
}
|
|
21
|
-
}
|