exec prints the install of a missing version to stdout, next to the output of the command

Open Beginner friendly
#823 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go, shell
Domain
cli

Research direction

The stray output comes from cmd/commands/exec.go near line 169, where fmt.Printf prints the 'not found, installing' message, and from internal/sdk/sdk.go around lines 388 and 434, where pterm.Printf writes install messages to standard output. Start by reading those call sites and check whether they can write to standard error instead. Done means that vfox exec [email protected] -- etcd --version 2>/dev/null | head -1 prints the command's own output first, with install messages absent from stdout.

Written by the indexing model from the issue text.

Description

vfox exec installs a version that is not installed yet, as the "Auto Install" tip in docs/usage/core-commands.md says. The messages of that install go to standard output, which is also where the output of the command goes. A pipeline that reads the output of the command therefore gets the install messages first.

Reproduction on a GitHub-hosted runner (Ubuntu 26.04.1, x86_64) with the vfox 1.1.0 release archive (checksum verified) and the zip archive of the vfox-etcd v0.2.3 tag. Run: https://github.com/version-fox/vfox-plus/actions/runs/45056971190

vfox add --source vfox-etcd-v0.2.3.zip
vfox exec [email protected] -- etcd --version 2>/dev/null | head -1

Actual output: the first line is SDK [email protected] not found, installing....

The complete standard output of vfox exec [email protected] -- etcd --version in the same run starts with:

SDK [email protected] not found, installing...
etcd download url: https://github.com/etcd-io/etcd/releases/download/v3.5.12/etcd-v3.5.12-linux-amd64.tar.gz
Preinstalling [email protected]...
Verifying checksum f2ff0cb4...
Unpacking .../etcd-v3.5.12-linux-amd64.tar.gz...
etcd installed path: .../v-3.5.12/etcd-3.5.12

and then the output of etcd --version. The download progress is on standard error. After the install, the same command's standard output starts with etcd Version: 3.5.12.

Expected: the messages of the installation go to standard error, so that the standard output of vfox exec ... -- <command> is the output of the command.

Where it comes from: cmd/commands/exec.go:169 prints SDK %s@%s not found, installing... with fmt.Printf. internal/sdk/sdk.go:388 and internal/sdk/sdk.go:434 print the install messages with pterm.Printf, which writes to standard output. The plugin's own print calls, such as the download URL above, also write to standard output.

The docs recommend vfox exec for Docker and CI (docs/usage/core-commands.md), where the output of the command is often captured.

Dominant language
Go
Stars
4k
Forks
177
Avg merge
1d 20h
Merged PRs (30d)
31

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from version-fox/vfox

All issues in version-fox/vfox

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.