Repository navigation
API and Development
Roi Horowitz edited this page Aug 24, 2026
·
1 revision
Commanderer's public API is available after Foundry's ready hook:
const commander = game.actors.get("ACTOR_ID");
const api = game.modules.get("pf2e-commanderer").api;
api.open(commander);
api.execute(commander.items.get("TACTIC_ITEM_ID"), commander);Opens or focuses the Commander panel for the supplied actor. Caller should provide a PF2e Commander actor the current user may observe and control.
Starts the normal tactic-issuing workflow for an embedded tactic item. Normal ownership, preparation, frequency, banner, audience, and readiness checks still apply.
npm ciModule uses native JavaScript ES modules. Foundry loads scripts/main.js from module.json.
npm run check
npm run lint
npm testnpm run prepublishOnly runs syntax checks, full test suite, and ESLint together.
Husky hooks run:
- ESLint before commits;
- full test suite before pushes.
| Area | Responsibility |
|---|---|
scripts/domain |
Pure tactic, movement, readiness, banner-placement, and selection rules |
scripts/foundry |
PF2e documents, actions, effects, dialogs, sockets, banner state, and movement integration |
scripts/canvas |
Banner marker, burst, and movement guidance rendering |
scripts/ui |
Commander panel, Token HUD, tactic and invocation view models |
scripts/engine.js |
Tactic issue, chat order, response, and aftermath orchestration |
templates |
Foundry ApplicationV2 and chat-card markup |
styles |
Module panel, dialog, HUD, canvas, and chat presentation |
tests |
Node tests for domain behavior and Foundry integration contracts |
GitHub Actions runs on pushes, pull requests, and releases:
- install dependencies;
- validate manifest metadata;
- check JavaScript syntax;
- run ESLint;
- run tests;
- stamp release manifest URLs;
- build
module.zip; - attach
module.jsonandmodule.zipto the GitHub release; - publish stable versions to Foundry when
FVTT_API_TOKENis configured.
Release tag must exactly match module.json version.
Open a GitHub issue with:
- Foundry and PF2e versions;
- Commanderer version;
- tactic and banner state;
- which user owned each involved actor;
- console error and reproduction steps;
- screenshot when UI or canvas state matters.