Skip to content

Project Configuration

The rover.json file is an optional configuration file that defines project-wide settings. Rover works out of the box without it. When you run any Rover command in a git repository, Rover automatically registers the project and detects your environment.

Create a rover.json when you want to:

  • Share configuration with your team: Commit the file to version control so everyone uses the same MCP servers, environment variables, and hooks
  • Add MCP servers: Provide additional context to AI agents via Model Context Protocol
  • Configure hooks: Run custom commands when tasks are merged, pushed, or completed
  • Pass environment variables: Share API keys or configuration with containerized agents

You can create a rover.json manually or run rover init to generate one with detected defaults.

FieldDescription
languagesProgramming languages used in the project
packageManagersPackage managers available (npm, pnpm, pip, etc.)
taskManagersTask runners like Make, Just, or Task
mcpsModel Context Protocol servers providing additional context to AI agents
attributionWhether Rover adds itself as co-author on AI-assisted commits
envsCustom environment variables passed to containerized agents
envsFilePath to a dotenv file with environment variables
hooksCommands to run at task lifecycle events (see Hooks)
sandboxCustomize the container environment (see Sandbox Configuration)
excludePatternsGlob patterns for files to exclude from task workspaces

Here’s a minimal example:

{
// Schema version for automatic migration
"version": "1.3",
// Programming languages used in the project
"languages": ["typescript", "javascript"],
// Package managers available
"packageManagers": ["npm"],
// Task runners (optional)
"taskManagers": [],
// MCP servers for AI context (optional)
"mcps": [],
// Add Rover as co-author on commits
"attribution": true
}

Add Model Context Protocol servers to provide additional context to AI agents. These MCP servers are automatically installed in each task’s sandboxed environment.

{
"version": "1.3",
"languages": ["typescript"],
"packageManagers": ["npm"],
"mcps": [
{
"name": "filesystem",
"commandOrUrl": "npx -y @modelcontextprotocol/server-filesystem /path/to/files",
"transport": "stdio"
},
{
"name": "database",
"commandOrUrl": "npx -y @modelcontextprotocol/server-postgres",
"transport": "stdio",
"envs": ["DATABASE_URL"]
}
]
}

Pass environment variables to containerized AI agents using two methods.

Use the envs array to pass environment variables:

{
"version": "1.3",
"languages": ["javascript"],
"packageManagers": ["npm"],
"envs": [
"NODE_ENV", // Pass through from host
"DEBUG=true", // Set explicit value
"API_KEY" // Pass through from host
]
}

Environment variable formats:

  • "ENV_NAME": Pass the current value from your host machine to the container
  • "ENV_NAME=VALUE": Set a specific value in the container (overrides host value)

Load variables from a dotenv file using the envsFile field:

{
"version": "1.3",
"languages": ["javascript"],
"packageManagers": ["npm"],
"envsFile": ".env.rover"
}

Create a .env.rover file in your project root:

Terminal window
NODE_ENV=development
DEBUG=true
API_KEY=your-api-key-here
DATABASE_URL=postgres://localhost:5432/mydb

You can use both envs and envsFile together. Values in envs take precedence:

{
"version": "1.3",
"languages": ["javascript"],
"packageManagers": ["npm"],
"envsFile": ".env.rover", // Load from file
"envs": ["DEBUG=false"] // Override specific values
}

Control whether Rover adds itself as co-author on commits:

{
"version": "1.3",
"languages": ["typescript"],
"packageManagers": ["npm"],
"attribution": false
}

When attribution is enabled, commits generated by Rover include:

Co-Authored-By: Rover <[email protected]>

Use excludePatterns to prevent specific files from being checked out in task workspaces. Excluded files won’t be visible to or modifiable by AI agents. This is useful for:

  • Sensitive files: Credentials, API keys, or secrets
  • Large files: Binary assets, datasets, or generated files
  • Protected code: Files that shouldn’t be modified by agents
{
"version": "1.3",
"languages": ["typescript"],
"packageManagers": ["npm"],
"excludePatterns": [
"secrets/**",
"*.env",
".env.*",
"credentials.json",
"data/*.csv"
]
}

Patterns use glob syntax and are applied via git sparse checkout:

PatternMatches
secrets/**All files in the secrets/ directory
*.envAll files ending in .env
.env.*Files like .env.local, .env.production
internal/config.tsA specific file
/root-only.txtFile only at the repository root

The version field enables automatic migration when upgrading Rover:

{
"version": "1.3", // Current project config version
// ... other settings
}

When Rover detects an older schema version, it automatically migrates your configuration to the latest format.

For a complete list of all available configuration options, see the Project Config Reference.