> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cirron.com/llms.txt
> Use this file to discover all available pages before exploring further.

# .cirronignore

> Control which paths are included in build, push, deploy, and sync.

# .cirronignore

The `.cirronignore` file allows you to specify which files and directories should be excluded from Cirron CLI operations like building, testing, and deployment. This is similar to `.gitignore` but specifically for Cirron operations.

## Overview

When you run Cirron CLI commands like `cirron build`, `cirron test`, or `cirron deploy`, the CLI scans your project directory to determine which files to include. The `.cirronignore` file lets you control this process by specifying patterns for files and directories that should be excluded.

## File Location

Place the `.cirronignore` file in your project root directory (the same directory as your `cirron.yaml` file):

```
my-ml-project/
├── cirron.yaml
├── .cirronignore          ← Place here
├── src/
├── data/
├── models/
└── requirements.txt
```

## Syntax

The `.cirronignore` file uses a simple pattern matching syntax:

### Basic Patterns

```bash theme={null}
# Ignore specific files
config.local.json
secrets.env
*.log

# Ignore directories
node_modules/
__pycache__/
.pytest_cache/
venv/

# Ignore files in specific directories
data/raw/
models/checkpoints/
logs/*.log
```

### Pattern Examples

| Pattern         | Description                                   | Examples                                |
| --------------- | --------------------------------------------- | --------------------------------------- |
| `*.log`         | Ignore all files with .log extension          | `app.log`, `error.log`                  |
| `node_modules/` | Ignore the entire node\_modules directory     | `node_modules/`, `node_modules/lodash/` |
| `data/raw/`     | Ignore the data/raw directory                 | `data/raw/`, `data/raw/images/`         |
| `*.tmp`         | Ignore temporary files                        | `temp_123.tmp`, `backup.tmp`            |
| `config.*.json` | Ignore config files with environment suffixes | `config.dev.json`, `config.prod.json`   |

### Negation Patterns

Use `!` to negate a pattern and explicitly include files that would otherwise be ignored:

```bash theme={null}
# Ignore all .pyc files
*.pyc

# But include this specific one
!important.pyc

# Ignore all data files
data/

# But include the processed data
!data/processed/
```

## Default Patterns

The Cirron CLI automatically ignores common files and directories even without a `.cirronignore` file:

### Version Control

* `.git/`
* `.svn/`
* `.hg/`

### Dependencies

* `node_modules/`
* `__pycache__/`
* `*.pyc`
* `.pytest_cache/`
* `venv/`
* `env/`
* `.env`

### Build Artifacts

* `dist/`
* `build/`
* `*.log`
* `*.tmp`
* `*.temp`

### IDE Files

* `.vscode/`
* `.idea/`
* `*.swp`
* `*.swo`
* `*~`

### OS Files

* `.DS_Store`
* `Thumbs.db`

### Cirron Specific

* `temp_*.py`
* `temp_*.sh`

## Examples

### Basic .cirronignore

```bash theme={null}
# Development files
.env.local
.env.development
*.log

# Large data files
data/raw/
data/downloads/
*.csv
*.parquet

# Model checkpoints (too large for deployment)
models/checkpoints/
*.pth
*.h5

# Temporary files
temp/
tmp/
*.tmp
```

### Advanced .cirronignore

```bash theme={null}
# Ignore all data files
data/

# But include processed data
!data/processed/
!data/features/

# Ignore all logs
*.log
logs/

# But include important logs
!logs/important.log

# Ignore development configs
config.dev.json
config.local.json

# Ignore large model files
models/*.pkl
models/*.joblib
models/checkpoints/

# Ignore test data
tests/data/
test_data/

# Ignore documentation
docs/
*.md
!README.md
```

## Usage in Commands

The `.cirronignore` file is automatically used by these CLI commands:

### Build Command

```bash theme={null}
cirron build
```

Only includes files not ignored by `.cirronignore` in the container build context.

### Test Command

```bash theme={null}
cirron test
```

Excludes ignored files when scanning for test files and dependencies.

### Deploy Command

```bash theme={null}
cirron deploy
```

Only deploys files that aren't ignored by `.cirronignore`.

### Info Command

```bash theme={null}
cirron info
```

Shows which files are included/excluded based on `.cirronignore` patterns.

## Best Practices

### 1. Keep it Minimal

Only ignore files that are truly not needed for your ML model or application:

```bash theme={null}
# Good - only ignores unnecessary files
*.log
.env
__pycache__/

# Avoid - too restrictive
*.py
src/
```

### 2. Use Specific Patterns

Be specific about what you're ignoring to avoid accidentally excluding important files:

```bash theme={null}
# Good - specific
data/raw/
models/checkpoints/

# Avoid - too broad
data/
models/
```

### 3. Include Processed Data

If you have data processing pipelines, make sure to include processed data:

```bash theme={null}
# Ignore raw data
data/raw/

# Include processed data
!data/processed/
!data/features/
```

### 4. Consider File Sizes

Use `.cirronignore` to exclude large files that aren't needed for deployment:

```bash theme={null}
# Large model checkpoints
models/checkpoints/
*.pth
*.h5

# Large datasets
data/raw/
*.csv
*.parquet
```

### 5. Test Your Patterns

Verify your patterns by running a dry-run build or test to see which files are processed:

```bash theme={null}
cirron build --dry-run
```

## Troubleshooting

### Files Still Being Included

If files are still being included despite being in `.cirronignore`:

1. Check the file path is relative to your project root
2. Verify the pattern syntax is correct
3. Make sure there are no negation patterns (`!`) that override your ignore pattern
4. Check if the file is being explicitly included by another mechanism

### Files Being Excluded Unexpectedly

If important files are being excluded:

1. Check for overly broad patterns like `data/` or `models/`
2. Use negation patterns to explicitly include files: `!important_file.py`
3. Verify the file path matches your pattern exactly

### Pattern Not Working

Common issues with patterns:

```bash theme={null}
# Wrong - missing trailing slash for directory
data

# Correct - trailing slash for directory
data/

# Wrong - incorrect wildcard
*.py*

# Correct - proper wildcard
*.py
```

## Related Commands

* [`cirron info`](/cli/commands/info) - View project information including file inclusion/exclusion
* [`cirron build`](/cli/commands/build) - Build project with file filtering
* [`cirron test`](/cli/commands/test) - Test project with file filtering
* [`cirron deploy`](/cli/commands/deploy) - Deploy project with file filtering
