๐ง Fish
Fish (Friendly Interactive SHell) is a modern, userโfriendly shell designed primarily for interactive use.
It focuses on usability, discoverability, and developer productivity rather than POSIX compatibility or scripting portability.
๐ Who This Is For
- Developers customizing their interactive terminal experience
- Users who want a friendly, discoverable shell
- Teams standardizing developer environments
- Anyone evaluating shells for interactive workflows
๐งฉ Role in the Ecosystem
- Popular as a personal interactive shell on developer machines
- Provides advanced UX features out of the box (autosuggestions, syntax highlighting)
- Not intended for system scripting or automation
- Rarely available in servers, CI/CD runners, or minimal container images
๐งฉ Key Characteristics
- NonโPOSIX syntax (incompatible with
/bin/sh and bash)
- Builtโin help, completions, and suggestions
- Humanโfriendly, readable syntax
- No need for complex configuration frameworks
- Different scripting model than sh/bash/zsh
๐ง Notable Features
- Autosuggestions and completions:
Fish suggests commands based on history and context automatically.
- Humanโfriendly variable syntax:
| set name "robert"
echo $name
|
| set arr one two three
echo $arr[2]
|
โ ๏ธ Limitations & Pitfalls
- Not POSIX compliant
- Scripts written in fish are not portable to sh/bash
- Not suitable for automation, CI/CD, or system scripts
- Not available in most production environments
- Syntax differs significantly from other shells, making migration harder
๐ง When to Use Fish
- As a personal interactive shell
- Developer workstations
- Improving terminal ergonomics and productivity
- Environments where scripting portability is not required
โ When Not to Use Fish
- System scripts
- CI/CD pipelines
- Container entrypoints
- Crossโplatform automation
- Any script intended for
/bin/sh or bash
โ
Best Practices
- Use fish only for interactive sessions
- Keep configuration minimal and versionโcontrolled
- Avoid writing automation in fish syntax
- Use POSIX sh or bash for scripting
- Document clearly when fish is required for a developer environment
๐งช Testing Fish Scripts
| fish --no-execute script.fish # syntax check
fish --debug-level=1 script.fish
|
๐ง Summary
Fish is excellent for humans at a terminal, offering a modern, ergonomic interactive experience.
It is not designed for automation or scripting portability โ use it to enhance productivity, not to run production systems.