forge-sim
A local, simulated runtime for Forge, Atlassian's platform for building apps that run inside their cloud products, three ways to drive it:
-
Automated testing — End to end testing api. Out of the box, your options are mocking @forge/* import by hand, or isolating parts of functionality completely from forge apis to make it testable. With forge-sim, you can invoke resolvers, fire product events, assert on KVS/SQL state and rendered UIKit output. No network or credentials required, runs in CI.
-
AI-assisted development (MCP) — let an agent deploy, invoke, render, and inspect your app in a simulated Forge environment via MCP tools instead of handing it your cloud credentials or a browser pointed at your dev site. Faster feedback and you control the blast radius: fully sandboxed until you connect a real account.
-
Local development — think LocalStack for Forge. It collapses the deploy-wait-debug iteration loop by giving you an instantaneous deploy to a local runtime. Run your app against simulated storage, product APIs, and triggers, with dev tools for inspecting Forge state as you go. Orders of magnitude faster than iterating via forge tunnel
This project is not endorsed by or affiliated with Atlassian
Scope
forge-sim is a mostly truthful forge implementation. There is a lot of real estate to cover though. The implementation matrix shows exactly what's implemented and how faithfully.
If something you rely on is missing or behaves differently, please open an issue.
Keep in mind, This is a development tool. Iterate here, then a full deploy to the Atlassian products for final testing.
Installation
Requires Node.js 22.18+ (uses native TypeScript type stripping for .ts loader hooks, unflagged since 22.18). The package is ESM-only: require('forge-sim') throws ERR_PACKAGE_PATH_NOT_EXPORTED; use import (or dynamic import() from CommonJS).
# Global install (CLI: dev server, agent commands, MCP)
npm install -g forge-sim
# And/or as a dev dependency (CI/CD testing with the programmatic API)
npm install --save-dev forge-sim
The docs assume the global install. Prefer not to install globally? Substitute npx forge-sim anywhere you see forge-sim.
Install warnings are safe to ignore. npm prints Atlaskit peer-dependency conflicts (@atlaskit/analytics-next-stable-react-context and react-scrolllock still declare React 16) and, on npm 11.6+, skips two postinstall scripts. Neither script needs to run: esbuild ships its native binary as an optional dependency resolved at runtime, and iframe-resizer's script is only a funding notice.
Automated testing
Test your app against a headless local runtime. The test API creates a simulated deployment of your unmodified app and exposes its storage, queues, triggers, and a rendered UIKit2 tree for assertions.
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
import { createSimulator, type ForgeSimulator } from 'forge-sim';
describe('my forge app', () => {
let sim: ForgeSimulator;
beforeAll(async () => {
sim = createSimulator();
await sim.sql.start(); // embedded MySQL, only if the app uses @forge/sql
await sim.deploy('./my-forge-app'); // manifest.yml drives everything
});
afterAll(async () => {
await sim.stop();
});
it('reads an issue and records a view', async () => {
sim.mockProductRoutes('jira', {
'/rest/api/3/issue/PROJ-1': { key: 'PROJ-1', summary: 'Fix the thing' },
});
// The resolver runs your real handler, which writes to KVS
const data = await sim.invoke('getIssue', { issueKey: 'PROJ-1' });
expect(data.summary).toBe('Fix the thing');
expect(await sim.kvs.get('views:PROJ-1')).toBe(1);
});
it('handles an issue-created trigger', async () => {
await sim.fireTrigger('avi:jira:created:issue', { issue: { key: 'PROJ-2' } });
const rows = await sim.sql.query(
'SELECT * FROM objectives WHERE status = ?',
['active'],
);
expect(rows).toHaveLength(3);
});
it('renders the issue panel', async () => {
// Headless UIKit 2: your JSX runs through the real @forge/react reconciler
await sim.ui.render('issue-panel', { issueKey: 'PROJ-1' });
// Wait for useEffect → invoke → re-render to settle, then assert on the tree
const doc = await sim.ui.waitForContent('issue-panel', 'Fix the thing');
const badge = sim.ui.findByTypeAndText(doc, 'Badge', '1 view');
expect(badge.props.appearance).toBe('primary');
});
});
Features: