EPiServer’s Command Line Interface

By Deane Barker on August 8, 2009

A long time ago, I wrote a post about how the interface to your app should be removable – you should be able to lift it off, and have a competent enough API underneath to still work with the app.

eZ publish is very good at this.  All their PHP code will run from a command line.  Ektron, not so much – to my knowledge, Ektron’s API will only run in the context of the Web server.  And they’re not alone – I would say the majority of CMS are like this.

I’m probably nitpicking here, actually.  But the ability to run a program outside of the context of the Web server is usually a pretty good indication of the general strength of the API and how it’s been architected.

Like eZ publish, EPiServer has strict separation of their API and their interface, and here’s the ultimate manifestation of that: a command-line interface to an EPiServer CMS.

Written by Magnus Stråle, this allows you to browse an EPiServer content repository from the command line – you can “cd” through the tree, list “files” (really content objects), etc.  I played around with it last month at EPiServer’s new digs outside Chicago, and it’s kind of neat.

But…also kind of pointless.  I mean, there’s not much you can really do with it, and I’m sure Magnus knew this.  In truth, I suspect he wrote it as a semi-comedic exercise – a gee-whiz bit of functionality to show off at a conference.

But, it does demonstrate the point I made two years ago:

When building a new piece of software, you really need to completely divorce the interface from the API. You need to get in the mindset that your app is really just a data store and a set of logic modules that do something. That is your application.

At the same time, you can build an interface that lets a human interact with your application. This an obviously very important piece, so it should get at least as much attention as the application itself. But never forget that the interface is layered on top of the application. In a perfect world, it can be lifted off and thrown away, leaving a fully-functional API underneath.

In that sense, it’s awesome.

What This Links To


  1. I don’t think the concept is pointless. I’m probably just regurgitating some of your previous articles – but I think you will find that the concept is actually brilliant. I’ve been thinking about the concept of using the CMS to hold the user interface as just another form of content to manage. One of the disadvantages to this is when you break the user interface – suddenly you don’t have access to the functionality to correct it or back it out. A command line interface would give you a last line of defense. Oh, and scripting ability too.

Comments are closed. If you have something you really want to say, tweet @gadgetopia.