Skip to main content
cops init scaffolds a cops.project.json file from a built-in template. Use it to quickly get a valid release gate config without writing JSON by hand.

Usage

cops init [--template <template>] [--target <target>] [--defaultProject <id>] [--force]

Flags

--template
string
default:"all"
Template profile to generate. Controls which project entries and gates are included in the output file.
ValueWhat it generates
allAll three templates as separate project entries
backend-serviceServer-side service with Jira, Confluence, Bitbucket, and Bamboo gates
mobile-appMobile client project with Jira, Bitbucket, and Bamboo gates
shared-platformShared platform component with Confluence freshness and dual Bamboo plans
--target
string
default:"global"
Where to write cops.project.json.
ValuePath
global~/.config/cops/cops.project.json (Linux/macOS) or %APPDATA%\cops\cops.project.json (Windows)
local./cops.project.json in the current working directory
--defaultProject
string
Override the defaultProject field in the generated config. Defaults to the first project key produced by the chosen template.
--force
boolean
default:"false"
Overwrite an existing cops.project.json at the target path. Without this flag, the command exits with an error if the file already exists.

Config file precedence

When cops commands look for cops.project.json, they check in this order and use the first file found:
  1. COPS_PROJECT_CONFIG environment variable — explicit path; takes priority over everything else
  2. Global config directory~/.config/cops/cops.project.json (Linux/macOS) or %APPDATA%\cops\cops.project.json (Windows)
  3. Current working directory./cops.project.json
Set COPS_PROJECT_CONFIG=/path/to/my-config.json to point cops at a specific file without moving it or changing the global config.

Examples

cops init --template backend-service

Generated file

After running cops init --template backend-service, the global config file contains:
{
  "defaultProject": "backend-service",
  "projects": {
    "backend-service": {
      "jira": {
        "projectKey": "SRV",
        "fixVersion": "2026-03-13",
        "readyStatuses": ["Ready for Release", "Done", "Closed", "Resolved"]
      },
      "confluence": {
        "requiredPages": [
          { "spaceKey": "ENG", "title": "Service Deployment Playbook" }
        ]
      },
      "bitbucket": {
        "projectKey": "SRV",
        "repo": "service-api",
        "releaseBranch": "release/2026-03-13"
      },
      "bamboo": {
        "requiredPlans": ["SRV-PLAN"]
      },
      "gates": [
        { "id": "jira-stories",              "type": "jira-stories-exist",              "enabled": true, "severity": "high" },
        { "id": "confluence-doc",            "type": "confluence-page-exists",          "enabled": true, "severity": "high" },
        { "id": "confluence-sections",       "type": "confluence-page-sections",        "enabled": true, "severity": "high", "params": { "requiredSections": ["Deployment Steps", "Rollback"] } },
        { "id": "release-branch",            "type": "bitbucket-release-branch-exists", "enabled": true, "severity": "high" },
        { "id": "bitbucket-open-pr-threshold", "type": "bitbucket-pr-checks",          "enabled": true, "severity": "medium", "params": { "maxOpenToRelease": 0 } },
        { "id": "bamboo-plan",               "type": "bamboo-plan-active",              "enabled": true, "severity": "high" },
        { "id": "bamboo-latest-build",       "type": "bamboo-latest-build-success",     "enabled": true, "severity": "high" }
      ]
    }
  }
}
Replace the placeholder project keys, repo slugs, plan keys, page titles, and fixVersion values with real ones before running release gates.
Validate your edited config before running checks:
cops release policy validate --project backend-service

Configuration

Full project config schema, gate fields, and precedence rules.

Release check

Run the gates defined in cops.project.json.

Build docs developers (and LLMs) love