Topic: a rails app with a command line interface

Hello everyone.  I would like to write a rails app in which the user interface is not a website but just a terminal.  I'm envisioning the user interacting with my app the way a developer interacts with heroku -- by typing commands at the terminal and getting text responses from the server.  I.e., an app that would have worked in the early 1990s.

Basically, I want to get the backend stuff working land tested ike a well-oiled machine and then only worry about the HTML and CSS and JQuery front end stuff at the very end.  And I would like to have the terminal command line access to my app available at all times for power users.  Is this a feasible idea?  Has anyone ever tried this, or do you know of an example?

Thanks for your feedback.


P.S. I'm a relative newbie at ruby and rails, but have about 7 years of java experience.  So I have a lot to learn.

Re: a rails app with a command line interface

I think you can do that without much problem.  What I'd do though is actually start with a skeletal rails app just to see the basic framework you'd have to deal with,  then I'd code a simple command line program in ruby that does one small piece of what you are planning,  then figure out the mechanics of wrapping some actual rails application around the command line interface.

Once the simple mechanics are figured out,  then go ahead and develop the command line program,  knowing you won't have to go back and change it much once you start wrapping a web app around it.

I think a good place to start looking for ideas is maybe something like MySQL workbench,  or maybe even poke around in the Rails source and see how they've implement the rails console,  which is a command line interface to a Rails application used for testing and debugging.

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: a rails app with a command line interface

Hi.  Thanks for your reply.  I think you're right that starting with the skeletal rails app is the way to go.  Also, for those who are interested, I found this example of a console app that uses ActiveRecord: … ecord.html