feat: Add support for sandbox edit command (#385)

* feat: Add support for sandbox edit command

* docs: Update sandbox docs

* fix(editor): address review — neutral failure wording, skip sh-script tests on Windows

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(test): avoid pnpm init in pm-e2e — devEngines.packageManager crashes subsequent pnpm add

Same workaround and rationale as the PNPM job in pmg-e2e.yml. Latest pnpm
(unpinned pnpm/action-setup) writes devEngines.packageManager with
onFail:download on init, and the next add fails with "Cannot use 'in'
operator to search for 'integrity' in undefined".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Abhisek Datta
2026-07-18 22:53:39 +05:30
committed by GitHub
co-authored by Claude Fable 5
parent bafd3c0654
commit 695a1d739d
8 changed files with 478 additions and 47 deletions
+21
View File
@@ -158,6 +158,9 @@ pmg sandbox profile list
# Scaffold a user profile that inherits from a built-in
pmg sandbox profile init my-npm --from npm-restrictive
# Open a user profile in $VISUAL / $EDITOR, then validate and lint it
pmg sandbox profile edit my-npm
# Show a profile, or its fully resolved policy
pmg sandbox profile show npm-restrictive
pmg sandbox profile show npm-restrictive --resolved
@@ -170,6 +173,24 @@ pmg sandbox profile lint ./my-profile.yml --strict
pmg sandbox profile diff npm-restrictive pypi-restrictive
```
`pmg sandbox profile edit` resolves the profile name to its file under the user profile
directory, opens it in your editor, and re-validates and lints the result when the editor
exits. Built-in profiles are embedded in the binary and cannot be edited; create an editable
copy with `pmg sandbox profile init <new-name> --from <builtin>`.
To activate a user profile for a package manager, reference it by name in `config.yml` — no
policy template is needed for profiles in the user profile directory:
```yaml
policies:
pnpm:
enabled: true
profile: my-pnpm
```
Policy templates (see below) are only needed to override a built-in profile name or to load a
policy file from outside the user profile directory.
### Sandbox Debug Commands
Use these commands when a sandboxed package manager command fails and you need to inspect why.