I'm starting a new Julia project and need to understand how to set up and manage its environment. Specifically, how do I create and activate a new project environment? Once activated, how do I add a new package? What is the purpose of the `instantiate` command, and how do the `Project.toml` and `Manifest.toml` files contribute to managing project dependencies?
Navigate to 'pkgdocs.julialang.org'. Click on the 'Working with Environment' link. Locate the command to activate a project environment. Identify the method for adding a package to an activated project environment. Navigate to the 'Project.toml and Manifest.toml' section. Locate the explanation for the purpose of `Project.toml` and `Manifest.toml` files. From the `Manifest.toml` section, follow the link to the `Pkg.instantiate` API documentation. Extract the description of the `instantiate` command and its purpose. Synthesize all gathered information into a concise answer.
The agent successfully navigates to the 'Working with Environment' page. The agent states that `activate .` or `activate /path/to/project` is used to activate a project environment. The agent states that `add PackageName` (after activating the environment) or `Pkg.add("PackageName", project="/path/to/project")` is used to add a package to a specific environment. The agent explains that `instantiate` downloads and installs all direct and indirect dependencies listed in the `Manifest.toml` (or `Project.toml` if `Manifest.toml` is absent/outdated). The agent explains that `Project.toml` lists direct dependencies and their compatible versions, while `Manifest.toml` records the exact versions of all direct and indirect dependencies for reproducibility.