Command line
How to use Publishly from the command line and CI
The command line runs the same engine as the website — in your terminal, a CI job, or an AI agent through the Model Context Protocol: Play checks on a build, every store image from a design file with fresh screenshots swapped in, and promo videos. It needs Node.js 20 or newer.
Step by step
Run it
npx @publishly/cli --helplists every command. Install it once withnpm i -g @publishly/cliand the command is simplypublishly. It exits 0 when all is well, 1 on an error or a blocker, 2 on a bad command.Check a build
npx @publishly/cli check app-release.aabruns the Play checks.--out check.mdwrites Markdown,--sarif check.sarifwrites SARIF for findings on pull requests,--fail-on blocker|warning|nonesets what fails the job, and--versionslooks library versions up on Google's Maven.Render the store images
In the editor, File → Download project file saves the design as one
.publishlyfile.npx @publishly/cli render MyApp.publishly --layout fastlane --screens app/build/outputs/roborazzithen draws every store image, with your screenshot tests' fresh screens swapped in.Make a video
npx @publishly/cli video ./screenshots --template marqueemakes a promo video from a folder of screenshots;--listshows the templates and--plan plan.jsonbuilds a video of several shots.Use it from an AI agent
npx @publishly/cli mcpserves the tools over the Model Context Protocol —check_app,render_project,render_videoand more.claude mcp add publishly -- npx @publishly/cli mcpadds it to Claude Code.Use it in Android Studio
Gemini in Android Studio's agent mode only connects to MCP servers at a URL, so run
npx @publishly/cli mcp --http. It prints a block to paste into Settings → Tools → AI → MCP Servers (turn on Enable MCP Servers) and keeps running; type/mcpin the Gemini chat to see the tools, then ask it to check your bundle or render your design. Android Studio connects only when it starts, so rather than keep a terminal open, runnpx @publishly/cli mcp --installonce in your project's folder: the server then starts at login and keeps running (macOS and Linux).
In GitHub Actions
One step: uses: Trilokia/publishly@v1, with file: set to your build and upload-sarif: true, puts the report in the job summary and the findings on the pull request.
Your emulators from the website
npx @publishly/cli connect lets the hosted website use this computer's emulators and phones for recording and the design review.
Questions
Is it the same as the website?
Yes: the same checks and the same renderer. render and video open the site's renderer in Chrome on your computer, so the images match the editor's.
Does it upload my build?
No. check reads the build on your machine; only --versions looks library names up on Google's Maven.
What do I need installed?
Node.js 20 or newer; render and video also need Chrome or Chromium (or --browser with its path).
Android Studio says “Connection refused”
The server wasn't running when Android Studio started, and Studio doesn't try again. Start it with npx @publishly/cli mcp --http, or npx @publishly/cli mcp --install to have it start at login from now on, then untick and tick Enable MCP Servers in Settings → Tools → AI → MCP Servers once.
Can anything else reach the Android Studio server?
It listens on 127.0.0.1 only and refuses requests from other websites' pages. --token s3cret makes every request carry a secret too; the printed block includes it.
Other guides
Last checked against the app on 2026-10-20.