-bash: vt: command not found
Closed this issue · 6 comments
I successfully cloned and installed vt
on OS X 12.0.1 but when I type vt
I get -bash: vt: command not found
.
Hello @PacoH,
How did you install it? I need more details to help you troubleshoot.
Anyways, you can try the instructions provided in this issue and see if it helps -> #41 (comment)
Regards,
Marta
Hello Marta,
Thanks for the speedy reply. I followed the instructions at VirusTotal/vt-cli: VirusTotal Command Line Interface.
~ $ git clone https://github.com/VirusTotal/vt-cli
Cloning into 'vt-cli'...
remote: Enumerating objects: 1169, done.
remote: Counting objects: 100% (233/233), done.
remote: Compressing objects: 100% (130/130), done.
remote: Total 1169 (delta 125), reused 169 (delta 97), pack-reused 936
Receiving objects: 100% (1169/1169), 314.36 KiB | 1.98 MiB/s, done.
Resolving deltas: 100% (830/830), done.
~ $ cd vt-cli
vt-cli $ make install
go install -ldflags "-X github.com/VirusTotal/vt-cli/cmd.Version=" github.com/VirusTotal/vt-cli/vt
vt-cli $ vt
-bash: vt: command not found
vt-cli $ vt init
-bash: vt: command not found
Brew installed Go:
vt-cli $ go version
go version go1.20.1 darwin/amd64
I followed the instructions you linked to at help with the installation of this repository · Issue #41 · VirusTotal/vt-cli and that worked.
For the sake of others having this problem this is what worked:
root@a7197fdf3d55:/vt-cli# go env GOPATH
/root/go
root@a7197fdf3d55:/vt-cli# go env GOBIN
root@a7197fdf3d55:/vt-cli# export GOBIN=`go env GOPATH`/bin
root@a7197fdf3d55:/vt-cli# go env GOBIN
/root/go/bin
root@a7197fdf3d55:/vt-cli# ls $GOBIN
vt
root@a7197fdf3d55:/vt-cli# export PATH=$PATH:$GOBIN
root@a7197fdf3d55:/vt-cli# vt
A command-line tool for interacting with VirusTotal.
My question now is, why wasn't this part of the installation instructions as well as the suggestion that Go be installed using brew
? I run into this problem a lot with github
installations. They almost never work 'right out of the box'. It takes time to chase down the problem, and in this case I could find nothing online to help. The Darwin environment is significantly different from the other UNIces' environment, thanks to 'stupid Apple' and their agrammatical mantra 'Think different'. It would help if instructions were tested and written by an Apple user.
After all that I discovered that Macos users can install the client with brew
and avoid all the problems.
virustotal-cli — Homebrew Formulae
brew install virustotal-cli
It even installs Bash completion for you. And it makes it easy to update.
This should be the preferred installation procedure. This is one of the few times that Mac 'makes things easier' 'for the rest of us', so we might as well embrace the rare experience.
The solution to the problem for me was to rename vt/main.go
to vt/vt.go
.
Go creates a binary with the name of the file by default.
You can simply clone the repo, rename that file, then type go install vt/vt.go
and it should take care of the rest assuming you have go installed.
You should never have to change anything like that. How did you even know what to change? The solution offered worked and the installation using brew
worked even better. If there is a brew
repo available, it is always faster, easier, and more reliable to use brew
.
Hello @PacoH,
Replying to your first question:
My question now is, why wasn't this part of the installation instructions as well as the suggestion that Go be installed using brew?
- We didn't encounter this problem ourselves (not having GOBIN in the PATH variable) and this is why it was not part of the documentation. Since it is a pretty common problem (as you can see we have some other users reporting the same problem) we'll add it.
- The brew formula is not maintained by us and that's why we don't mention it in our docs.
Thank you for your feedback, we'll update our docs.
Regards,
Marta