scmJS docs

In the source

For developers. The command is built from the editor's own code into a single file. Run it from a clone with npm run cli -- <command>, or build it with npm run build:cli.

File Does
cli/src/main.ts The commands, their help and options, and running a command over several files
cli/src/map.ts, cli/src/replay.ts The map and replay reports, and how they are printed
cli/src/exchange.ts Triggers and strings out as files and back in, and writing a map back as it was opened
cli/src/files.ts What kind of file was named, a map or replay read out of it, and - as standard input and output
cli/src/diff.ts What changed between two maps, by group, and the section comparison underneath; a map read from a git revision
cli/src/diffpicture.ts map diff --picture: the second map drawn with the changes marked, side by side, in the terminal or as a PNG
cli/src/history.ts A map's versions in git: the commits that changed the file, the blob ids of all of them in one call, the blobs read in batches and each parsed once
cli/src/maplog.ts map log: each commit compared with its parent's version, the comparison put in a few words
cli/src/blame.ts map blame: the items of each kind, matched between versions as map diff matches them, and git blame's walk from the newest version back
cli/src/merge.ts The three-way merge: each part's rule, the ordered list merge for triggers, units matched without ids, the string table numbered again; git's three versions of a stopped file
cli/src/edit.ts The header set, the map resized and the unused strings dropped, over the open document
cli/src/optimize.ts, cli/src/relocate.ts map optimize: what refers to each member, the steps each measured as the file it leaves, the compression chosen; a member kept as stored moved to the archive's start, its key changed with its place
cli/src/report.ts Check Map's findings, a map test's failures and the triggers map coverage never saw fire, as GitHub annotations, JUnit XML and SARIF
cli/src/baseline.ts map check --baseline: a finding's identity (a trigger by its text, counts left out), the known findings matched one for one, the file read and written
cli/src/dump.ts The map as text: every part in file order, the triggers and strings in their text forms, members hashed, sections as they would be written
cli/src/find.ts Edit ▸ Find over a map from the terminal: the kinds, the hits and their lines
cli/src/create.ts A new map as File ▸ New makes it: the flat fill with a seeded variation, the start locations, the slots closed, the file written as a new map is saved
cli/src/generate.ts A map from a seed: the plan on the isometric lattice, the base complex and its copies, the ground painted a terrain at a time, the ramps tried until one walks, the walks and checks
cli/src/generatecmd.ts map generate's options, the tileset read from your copy of the game, the summary and its JSON
cli/src/bases.ts Where a base's resources go: the Melee Wizard plugin's layout
src/editor/isom.ts The isometric brush, which map generate paints with
cli/src/init.ts A folder of maps set up for git and GitHub: the lines and files it lacks, the workflow and README made from the maps, the git settings
cli/src/doctor.ts The checks: Node, npm's newest, TypeScript, Docker, a browser, ffmpeg, StarCraft, the engine cache, the desktop app, and what each one is for
cli/src/archive.ts The archive as a folder and back: member names as file names, the manifest, the members without a name
cli/src/source.ts The scenario as a folder of text and back: each section's text form, the check that the folder packs back into the same scenario, the bytes kept beside
cli/src/texteditor.ts triggers edit and strings edit: the editor chosen and started, the file kept when the text does not read
cli/src/sounds.ts The map's sounds: the WAV table joined with the archive's members, their lengths, the files written
cli/src/qr.ts The QR encoder for --qr and its drawing in the terminal
cli/src/run.ts, src/plugins/headless.ts A plugin run over a map: the editor's plugin host with a store, a document and no page, its status, toasts and log reported instead of shown
cli/src/build.ts The TrigScript build: finding TypeScript, compiling against the map's names, applying the block, laying the programs in and packing the file
cli/src/completion.ts The bash, zsh and fish scripts, generated from the command tree
cli/src/mcp.ts The MCP server: each tool a command's functions, its text and JSON as the result
cli/src/lsp.ts The language server: which files are a script and which map names them, the protocol round TrigScript's language service (plugins/trigscript/language.ts)
cli/src/replaymap.ts The replay's scenario written out as a map file
cli/src/scmscx.ts, cli/src/fetch.ts scmscx.com's routes in one place, with the timeout and the errors; the search table, the file name made safe, the download opened before it is written
cli/src/open.ts Finding the desktop app, handing a file to the editor in a browser, and a lobby asked of the play page the same way
cli/src/account.ts The scmjs.dev sign-in through a page on the loopback address, the session file, and the account
cli/src/share.ts A map saved to the account and linked, or opened for editing together, with its facts and picture
cli/src/replayshare.ts A replay stored on the account and linked, with the map's picture for the card
cli/src/bot.ts Running the bot toolchain's image in the bot's folder
cli/src/engine.ts The game engine the playing commands share: the play page's current build fetched into the cache with its runners, the copy of the game found, a runner started
cli/src/botrun.ts A bot's game with no page: scm-sim's bot runner run and its lines worded
cli/src/ladder.ts The ladder: the sides read off the command line, the schedule and the replays' names, scm-sim's match runner run for each game, Elo, the standing and the head-to-head
cli/src/watch.ts A replay in the terminal: the braille minimap, its colours and the lines around it, the replay's chat and APM, and the runner paced a picture at a time
cli/src/export.ts A replay's clip: the options settled, the play page and the game's files served on the loopback address, the page asked to record, the MP4 made with ffmpeg
cli/src/browser.ts Finding Chrome, Chromium or Edge, starting it without a window, and the DevTools protocol on its pipe
cli/src/camera.ts The camera that follows a player: aims from the game's units (the army, the biggest fight), or the player's clicks, made into a smoothed track
cli/src/gif.ts The GIF writer: a palette a picture by median cut, unchanged pixels left transparent, LZW
cli/src/trace.ts A map's triggers run in the game: scm-sim's map runner run, its trace and cost worded against the map's own triggers; a replay's game, the map given compared with the replay's, the firings in order
cli/src/maptest.ts A map's tests: the tests file read and resolved against the map's names, the setup and timed steps made triggers of a copy, the map runner run in its test mode for each scenario, the end judged and the failed scenarios' replays kept; scenarios that play a replay, recorded from one and rewritten with -u
cli/src/coverage.ts map coverage: the replays matched to the map, played a few at once by the map runner's replay mode, each game's trace folded per trigger (to the parting, from the firings in order), the tests' scenarios as games, the totals and the report
cli/src/heatmap.ts, cli/src/heat.ts A heatmap from replays: the replays matched to the map, played a few at once by the replay runner's event mode and kept in the cache, the events chosen, counted per tile, spread and drawn as a heat ramp
cli/src/balance.ts map balance: the games played on the match runner, each replay's events read for the starts dealt and the first contact, the main's resources, the rows and the verdict
cli/src/rush.ts The walks between the start locations: the unit found by name, the map runner run in its rush mode, the table of the starts
cli/src/preview.ts, cli/src/png.ts A map's picture: the terrain from the tileset, reduced to the scale asked, the units, resources and start locations over it, and the PNG written by hand
cli/src/paint.ts The picture in a terminal: colour half blocks, the 256-colour fallback, ASCII shades, kitty's and iTerm2's picture protocols
cli/src/gamefiles.ts Files out of your copy of the game: a Remastered installation's storage, a 1.16.1 copy's archives in the game's order
cli/src/weigh.ts The weigher map cost hands the game: TrigScript's model of what Remastered charges, built beside the command
cli/src/runtime.ts, cli/src/sea.ts The npm package and the single program told apart: how each updates, the package manager read off the program's folder, a runner started by the program as Node would run it, the weigher written out of it
scripts/build-cli-binary.mjs, scripts/check-cli-binary.mjs The single programs: the bundle again as CommonJS, injected into Node's own executable for each system and packed for the release; the commands run against one with no Node on PATH
packaging/ The Scoop, winget and Homebrew recipes, filled for a release by scripts/release-recipes.mjs
cli/src/plugin.ts A new plugin's files, the plugin check, and the server plugin dev runs
src/plugins/devLink.ts The editor's half of plugin dev: only a plugin served on this computer is taken
cli/src/ui.ts Colour, marks, aligned rows, and StarCraft's text colours in a terminal
cli/src/banner.ts The globe and the command list that scmjs on its own prints
core/src/index.ts The library's surface; the command imports from the editor only what it exports (core.md)
src/hooks/ (the opener hand-over) The editor's half of the hand-over: only a page on the loopback address that opened it is listened to
@scm-js/replay The replay reader, shared with the replay viewer plugin
scripts/build-cli.mjs Builds cli/dist/scmjs.mjs
scripts/cli-screenshots.mjs This guide's pictures: the commands run on the test maps and on maps map generate makes, their output drawn as a terminal