JSPM

@gandalfix/opencode-permission-export

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q83144F
  • License MIT

OpenCode plugin to export granted permissions as config snippet

Package Exports

  • @gandalfix/opencode-permission-export

Readme

opencode-permission-export

OpenCode plugin that exports granted permissions as a config snippet.

Installation

npm install @gandalfix/opencode-permission-export

Add to your opencode.json:

{
  "plugin": ["@gandalfix/opencode-permission-export"]
}

Usage

During an OpenCode session, the plugin tracks all permission requests. When you want to export the granted permissions:

export my permissions

or

run export-permissions

The tool outputs a JSON snippet you can copy into your opencode.json:

{
  "permission": {
    "bash": {
      "git status": "allow",
      "npm run *": "allow"
    },
    "edit": {
      "src/*.ts": "allow"
    }
  }
}

How It Works

  1. Hooks into permission.ask and permission.replied events
  2. Tracks which permissions were granted vs denied
  3. Generates valid OpenCode permission config syntax
  4. Only exports granted permissions (denied are noted but not included)

License

MIT