File Context
Add files to the AI context so YeePilot can read, reference, and work with your configuration files, logs, and scripts.
Why File Context Matters
When you ask YeePilot to modify a configuration file, debug a script, or analyze a log, the AI works best when it can see the actual file contents. File context lets you load files directly into the conversation so the AI can reference them, understand their structure, and generate precise commands.
Without file context, the AI has to guess at file formats and current values. With file context, it can see exactly what is there and propose targeted changes.
Adding Files
Use the /file command followed by a file path:
> /file /etc/nginx/nginx.confYeePilot reads the file and adds its contents to the AI context. The AI can now reference the file's contents in its responses and use the information to generate more accurate commands.
You can add multiple files one at a time:
> /file /etc/nginx/sites-available/myapp.conf
> /file /var/log/nginx/error.log
> /file /home/deploy/myapp/docker-compose.ymlPractical Example
> /file /etc/nginx/nginx.conf
Added /etc/nginx/nginx.conf to context (2.1 KB)
> The site is returning 502 errors. Check the nginx config for issues
and fix any problems you find.With the config file loaded, the AI can read the actual server blocks, upstream definitions, and proxy settings rather than working blind.
Listing Loaded Files
See which files are currently in the AI context:
> /filesThis shows all loaded files with their sizes:
Files in context:
1. /etc/nginx/nginx.conf (2.1 KB)
2. /etc/nginx/sites-available/myapp.conf (856 B)
3. /var/log/nginx/error.log (12.3 KB)
Total: 3 files, 15.3 KBRemoving Files
Remove a file from context when it is no longer needed:
> /unfile /var/log/nginx/error.logThis frees up context space for other files or conversation. Removing files you are done with helps keep token usage lower and keeps the AI focused on relevant content.
Uploading Files
The /upload command provides an alternative way to add files:
> /uploadThis opens a file selection flow. Use it when you want to add files interactively rather than typing paths directly.
Limits
File context has sensible limits to prevent overwhelming the AI's context window:
| Limit | Default Value |
|---|---|
| Maximum number of files | 20 |
| Maximum size per file | 100 KB |
| Maximum total size | 512 KB |
Files exceeding the per-file limit will be rejected with a message explaining the size constraint. If the total loaded size would exceed 512 KB, you will need to remove some files before adding new ones.
Adjusting Limits
You can customize these limits in your configuration file (~/.yeepilot/config.yaml):
files:
max_entries: 20
max_file_size: 102400 # bytes (100 KB)
max_total: 524288 # bytes (512 KB)Increasing these limits uses more of the AI's context window per message, which increases token costs and may trigger context compaction sooner. The defaults work well for most server management tasks.
Live Stream Panel
When YeePilot's agent loop performs file edits during a multi-step task, the live stream panel shows those changes in real time. This gives you visibility into exactly what the AI is reading and modifying as it works.
Toggling the Live Stream
> /livestreamThis toggles the live stream panel on or off. When enabled, the panel appears alongside the main conversation and displays:
- File contents being read by the AI
- Proposed edits highlighted with diffs
- Real-time progress through multi-file operations
The live stream is especially useful in agent mode when the AI is working through a sequence of file modifications, such as updating multiple configuration files or applying a set of changes across a project.
Common Workflows
Configuration Review
Load a configuration file and ask the AI to review it:
> /file /etc/ssh/sshd_config
> Review this SSH configuration for security issues and suggest hardening changesThe AI reads the actual configuration values and provides specific recommendations with exact line changes.
Log Analysis
Load a log file to get help understanding errors:
> /file /var/log/syslog
> What errors occurred in the last hour? Summarize the issues.For large log files that exceed the size limit, use the AI to read specific sections instead:
> Show me the last 200 lines of /var/log/syslog that contain "error" or "fail"Multi-File Context
When working on a task that involves several related files, load them all:
> /file /etc/nginx/nginx.conf
> /file /etc/nginx/sites-available/api.conf
> /file /etc/letsencrypt/renewal/api.example.com.conf
> /file docker-compose.yml
> Set up nginx as a reverse proxy for the Docker service on port 3000
with SSL using the existing Let's Encrypt certificateWith all the relevant files loaded, the AI can cross-reference the Docker service configuration, the existing SSL certificate paths, and the current nginx setup to generate a complete and correct configuration.
Script Development
Load an existing script to get help extending or debugging it:
> /file /home/deploy/backup.sh
> This backup script is failing silently. Add proper error handling
and send an email notification on failure.The AI sees the current script structure and can add error handling that fits the existing coding style and logic flow.
Tips
- Load files before asking about them. The AI gives much better answers when it can see the actual content rather than guessing.
- Remove files you are done with. This keeps context clean and costs lower.
- Use
/filesto check what is loaded before starting a new task. Leftover files from a previous task can confuse the AI. - For very large files, ask the AI to read specific sections with commands like
head,tail, orgreprather than loading the entire file into context.