# install_package_command

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/update_check/install_package_command)

Return the shell command that adds a package to the dcode tool env.

The result is built for *execution* (via `perform_install_package`), not for
display — surfacing raw `uv tool` invocations to the user is intentionally
avoided. `package` is validated and then `shlex.quote`-d: the validation
already blocks shell metacharacters, so the quoting is defense in depth that
keeps the command safe even if the pattern is later loosened.

Already-installed extras are folded into the `deepagents-code[...]`
requirement via the shared `_dcode_extras_requirement` helper, the same way
`install_extras_command` builds its requirement. Without this the reinstall
would replace the tool with a plain `deepagents-code`, silently dropping any
extras the user added through `/install <extra>`.

## Signature

```python
install_package_command(
    package: str,
    *,
    distribution_name: str = 'deepagents-code',
) -> str
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `package` | `str` | Yes | Package name to install into the existing tool environment. |
| `distribution_name` | `str` | No | Name of the installed distribution to inspect for already-installed extras. (default: `'deepagents-code'`) |

## Returns

`str`

Shell command string suitable for execution via the shell.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/d1c6946218b4f0f86ab7b02b6bb6af1e4b75cede/libs/code/deepagents_code/update_check.py#L1028)