Przeglądaj źródła

docs(permissions): add wildcard example (#1494)

Timo Clasen 6 miesięcy temu
rodzic
commit
52f9b37576
1 zmienionych plików z 16 dodań i 0 usunięć
  1. 16 0
      packages/web/src/content/docs/docs/permissions.mdx

+ 16 - 0
packages/web/src/content/docs/docs/permissions.mdx

@@ -72,3 +72,19 @@ For example.
     }
   }
   ```
+
+- **Use wildcard patterns to restrict specific commands**
+
+  ```json title="opencode.json"
+  {
+    "$schema": "https://opencode.ai/config.json",
+    "permission": {
+      "bash": {
+        "git push": "ask",
+        "*": "allow"
+      }
+    }
+  }
+  ```
+
+  This configuration allows all commands by default (`"*": "allow"`) but requires approval for `git push` commands.