Master file reading and analysis operations using Desktop Commander read tools.
Use when reading files, analyzing file contents, processing different file formats
(text, PDF, DOCX, Excel, images), or extracting data from local files.
Triggers on tasks involving file inspection, content extraction, data analysis,
or reading configuration files, logs, code files, and documents.
Comprehensive guide for reading and analyzing files using Desktop Commander tools
in the Auto-AI framework. This skill covers efficient file reading, format handling,
and data extraction techniques.
When to Use This Skill
Use this skill when:
Reading files from the filesystem (text, binary, documents)
Analyzing file contents or structure
Processing large files that need pagination
Working with different file formats (PDF, DOCX, Excel, images)
Extracting specific sections of code or data
Debugging file access issues
Analyzing logs, configuration files, or code
Tool Selection Guide
Task
Tool
Best For
Read any file
Desktop_Commander_read_file
Primary tool for all file types
Skills relacionados
Multiple files
Desktop_Commander_read_multiple_files
Batch reading
List directory
Desktop_Commander_list_directory
File discovery
Search files
Desktop_Commander_start_search
Finding files by pattern
Get file info
Desktop_Commander_get_file_info
Metadata without reading
File analysis
start_process + Python
Data processing
Core Reading Patterns
1. Basic File Reading
// Read entire file (text or binary)
const content = await Desktop_Commander_read_file('/path/to/file.js');
// Read with options
const content = await Desktop_Commander_read_file('/path/to/file.txt', {
encoding: 'utf8', // File encoding
offset: 0, // Start line (0-based)
length: 1000, // Max lines to read
});
2. Large File Handling
// Read last N lines (tail behavior)
const tail = await Desktop_Commander_read_file('/var/log/app.log', {
offset: -100, // Last 100 lines
});
// Read specific range
const section = await Desktop_Commander_read_file('/path/to/file.js', {
offset: 50, // Start at line 50
length: 20, // Read 20 lines
});
// Chunked reading for very large files
async function readInChunks(filePath, chunkSize = 1000) {
let offset = 0;
let allContent = '';
while (true) {
const chunk = await Desktop_Commander_read_file(filePath, {
offset: offset,
length: chunkSize,
});
if (!chunk || chunk.trim() === '') break;
allContent += chunk;
offset += chunkSize;
}
return allContent;
}
3. Format-Specific Reading
PDF Files
// Read PDF with markdown extraction
const pdfContent = await Desktop_Commander_read_file('/path/to/document.pdf');
// Read specific pages
const firstPages = await Desktop_Commander_read_file('/path/to/document.pdf', {
offset: 0, // Start page (0-based)
length: 5, // Number of pages
});
Excel Files
// Read Excel with range
const excelData = await Desktop_Commander_read_file('/path/to/data.xlsx', {
sheet: 'Sheet1', // Sheet name or index
range: 'A1:D100', // Cell range
});
// Returns JSON array format
const data = JSON.parse(excelData);
DOCX Files
// Read DOCX outline (structure view)
const outline = await Desktop_Commander_read_file('/path/to/document.docx');
// Read raw XML for editing
const xml = await Desktop_Commander_read_file('/path/to/document.docx', {
offset: 1, // Must be non-zero for raw XML
length: 100,
});
Image Files
// Returns base64 encoded image
const imageData = await Desktop_Commander_read_file('/path/to/image.png');
// Content includes base64 data and MIME type