# pkg/install
Install a package by `owner/name` id. Fetches synchronously from the registry and installs into the user-level packages root — `<home>/packages` (`~/.deft/packages`, or `$DEFT_HOME/packages`) — by default, so every project sees it.
## Syntax
[pkg/install $id ?$version ?$opts]
## Parameters
- `$id` — `"owner/name"` package id (e.g. `"deft/editor"`)
- `$version` — optional version string (defaults to `"latest"`)
- `$opts` — optional map:
- `%{ :local true }` — install into the project's install root (`.deft/packages`) instead. A local install is an override: it shadows a same-named global copy for this project.
- `%{ :global true }` — accepted for compatibility (global is the default).
## Examples
[pkg/install "deft/editor"] # global (~/.deft/packages) [pkg/install "deft/editor" "1.2.0"] # global, pinned [pkg/install "deft/editor" %{ :local true }] # project override
CLI equivalents:
```sh
deft pkg install deft/editor # global
deft pkg install deft/editor --local # project override
````
## Returns
`%{ :owner :name :version :path }` summary map, or `%Err{}`.
## See Also
`pkg/install-bytes`, `pkg/uninstall`, `pkg/info`, `pkg/fetch`