Terminal / Shell
If you frequently need to launch Terminal or shell commands, you can do so from within Alfred.

Prefix your shell command with > to launch Terminal and run the command.
Changing Terminal preferences
In Alfred Preferences > Features > Terminal you can choose an alternative prefix to > from a dropdown menu. You can also choose a different terminal application. Alfred supports the macOS Terminal app by default.

Custom Terminal integration
Choose Custom from the dropdown if you'd like to use your own AppleScript.
Wrap the custom Terminal AppleScript in alfred_script(q) and end alfred_script, for example:
on alfred_script(q)
tell application "Terminal"
activate
do script q
end tell
end alfred_script
iTerm2 integration
If iTerm2 is your terminal app of choice, you can find integration scripts for it on Vítor Galvão's Custom Alfred iTerm Scripts GitHub repository.
Using Terminal for advanced tasks
If you want to run more complex scripts and AppleScripts, take a look at the Workflows feature, which allows you to create advanced scripts connected to keywords and hotkeys.
You can also launch the Browse in Terminal Action from a workflow.