Skip to content

Commit 9045186

Browse files
committed
chore(release): 0.2.1
1 parent 79c458f commit 9045186

15 files changed

Lines changed: 30 additions & 25 deletions

File tree

.golangci.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
version: "2"
2+
13
run:
24
timeout: 3m
35
tests: true
@@ -7,25 +9,19 @@ linters:
79
enable:
810
- govet
911
- staticcheck
10-
- gofmt
11-
- goimports
1212
- revive
1313
- ineffassign
1414
- errcheck
15-
- gosimple
1615

1716
linters-settings:
1817
revive:
18+
enable-all-rules: false
1919
severity: warning
2020
rules:
2121
- name: exported
2222
severity: warning
2323
- name: var-naming
2424
severity: warning
25-
gofmt:
26-
simplify: true
27-
goimports:
28-
local-prefixes: say11
2925

3026
issues:
3127
exclude-use-default: false

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Changelog
22

33
## Unreleased
4+
5+
## 0.2.1 - 2026-01-01
46
### Fixed
57
- `-o/--output` now disables speaker playback by default unless `--play` is explicitly set. Previously `-o` saved to file AND played through speakers, which was confusing.
68

cmd/doc.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Package cmd wires up the `sag` CLI commands.
2+
package cmd

cmd/prompting.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func init() {
1717
Aliases: []string{"prompt", "guide", "tips"},
1818
Short: "Prompting guide for better ElevenLabs speech",
1919
Long: "Prints a practical prompting guide (model-specific tips, tags, and knobs) to improve voice quality and control.",
20-
RunE: func(cmd *cobra.Command, args []string) error {
20+
RunE: func(cmd *cobra.Command, _ []string) error {
2121
out := strings.TrimSpace(promptingGuide)
2222
_, err := fmt.Fprintln(cmd.OutOrStdout(), out)
2323
return err

cmd/prompting_guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Notes:
4848
- Tag effectiveness depends on the voice + training samples; not every voice reacts well.
4949
- Combine tags sparingly; more tags ≠ better audio.
5050

51-
## Knobs in `sag` (0.2.0)
51+
## Knobs in `sag` (0.2.1)
5252

5353
Voice sliders:
5454
- `--stability` (v3 presets: 0.0=Creative, 0.5=Natural, 1.0=Robust; v2/v2.5: 0..1)

cmd/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ var (
2121
Short: "🗣️ ElevenLabs speech, mac-style ease",
2222
Long: "Command-line ElevenLabs TTS with macOS playback. Call it like macOS 'say': if you skip the subcommand, text args are passed to 'speak' (e.g. `sag \"Hello\"`).\n\nTip: run `sag prompting` for model-specific prompting tips.\nModels: `eleven_v3` (default), `eleven_multilingual_v2` (stable), `eleven_flash_v2_5` (fast/cheap), `eleven_turbo_v2_5` (balanced).",
2323
Example: " sag \"Hi Peter\"\n echo 'piped input' | sag\n sag speak -v Roger --rate 200 \"Faster speech\"\n sag prompting",
24-
Version: "0.2.0",
25-
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
24+
Version: "0.2.1",
25+
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
2626
if versionFlag {
2727
fmt.Println(cmd.Root().Name(), cmd.Root().Version)
2828
os.Exit(0)

cmd/sag/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// sag is the command-line entry point.
12
package main
23

34
import "github.com/steipete/sag/cmd"

cmd/sag/main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"testing"
66
)
77

8-
func TestMainHelp(t *testing.T) {
8+
func TestMainHelp(_ *testing.T) {
99
orig := os.Args
1010
defer func() { os.Args = orig }()
1111
os.Args = []string{"sag", "--help"}

cmd/speak.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func init() {
5858
Short: "Speak the provided text using ElevenLabs TTS (default: stream to speakers)",
5959
Long: "If no text argument is provided, the command reads from stdin.\n\nTip: run `sag prompting` for model-specific prompting tips and recommended flag combinations.",
6060
Args: cobra.ArbitraryArgs,
61-
PreRunE: func(cmd *cobra.Command, args []string) error {
61+
PreRunE: func(_ *cobra.Command, _ []string) error {
6262
return ensureAPIKey()
6363
},
6464
RunE: func(cmd *cobra.Command, args []string) error {

cmd/speak_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func TestResolveTextEmptyFile(t *testing.T) {
117117
}
118118

119119
func TestResolveVoiceDefaultsToFirst(t *testing.T) {
120-
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
120+
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
121121
if _, err := w.Write([]byte(`{"voices":[{"voice_id":"id1","name":"Alpha","category":"premade"},{"voice_id":"id2","name":"Beta","category":"premade"}]}`)); err != nil {
122122
t.Fatalf("write response: %v", err)
123123
}
@@ -136,7 +136,7 @@ func TestResolveVoiceDefaultsToFirst(t *testing.T) {
136136

137137
func TestResolveVoicePassThroughID(t *testing.T) {
138138
// Should short-circuit without hitting the server when input looks like an ID.
139-
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
139+
srv := httptest.NewServer(http.HandlerFunc(func(_ http.ResponseWriter, _ *http.Request) {
140140
t.Fatalf("server should not be called for ID pass-through")
141141
}))
142142
defer srv.Close()
@@ -152,7 +152,7 @@ func TestResolveVoicePassThroughID(t *testing.T) {
152152
}
153153

154154
func TestResolveVoiceClosestMatch(t *testing.T) {
155-
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
155+
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
156156
if _, err := w.Write([]byte(`{"voices":[{"voice_id":"id1","name":"Near","category":"premade"}]}`)); err != nil {
157157
t.Fatalf("write response: %v", err)
158158
}
@@ -176,7 +176,7 @@ func TestResolveVoiceClosestMatch(t *testing.T) {
176176
}
177177

178178
func TestResolveVoiceListOutputsTable(t *testing.T) {
179-
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
179+
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
180180
if _, err := w.Write([]byte(`{"voices":[{"voice_id":"id1","name":"Alpha","category":"premade"}]}`)); err != nil {
181181
t.Fatalf("write response: %v", err)
182182
}
@@ -274,7 +274,7 @@ func TestStreamAndPlayWithPlayback(t *testing.T) {
274274
})
275275
defer restore()
276276

277-
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
277+
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
278278
_, _ = w.Write([]byte("stream-play"))
279279
}))
280280
defer srv.Close()
@@ -301,7 +301,7 @@ func TestConvertAndPlayWithPlayback(t *testing.T) {
301301
})
302302
defer restore()
303303

304-
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
304+
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
305305
_, _ = w.Write([]byte("convert-play"))
306306
}))
307307
defer srv.Close()
@@ -379,7 +379,7 @@ func TestResolveVoiceByName(t *testing.T) {
379379
func stubPlay(t *testing.T, fn func([]byte)) func() {
380380
t.Helper()
381381
orig := playToSpeakers
382-
playToSpeakers = func(ctx context.Context, r io.Reader) error {
382+
playToSpeakers = func(_ context.Context, r io.Reader) error {
383383
b, _ := io.ReadAll(r)
384384
fn(b)
385385
return nil

0 commit comments

Comments
 (0)