view.md

File viewing tool that reads and displays the contents of files with line numbers, allowing you to examine code, logs, or text data.

WHEN TO USE THIS TOOL:

  • Use when you need to read the contents of a specific file
  • Helpful for examining source code, configuration files, or log files
  • Perfect for looking at text-based file formats

HOW TO USE:

  • Provide the path to the file you want to view
  • Optionally specify an offset to start reading from a specific line
  • Optionally specify a limit to control how many lines are read
  • Do not use this for directories use the ls tool instead

FEATURES:

  • Displays file contents with line numbers for easy reference
  • Can read from any position in a file using the offset parameter
  • Handles large files by limiting the number of lines read
  • Automatically truncates very long lines for better display
  • Suggests similar file names when the requested file isn't found

LIMITATIONS:

  • Maximum file size is 250KB
  • Default reading limit is 2000 lines
  • Lines longer than 2000 characters are truncated
  • Cannot display binary files or images
  • Images can be identified but not displayed

WINDOWS NOTES:

  • Handles both Windows (CRLF) and Unix (LF) line endings automatically
  • File paths work with both forward slashes (/) and backslashes ()
  • Text encoding is detected automatically for most common formats

TIPS:

  • Use with Glob tool to first find files you want to view
  • For code exploration, first use Grep to find relevant files, then View to examine them
  • When viewing large files, use the offset parameter to read specific sections