liveBook · Manning

Add command

As explained in Julia as a Second Language

The add command is a Julia package-manager command that adds a package to an environment and records a package version.

The add command adds packages to the active Julia environment, resolves their versions, and records them so the environment does not unexpectedly change when third-party packages evolve. section 16.3

Adding environment dependencies

In the hobby environment, `pkg> add OhMyREPL Revise` resolves package versions and updates both `Project.toml` and `Manifest.toml`. The environment can then load these packages from the Julia REPL.

Choose the command according to whether the package is used or actively developed:

  • Use `add` for ordinary third-party dependencies whose resolved versions should remain stable. section 16.3
  • Use `dev ./ToyGeometry` for a package under active development, so local code changes are available without explicit updates. section 16.3

How Julia as a Second Language covers it

How deep it goes
Shows package resolution and recorded versions, but defers detailed dependency-management internals.
Examples
Uses `add OhMyREPL Revise` to demonstrate dependency resolution and environment-file updates.
What it assumes
Assumes a Julia package-manager environment is active and distinguishes package use from active package development.
What you can do after
Operate/configure a Julia environment by adding dependencies with resolved, recorded package versions.
How it connects
Connects package environments with dependencies, package versions, and the dev command.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Julia as a Second Language. The section links point to the parts of the book it draws on.