Compare commits

2 Commits
Author SHA1 Message Date
m3ta-chironandClaude Fable 5.1 c65835f02a docs(readme): release download URLs with the version; Linux and Windows assets
release / release (push) Canceled after 0s
test / test (push) Canceled after 0s
Gitea serves release assets only under releases/download/<tag>/, the
latest/download alias returns 404.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-25 12:56:13 +01:00
m3ta-chironandClaude Fable 5.1 07c89f4939 feat(cli): talk version as a subcommand
test / test (push) Canceled after 0s
A bare `talk version` was spoken as an announcement because only the
--version flag existed. The subcommand prints the same line.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-25 12:53:30 +01:00
3 changed files with 30 additions and 6 deletions

No files matched your search

+9 -6
View File
@@ -28,21 +28,24 @@ dependencies.
| `talk test` | speak a test sentence; shows provider and timings (`--lang`, `--provider`, `--voice`); `--toast` sends a test notification instead |
| `talk doctor` | self-diagnosis: config, daemon, audio, providers, notifications, mute, laws (`--probe`, `--json`) |
| `talk setup` | first-time setup in a few questions: language, voices with preview, quiet hours, config.toml |
| `talk version` | version and commit (also `talk --version`) |
Say flags (also for `talk "text"`): `--wait`, `--now`, `--priority`,
`--voice`, `--lang`, `--provider`.
## Installation
**Release binary** (Linux, macOS, Windows; amd64/arm64): download the
matching `talk_<os>_<arch>` from the
[releases](https://code.m3ta.dev/m3tam3re/talk/releases), verify the
**Release binary** (Linux and Windows, amd64/arm64; macOS builds on
request, untested so far): download the matching `talk_<os>_<arch>` from
the [releases](https://code.m3ta.dev/m3tam3re/talk/releases), verify the
checksum against `checksums.txt`, put it in your PATH as `talk`. No other
dependencies.
dependencies. The download URL carries the version (Gitea has no
`latest/download` alias):
```console
curl -LO https://code.m3ta.dev/m3tam3re/talk/releases/latest/download/talk_linux_amd64
sha256sum -c --ignore-missing <(curl -sL https://code.m3ta.dev/m3tam3re/talk/releases/latest/download/checksums.txt)
V=v0.1.0
curl -LO https://code.m3ta.dev/m3tam3re/talk/releases/download/$V/talk_linux_amd64
sha256sum -c --ignore-missing <(curl -sL https://code.m3ta.dev/m3tam3re/talk/releases/download/$V/checksums.txt)
install -m 755 talk_linux_amd64 ~/.local/bin/talk
```
+9
View File
@@ -112,6 +112,15 @@ var commands = []command{
detail: "Asks a few questions for what talk needs to get going: keys (optional; without a key the free Edge voice speaks), a voice per language with preview, quiet hours, and writes config.toml (an existing file is merged, backup .bak). Without a terminal: only shows the effective configuration.",
handler: runSetup,
},
{
name: "version",
short: "show the version",
detail: "Prints the version and, when built from git, the commit. Same as `talk --version`; exists so that a bare `talk version` is not spoken as an announcement.",
handler: func(_ []string, _ *sayOptions, _ io.Reader, stdout, _ io.Writer) int {
fmt.Fprintln(stdout, versionString())
return exitOK
},
},
}
// addSayFlags registers the say flags and binds them to the returned options
+12
View File
@@ -52,6 +52,18 @@ func TestVersionDefault(t *testing.T) {
}
}
// TestVersionSubcommand: `talk version` prints the version instead of
// speaking the word.
func TestVersionSubcommand(t *testing.T) {
var out, errBuf bytes.Buffer
if code := runCLI([]string{"version"}, &out, &errBuf); code != exitOK {
t.Fatalf("version: exit code = %d, stderr %q", code, errBuf.String())
}
if got, want := out.String(), versionString()+"\n"; got != want {
t.Errorf("version output = %q, want %q", got, want)
}
}
func TestVersionStringWithCommit(t *testing.T) {
oldCommit := commit
commit = "c0ffee1"