Syntax
Arguments
Path to the file to view. Can be relative to current directory or project directory.
Behavior
- Attempts to find file in current working directory
- If not found, searches in current project directory
- Applies syntax highlighting based on file extension
- Displays full file contents with line numbers
Supported Languages
Automatic detection for:- JavaScript (
.js,.jsx) - TypeScript (
.ts,.tsx) - Python (
.py) - Go (
.go) - Rust (
.rs) - Java (
.java) - C/C++ (
.c,.cpp,.h) - JSON (
.json) - YAML (
.yaml,.yml) - Markdown (
.md) - HTML (
.html) - CSS (
.css,.scss,.sass) - Shell (
.sh,.bash) - And many more…
Examples
View file in current directory
View file in project
View configuration file
View nested file
Output Format
File Resolution
Search Order
-
Current working directory
./file- Relative to where command is run
-
Current project directory
- Falls back if not found in CWD
- Uses project path from config
Absolute Paths
Absolute paths work from any location:Error Handling
Use Cases
- Quick preview of files from search results
- View files without opening editor
- Check file contents during development
- Review code with syntax highlighting in terminal
Comparison with Other Tools
| Tool | Syntax Highlighting | Project-Aware | Line Numbers |
|---|---|---|---|
cat | No | No | No |
bat | Yes | No | Yes |
adist view | Yes | Yes | Yes |
Tips
- Combine with
adist getto find then view files - Use relative paths when inside project directory
- Output can be piped to other commands
Related Commands
- adist get - Search for files to view
- adist query - Ask about file contents