The CLI
phantom-plugin comes from @phantomclient/plugin-cli. New plugins already depend on it.
Shell
phantom-plugin <command> [options]Commands
| Command | What it does |
|---|---|
dev | Serves the plugin for Phantom's Developer mode until you stop it, with hot reload and logs in the terminal. See The dev loop. |
build | Checks the manifest, then bundles dist/plugin.js and dist/plugin.css. |
validate | Checks the manifest against src/index.ts, lists the permissions the plugin asks for as the player will see them, and says whether a person will review it. |
pack | Builds, then writes <name>-<version>.tgz with only the files the plugin ships. |
publish | Builds, packs and sends the plugin to the store. See Publishing. |
status | Shows where each version you've sent to the store is up to, with any note from Phantom. Uses the plugin in this folder, or pass an id: phantom-plugin status <id>. |
login | Saves a publishing token for publish. You make the token in Phantom under Plugins → Developer. |
logout | Forgets the saved token. The token keeps working until you revoke it in Phantom. |
whoami | Shows the username of the Phantom account you're publishing as. |
build, pack and publish stop if the manifest doesn't pass.
Options
| Option | What it is |
|---|---|
--dir <path> | The plugin's folder. Defaults to the current folder. |
--port <port> | For dev, the port to serve on. Defaults to 5299. Phantom looks on 5299 to 5309. |
--host <host> | For dev, the address to listen on. Defaults to localhost. |
--token <token> | For login, the publishing token, so you aren't prompted for it. |
--json | For status, prints JSON for scripts. |
--help | Shows the commands and options. |
Environment
| Variable | What it is |
|---|---|
PHANTOM_TOKEN | A publishing token. Takes priority over the saved one. Use it on a build machine that shouldn't keep a file. |
PHANTOM_API_URL | The store's API. Defaults to https://api.phantm.site. |
login saves the token in your user config folder (~/.config/phantom/credentials.json), readable only by you, never in the plugin's folder where it could be committed.