@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 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
- 5aca1f46d99e5ab9d748cf14d4cfe5fa68b2d2cb248073db0c92d0de361e5fb8 pippit-cli-0.0.10-darwin-amd64.tar.gz
2
- b56de7e3bdd202d449ea5658171b52dbde313c1e3f12f999c583a6b321624d11 pippit-cli-0.0.10-darwin-arm64.tar.gz
3
- b9ddcbd19ffa7aada4c114f7be8b8d6fb870b9a0b9ffed99c0df196ce05658d4 pippit-cli-0.0.10-linux-amd64.tar.gz
4
- 3b8a11becb6229f22c39e2c86caaa897f4ae9147e0960414c0d763ce00bbdd5b pippit-cli-0.0.10-linux-arm64.tar.gz
5
- 26a57f485227f9674591ed20536baa281c443b5ac1c26711e064a77d9ebc6174 pippit-cli-0.0.10-windows-amd64.zip
6
- 8fd4eca3a8977b901d74aa6455293c3c400151e5981491f6d3df1d568781c3eb pippit-cli-0.0.10-windows-arm64.zip
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
  }
@@ -91,28 +91,38 @@ func TestRootIncludesUpdateCommand(t *testing.T) {
91
91
  }
92
92
  }
93
93
 
94
- func TestRootIncludesVersionCommand(t *testing.T) {
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 != nil {
99
- t.Fatalf("Find(version) error = %v", err)
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 TestVersionCommandPrintsVersion(t *testing.T) {
103
+ func TestRootHelpListsSupportedCommands(t *testing.T) {
107
104
  var stdout, stderr bytes.Buffer
108
105
  root := NewRootCommand(&stdout, &stderr)
109
- root.SetArgs([]string{"version"})
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
- if got := strings.TrimSpace(stdout.String()); got != version.Current() {
115
- t.Fatalf("version output = %q, want %s", got, version.Current())
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(); !strings.Contains(got, version.Current()) {
128
- t.Fatalf("version flag output = %q, want version", got)
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pippit-dev/cli",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "Pippit CLI",
5
5
  "bin": {
6
6
  "pippit-cli": "scripts/run.js"
@@ -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
- }