You download a command line tool from a project you trust, run it, and macOS says it can’t be opened. The block comes from an attribute added at download time.
Browsers and many other apps add com.apple.quarantine to every file they save, and Gatekeeper checks it the first time the file runs. For a single binary you trust, remove only that attribute:
xattr -d com.apple.quarantine ./tool
Running xattr -l ./tool before and after shows the attribute is gone.
For an app bundle, add -r so every file inside is cleared:
xattr -r -d com.apple.quarantine /Applications/SomeTool.app
I prefer this to xattr -c, which wipes every extended attribute on the file, including ones you may want, like Finder tags or where the file came from.
Please treat this as what it is: switching off a safety check for that file. Gatekeeper is there to stop unsigned or tampered software. Only do it for files from a source you trust, ideally after checking the published checksum with shasum -a 256. If you are not sure, check it first with spctl --assess, or use System Settings, Privacy & Security, Open Anyway, which does the same thing for one app with an explicit prompt.
Further reading: xattr man page (macOS), Gatekeeper and runtime protection (Apple Platform Security)