Syntax Highlighting for OpenFGA files
Syntax highlighting for OpenFGA authorization model files
How to install
With Forge Super installed, the button above opens the app on this extension, where you press Install. Nothing is installed until you do.
You can also open the Extensions panel in the app and search for Syntax Highlighting for OpenFGA files. The extension's id is openfga.
Don't have Forge Super yet? Download it here.
README
From the extension's repository, written by its authors and not by Mentenaz. See the source.
FGA Syntax Highlighting Extension for Zed
A comprehensive syntax highlighting extension for OpenFGA authorization model files in the Zed editor. This extension uses the tree-sitter-fga grammar under the hood (thank you!).

Features
This extension provides syntax highlighting Open Fine-Grained Authorization (OpenFGA) model files.
- Keywords:
model,schema,type,relations,define,from,extend,module,condition - Operators: Logical (
and,or,but not), mathematical (+,-,*,/,%), comparison (==,!=,<,<=,>,>=), bitwise (<<,>>,&,^,|) - Types: Built-in types (
string,int,map,uint,list,timestamp,bool,duration,double,ipaddress) - Direct relationships:
[user],[admin, moderator] - Wildcard references:
[user:*] - Relation references:
[organization#member] - Indirect relations:
viewer from parent - Conditional access:
[user with security_clearance] - Complex expressions: Multiple operators with proper precedence
Installation
- Open Zed editor
- Open the command palette (
Cmd+Shift+Pon macOS,Ctrl+Shift+Pon Linux/Windows) - Type and select "zed: extensions"
- Search for "OpenFGA"
- You already know, don't you? ;)
Supported File Extensions
.fga- OpenFGA model files
Examples
Basic Authorization Model
model
schema 1.1
type user
type document
relations
define owner: [user]
define editor: [user] or owner
define viewer: [user] or editor
define can_read: viewer
define can_write: editor
define can_delete: owner
Advanced Model with Conditions
model
schema 1.1
type organization
relations
define admin: [user]
define member: [user, user:*] or admin
type document
relations
define owner: [user]
define editor: [user, organization#member]
define restricted_viewer: [user with security_clearance]
define can_read: owner or editor or restricted_viewer
define can_write: (owner or editor) but not restricted_viewer
condition security_clearance(user: user) {
user.clearance_level >= 3 && user.department == "security"
}
Module Structure
module user_management
type user
relations
define active: [user]
define can_login: active but not suspended
condition active_user(user: user) {
user.status == "active" && user.last_login > timestamp.now() - duration("30d")
}
Resources
- OpenFGA Documentation
- OpenFGA Configuration Language
- Tree-sitter FGA Grammar
- Zed Extension Documentation
License
This extension is released under the same license terms as the underlying tree-sitter-fga.