fusion-roles-cli
Skill2 starsChanged 2 months agoMITView on GitHub
Deploy and manage Fusion Roles V2 configuration using the fusion-roles-cli (froles). USE FOR: deploy role config from a JSON file, create roles/bindings/assignments, export current role state, inspect role assignments. DO NOT USE FOR: database provisioning, application code changes, Azure AD group management outside role bindings, or Roles V1 management.
In this repository31 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- caveman-compressSkill
- fusion-core-servicesSkill
- fusion-dependency-reviewSkill
- fusion-designSkill
- fusion-framework-mockingSkill
- fusion-framework-testingSkill
- fusion-github-review-resolutionSkill
- fusion-issue-solvingSkill
- fusion-issue-task-planningSkill
- fusion-mcpSkill
- fusion-package-scribeSkill
- fusion-pm-mcpSkill
- fusion-backend-devSkill
- fusion-developer-appSkill
- fusion-developer-portalSkill
- fusion-devtoolsSkill
- fusion-help-apiSkill
- fusion-help-docsSkill
- fusion-help-integrationSkill
- fusion-infra-cliSkill
- fusion-issue-authoringSkill
- fusion-rulesSkill
- fusion-skill-authoringSkill
- fusionSkill
- fusion-skillsSkill
- equinor-design-systemSkill
- fusion-code-conventionsSkill
- fusion-researchSkill
- fusion-rule-authorSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
Use when Fusion Roles V2 resources (roles, bindings, assignments, scope types) need to be created or updated from a config file, or when …
- Distinctive: line 95
Always dry-run before deploying to catch unexpected changes:
- Distinctive: line 166
Always dry-run before deploying to production
- Very specific: line 168
Never store tokens in config files.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Fusion Roles CLI
When to use
Use when Fusion Roles V2 resources (roles, bindings, assignments, scope types) need to be created or updated from a config file, or when existing role state needs to be inspected or exported.
Typical triggers:
- "Deploy the roles config for my service"
- "Create roles from this JSON file"
- "Export the current role config for fusion-myservice"
- "What does a roles config file look like?"
- "Add a binding for this Entra group"
- "Check what roles are assigned to this account"
- "Dry-run the role deployment"
When not to use
- Database provisioning — use
fusion-infra-cli - Managing Azure AD groups themselves — use the Azure portal or Graph API
- Roles V1 (legacy system) — this tool targets Roles V2 only
- Application code changes
Prerequisites
Install froles as a .NET global tool:
dotnet tool install --global \
--add-source "https://statoil-proview.pkgs.visualstudio.com/Fusion%20-%20Packages/_packaging/Fusion-Public/nuget/v3/index.json" \
Fusion.Roles.CliUpdate to latest:
froles --updateAuth uses DefaultAzureCredential automatically (picks up az login session). Pass -t <token> to override.
Core workflow — deploy a role config
1. Create the config file
The config file is a JSON file declaring all role resources for your system. Always include the $schema reference — it enables editor validation and autocompletion.
Minimal example (roles-config.json):
{
"$schema": "https://rolesv2.api.fusion.equinor.com/public/schemas/role-config.schema.json",
"accessRoles": [
{
"systemIdentifier": "my-service",
"name": "MyService.Project.Read",
"description": "Read access to project resources"
}
],
"roles": [
{
"name": "project-viewer",
"displayName": "Project Viewer",
"accessRoleMappings": [
{ "accessRoleIdentifier": "MyService.Project.Read" }
]
}
]
}See references/role-config-schema.md for the full schema with all resource types and field definitions.
2. Dry-run to verify changes
Always dry-run before deploying to catch unexpected changes:
froles create -e ci --file roles-config.json --dry-runThe dry-run shows exactly what will be created, patched, or left unchanged — including binding diffs showing added/removed roles.
3. Deploy
# CI
froles create -e ci --file roles-config.json
# QA
froles create -e fqa --file roles-config.json
# Production
froles create -e fprd --file roles-config.jsoncreate is idempotent — safe to run repeatedly. Resources are matched on natural keys; only changed fields are patched.
4. Export current state (optional)
To export the current configuration for a system (useful for initial onboarding or auditing):
froles export my-service -e ci -o current-state.jsonThe export file can be modified and fed back into create.
Reconciliation behaviour
The create command reconciles each resource type against its natural key:
| Resource | Natural key | Behaviour |
| Scope types | name | Create if missing; patch description if changed |
| Access roles | systemIdentifier + name | Create if missing; patch if changed |
| Roles / claimable roles | name | Create if missing; patch if changed; access role mappings fully reconciled |
| Bindings | identifier | Patch all fields; diff shows role/group additions and removals |
| Role assignments | roleIdentifier + source + externalIdentifier | Create if missing; skip if exists |
Important: Access role mappings on roles/claimable roles are fully reconciled — mappings absent from the config are removed. Only access roles belonging to systems declared in the config file are managed.
Environments
| Key | Purpose |
ci | Continuous integration |
fqa | QA / pre-production |
fprd | Production |
tr | Training environment |
Full reference
For complete command and flag reference, run:
froles --help
froles create --helpOr see the source documentation:
Safety
- Always dry-run before deploying to production
- Access role mapping reconciliation removes unmapped roles — review the dry-run output carefully
- Never store tokens in config files; always use
-t <token>from a secret variable in pipelines delete role-assignmentsis destructive — confirm with user and dry-run first
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

