Configuration

Ignoring files

Control which files Bob Shell can access by creating a `.bobignore` file in your project.

Overview

FeatureDescriptionBenefit
Path exclusionPrevent Bob Shell from accessing specific files or directoriesProtect sensitive information
Pattern matchingUse glob patterns to match multiple filesEfficiently exclude file types
Negation supportOverride exclusions for specific filesFine-grained control
Project-specificEach project can have its own exclusion rulesCustomized 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

.bobignore controls which files Bob Shell's file tools can access. If a file matches an ignored pattern, Bob Shell's file tools cannot read, write, or delete it, and the file is excluded from list and search results. Shell commands run through execute_command are not filtered by .bobignore; a shell command can still read or modify files anywhere the operating system permits.

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, read_file, grep, glob, and list_files skip matching paths, and file write tools cannot modify them.

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│                 │     │                 │     │                 │
│  Your project   │────▶│  .bobignore     │────▶│  Files Bob Shell │
│  files          │     │  filter         │     │  can access     │
│                 │     │                 │     │                 │
└─────────────────┘     └─────────────────┘     └─────────────────┘

Bob Shell re-reads your .bobignore file automatically, so changes take effect within about 30 seconds without restarting.

Pattern syntax

The .bobignore file follows the same pattern syntax as .gitignore:

PatternDescriptionExample
file.txtMatches a specific fileapikeys.txt
*.extMatches all files with the extension*.log
/dir/Matches a directory/node_modules/
/path/to/fileAnchors the path to the root/src/config/secrets.json
!patternNegates a previous pattern!important.md
#Comment line# API credentials

Getting started

Creating a .bobignore file

  1. Create a file named .bobignore in the root of your project directory
  2. Add patterns for files and directories you want to exclude
  3. Save the file. Changes take effect within about 30 seconds.
# From your project root
touch .bobignore
echo "# Files to ignore" > .bobignore
echo "secrets/" >> .bobignore

Common 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/*.md

Advanced 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.js

Debugging your .bobignore file

If Bob Shell seems to be ignoring files you want it to access, or accessing files you want it to ignore:

  1. Check your .bobignore file for conflicting patterns
  2. Remember that more specific patterns (like negations) should come after general patterns
  3. Wait about 30 seconds after making changes for them to take effect
  4. Write patterns relative to the directory that contains the .bobignore file, as in .gitignore

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 .bobignore file as your project evolves
How is this topic?