Ignoring files
Control which files Bob Shell can access by creating a `.bobignore` file in your project.
Overview
| Feature | Description | Benefit |
|---|---|---|
| Path exclusion | Prevent Bob Shell from accessing specific files or directories | Protect sensitive information |
| Pattern matching | Use glob patterns to match multiple files | Efficiently exclude file types |
| Negation support | Override exclusions for specific files | Fine-grained control |
| Project-specific | Each project can have its own exclusion rules | Customized to project needs |
Why use .bobignore?
- Privacy protection: Keep sensitive files like API keys and credentials private
- Performance improvement: Exclude large binary files or directories that slow down operations
- Noise reduction: Remove irrelevant files from Bob Shell's context
- Focus control: Direct Bob Shell's attention to the most relevant parts of your codebase
How .bobignore works
When you add paths to your .bobignore file, Bob Shell tools that respect this file will automatically exclude matching files and directories from their operations. For example, when using the read_many_files command, any paths in your .bobignore file will be skipped.
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ │ │ │ │ │
│ Your project │────▶│ .bobignore │────▶│ Files Bob Shell │
│ files │ │ filter │ │ can access │
│ │ │ │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘Changes to your .bobignore file require restarting your Bob Shell session to take effect.
Pattern syntax
The .bobignore file follows the same pattern syntax as .gitignore:
| Pattern | Description | Example |
|---|---|---|
file.txt | Matches a specific file | apikeys.txt |
*.ext | Matches all files with the extension | *.log |
/dir/ | Matches a directory | /node_modules/ |
/path/to/file | Anchors the path to the root | /src/config/secrets.json |
!pattern | Negates a previous pattern | !important.md |
# | Comment line | # API credentials |
Getting started
Creating a .bobignore file
- Create a file named
.bobignorein the root of your project directory - Add patterns for files and directories you want to exclude
- Save the file and restart your Bob Shell session
# From your project root
touch .bobignore
echo "# Files to ignore" > .bobignore
echo "secrets/" >> .bobignoreCommon exclusion patterns
Here are some common patterns you might want to add to your .bobignore file:
# Sensitive information
.env
secrets/
*password*
*credential*
*apikey*
# Large directories
node_modules/
.git/
dist/
build/
# Binary and media files
*.zip
*.tar.gz
*.mp4
*.jpg
*.png
# Log files
*.log
logs/Pattern examples
Excluding specific directories
To exclude entire directories and their contents:
# Exclude the packages directory and all its contents
/packages/
# Exclude all node_modules directories anywhere in the project
**/node_modules/
# Exclude the dist directory but only at the root level
/dist/Using wildcards
Wildcards let you match multiple files with similar patterns:
# Exclude all markdown files
*.md
# Exclude all JavaScript files in the src directory
/src/**/*.js
# Exclude all files with "test" in their name
*test*Using negation
You can override exclusions for specific files:
# Exclude all markdown files
*.md
# But include README.md
!README.md
# And include all markdown files in the docs directory
!docs/*.mdAdvanced usage
Combining patterns
You can create sophisticated exclusion rules by combining patterns:
# Exclude all JavaScript files
*.js
# But include all files in the src directory
!src/**/*.js
# Except for test files in the src directory
src/**/*.test.jsDebugging your .bobignore file
If Bob Shell seems to be ignoring files you want it to access, or accessing files you want it to ignore:
- Check your
.bobignorefile for conflicting patterns - Remember that more specific patterns (like negations) should come after general patterns
- Restart your Bob Shell session after making changes
- Use absolute paths if relative paths aren't working as expected
Best practices
- Start simple: Begin with a few essential patterns and add more as needed
- Comment your patterns: Add comments to explain why certain files are excluded
- Be specific: Use precise patterns to avoid accidentally excluding important files
- Consider security: Always exclude files containing sensitive information
- Maintain regularly: Update your
.bobignorefile as your project evolves
Integrating with Bob IDE
Connect Bob Shell directly to your code editor for a seamless development experience. This integration enhances Bob Shell's capabilities by providing real-time workspace awareness and enabling powerful features like in-editor diff viewing.
Memory files
Break down large AGENTS.md files into smaller, reusable components using a simple import syntax.