Pods are installed in a folder local to your project, not in any global folder that would already be defined in the terminals $PATH variable, so the terminal is unable to find the script.
There are a few options, but it mostly comes down to being more specific about where the executable is, presuming (for example) your project folder is located at /Users/John/Documents/MyiOsProject/
The pods are likely installed in Pods/SwiftLint/bin
so you should be able to run /Users/John/Documents/MyiOsProject/Pods/SwiftLint/bin/swiftlint autocorrect
This can obviously get tedious very quickly, so just alias it. (Another option would be a Symlink)
open up the file ~/.bashrc
for editing and add
alias swiftlint='/Users/John/Documents/MyiOsProject/Pods/SwiftLint/bin/swiftlint'
then you should be able to just type swiftlint autocorrect
.
Note: I dont know your exact paths, so you may need to make some minor changes.