Build / commandline tools?

Greetings all,

I’m just getting into Axure, and so far it’s ability to output really usable HTML code is what’s got me pushing my company to adopt.

I’m wondering if anyone knows of any methods to interact with .rp files programatically. Ideally, I’d love a command-line tool that lets me export html prototypes, so I can create a prototype automated build pipeline. For example, a designer checks out a repo, works on an RP file, saves and runs a build command that adds our logging scripts to the top, and publishes to our static hosting folders. I’ve not looked at the structure of the rp file, but I wanted to get any relevant knowledge before looking into this further.

Thanks in advance

Richie

1 Like

I don’t know about existing command line tools but I’ve done a bit of research into options for integrating Axure with external tools. I last looked into a bit about 3 weeks ago (March 2024 for anyone looking at this in the future) so my information is fairly current, I plan to write a blog post some time soon summarizing my findings. Most of what I found out there is about making Axure prototypes and Javascript communicate back and forth. Very little about dealing with your own prototypes outside of the prototype player.

There is the pseudo-official option in the Technical Preview of an Axure RP9 API, I have not attempted to use it with RP10 - no idea if it even works. I did build a tool a year or so ago for a 24hr hackathon that took an rp file, turned it into xml, then created a react app that sort of documented the contents of the xml. Listing out pages, redrawing shapes and showing notes. There’s apparently an RP10 version coming “early 2024” last I heard, so that might prove useful.

The one thing third-party thing I did find that might be useful to you is winjeg/hamster, it’s an Axure Share server written in Go.

Now onto your question, I think if you were using the “Generate HTML Files…” in the Publish menu you could output a prototype to a folder and then have some app monitoring the folder to upload it, check it to a repo (not Axure Cloud) or whatever. Presumably, this app could also inject your logging scripts into the top and publish the static prototype files to your host. I don’t know Go, but perhaps hamster could be modified to do this part.

I imagine you can make everything after generating the prototype an automated process, but I can’t think of a way inside Axure to automate generating a prototype short of a tool that moves and clicks your mouse for you.

Your idea (and hamster) does sound somewhat related to one of my own ideas, which is a local private version of AxShare with better searching, automated screenshots and some other weird ideas. I think a major part of that system is something that monitors a folder for new prototype folders to add to the collection so I’ll be picking apart hamster myself so I’d be very interested in your progress with your own idea.

Thank you for your reply Brent! I’m very curious about that feature coming out “early 2024.” Is there a roadmap page somewhere you are seeing them talk about that??

I think my idea solution would either be an API call that can download a zip file of HTML documents of an exported prototype from Axure Cloud, or a commandline utility that lets me do something like axure --export-prototype MyProject.rp which produces that folder w/o opening axure :-. Then I could store all my stuff in github repos and automate a bit more.

LMAO I’m dumb. I made a mistake reading a date in my email, “early 2024” is completely made up on my part.

I had an short back-and-forth with Axure Support when I told them about the app I made and had some ideas, questions for future versions. They wrote back to me and said they were hoping to have it out by end of year or possibly early next year, it’s May so I figured “oh then it’s soon, ‘early next year’!”. Except that email is from 2021-11-23 and my brain misfired and read that as November 2023. The RP10 API is now several years late.

Sorry to get your hopes up. I too would love a CLI app that did exactly that, I don’t think the RP10 API would have helped with your concept even if it was released. IIRC, the RP9 API was for .NET and read only. You could point it at an rp file (though not a rpteam file) and query its structure.

I’ve since moved on from thinking about using the API to looking more at the data within the $axure object in the prototype player and the structure of the pages as expressed in the HTML output. Extracting interaction information from the js, is one thing I haven’t figured out yet but I believe it’s doable.

I think perhaps, your idea of an API call (or I’m thinking, maybe a headless browser instance that logs into Axure Cloud and “clicks” Download for you) is a possible avenue for making your cli app idea work. I’d love to see it if you put something together, that’s one of those things I’d love to try myself but I don’t have the skills quite yet.