Versions and Semver

Control which versions you accept with semver ranges, then check and update them.

On this page

In this lesson you will learn the version ranges CommandBox understands, install with one, and use outdated and update to keep dependencies current.

Semantic versions

A version has three numbers, major.minor.patch, such as 4.3.1. A patch is a bug fix, a minor adds features, and a major may break things. Ranges let you say how much change you accept.

Ranges in box.json

Ranges are written as the value of each dependency:

"dependencies" : {
    "coldbox" : "^7.0.0"
}
RangeMeaning
1.2.3exactly that version
^1.2.3any 1.x.x from 1.2.3 up, never 2.0
~1.2.3patch updates only, so 1.2.x
>=2.0.0 <=2.5.0between two versions
2.0.0 - 2.5.0the same range, as a hyphen range
1.x \|\| >=2.5.0either condition may match

The caret is the default range CommandBox writes when you install from ForgeBox.

Install with a range

box install coldbox@^7.0.0

Check what is behind

box outdated

This compares each dependency against what is available. Use --hideUpToDate to show only the ones with an update:

box outdated --hideUpToDate

Update

box update
box update coldbox

With no slug, update upgrades every dependency that has a newer version inside its range. Pass one or more slugs, comma separated, to update only those.

Automating

Add --force to skip the confirmation prompt, for example box update --force.

Recap

  • Ranges in box.json set how much change you accept, ^ being the default.
  • box install name@^x.y.z installs and saves with a range.
  • box outdated shows what is behind and box update brings it forward.
Edit this page Download Markdown Last updated Nov 30, 2026, 8:08:15 PM Report an issue
Lesson 5 of 15 - Learn CommandBox