sash - Sweet Ass Shell
This documentation refers to version 1.01
This tool is a shell to some common data sources. It was inspired by the many character based database tools so that I could work with the Salesforce.com API in the same manner. I simply wanted a CUI that worked on all of the different machines that I work on including my ssh sessions.
After building the tool to behave similarly to the mysql client I rewrote it so that it supported a Plugin API. Now in principle it can be used to communicate with any data source as long as a plugin has been written for it. See the "PLUGINS" section for a list of known plugins that you can download and start using. You can also search http://search.cpan.org/?query=sash&mode=all for plugins as well in case the documentation here isn't up to date.
In addition to installing plugins that can be used with sash, you can also easily develop them. The "DEVELOPMENT" section covers the steps necessary to develop your own plugin for sash so you that you can extend its functionality and give back to the community.
There are several built-in commands that you can type in from the command line in addition to the ones defined by the plugin you are using. The table below provides definitions of the commands. For commands with an alias defined you can type the alias instead of the full command name. It saves some keystrokes.
Clears and resets the editable command buffer.
Brings the current command buffer into your favorite editor as defined by your EDITOR environment variable.
Shows the current command history. Its a known bug of another module's Term::ShellUI that the command history appears to be doubled up. Its also a known bug that the bang syntax does NOT work to invoke a previous command.
List the current command buffer.
Disconnect from the datasource and exit your sash session.
Attempt to re-establish a connection to the data source. This is useful for API based plugins where server based valid sessions tend to expire quite rapidly.
The difference between operating as a client to a database and a client to an API is mostly the time lag between request and response. When using the mysql client to communicate with the database installed locally the response time is very fast. When waiting for the response from and API call you could wait a long time. Some operations using the Salesforce.com API to get 5000 records can take several minutes.
The last thing you want to discover after you finally get your large result set back is that you forgot to properly sort the records. You really don't want to reissue the command because again it could take several minutes.
Thankfully sash solves this problem for you by storing (caching) the result of any command that is issued to the data source. The tool allows you to then enter sub-commands based on the latest result so that you can quickly manipulate the data without having to re-issue a command to the server.
The result command has a number of sub-commands available that are listed below with their descriptions:
This displays all of the results that have been obtained and manipulated for the last executed command.
usage: limit [value]
This is the logical opposite of the undo sub-command. If you decide after an undo that you really did want the result the way it was you can issue a redo to get it back.
This undoes the series of sub-command operations that have been performed and returns the result back to the original value after the command was issued.
usage: search [-i] [string]
usage: sort [[attribute] [asc|desc], [attribute] [asc|desc], ...]
A typical sequence of "result" sub-commands is illustrated below:
sash> result sort LastName desc, FirstName asc ... sash> result limit 20
The above example would produce an ordered result with 20 records displayed. If the user were to then "undo" the previous "result" operation then the full set of ordered records would be displayed. This illustrates the concept that "result" operations are sequential and operate on the previous result with the first result being the output of the command issued to the server.
The "set" command allows on to manipulate basic sash properties. The following table describes the available sub-commands and their options:
usage: output [tabular|vertical|perlval]
Use this command to introspect a defined variable. This is similar to the x command in the perl debugger but it provides a different type of synopsis of the value as provided by "Data::Dumper".
This plugin is for use with the Salesforce.com API or Apex API as it is presently called. You must have a valid Salesforce.com account before you can use it. Writing SOQL queries and viewing their results served as the birthpoint for sash.
This plugin is for use with the VerticalResponse.com API. For more information see http://sash.sourceforge.net.
This section will document the steps that are necessary to create a plugin for sash.
Wes Bailey, <firstname.lastname@example.org>
When you find a bug in this plugin please contact the author. At the present time there are no known bugs.
sash is really possible because of these fine modules available on cpan:
Copyright (C) 2007, Wes Bailey, VerticalResponse Inc.
Sash is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Sash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA