Configure agent CLI

Step 1. Output webpack stats

@relative-ci/agent uses the JSON output of Webpack stats as a source of data. The following webpack.stats options are needed:

// webpack.config.js
  stats: {
    context: './src', // optional, will improve readability of the paths
    assets: true,
    entrypoints: true,
    chunks: true,
    modules: true

Select the method to output the webpack stats JSON file:

Step 2. Configure @relative-ci/agent

// relativeci.config.js
module.exports = {
  // Allow the agent to pick up the current commit message
  includeCommitMessage: true,
  webpack: {
    // Path to Webpack stats JSON file
    stats: './dist/webpack-stats.json'

Step 3. Configure Continuous integration(CI) service

1. Add environment variables


(Required) Navigate to and copy the project specific key from Project -> Settings -> Keys.


(Required for unsupported CI services) Set your Github project slug (eg: webpack/ if your CI service is not supported (

2. Run @relative/ci-agent on CI

Add a CI job to run @relative-ci/agent after the build job.

View config examples for:

Need help?Contact us via email, Twitter, or Github!


You can inspect the values for your setup using DEBUG environment variable:

$ DEBUG=relative-ci:agent npx relative-ci-agent
relative-ci:agent Config {
  config: {
    includeCommitMessage: true,
    webpack: { stats: './artifacts/webpack.json' }
  filepath: '/repo/relativeci.config.js'
} +0ms
relative-ci:agent env-ci params {
  branch: 'master',
  build: 122,
  buildUrl: '#',
  commit: '2e201aa',
  isCi: true,
  pr: undefined,
  prBranch: undefined,
  slug: 'organization/project'
} +111ms

Need help?Contact us via email, Twitter, or Github!