Skip to content

Configuration

ReArch uses a configuration file at the root of your project to control behavior, integrations, and deployment settings.

The main configuration file is rearch.config.mjs located in your project root.

rearch.config.mjs
import { defineConfig } from '@rearch/core';
export default defineConfig({
project: {
name: 'my-project',
version: '1.0.0',
},
agents: {
maxConcurrency: 5,
timeout: 30000,
retries: 3,
},
pipelines: {
batchSize: 100,
parallelism: 4,
},
integrations: {
github: {
enabled: true,
autoSync: true,
},
},
});
OptionTypeDefaultDescription
project.namestringpackage.json nameThe project name
project.versionstring"0.0.1"Project version
project.descriptionstring""Brief project description
OptionTypeDefaultDescription
agents.maxConcurrencynumber5Max concurrent agent executions
agents.timeoutnumber30000Timeout in ms for agent operations
agents.retriesnumber3Number of retry attempts on failure
agents.logLevelstring"info"Logging level: debug, info, warn, error
OptionTypeDefaultDescription
pipelines.batchSizenumber100Items per batch
pipelines.parallelismnumber4Parallel pipeline workers
pipelines.retryPolicystring"exponential"Retry policy: fixed, exponential, none
pipelines.deadLetterQueuebooleantrueEnable dead letter queue for failed items
OptionTypeDefaultDescription
integrations.github.enabledbooleanfalseEnable GitHub integration
integrations.github.autoSyncbooleanfalseAuto-sync changes to GitHub
integrations.slack.enabledbooleanfalseEnable Slack notifications
integrations.slack.webhookstring""Slack webhook URL

You can create environment-specific overrides:

rearch.config.mjs # Base configuration
rearch.config.dev.mjs # Development overrides
rearch.config.staging.mjs # Staging overrides
rearch.config.prod.mjs # Production overrides

ReArch automatically merges the environment config with the base config:

Terminal window
# Uses rearch.config.mjs + rearch.config.staging.mjs
REARCH_ENV=staging bun run start

For full type checking in your configuration file, use the defineConfig helper:

import { defineConfig } from '@rearch/core';
import type { ReArchConfig } from '@rearch/core';
const config: ReArchConfig = defineConfig({
// Full IntelliSense support here
});
export default config;