A shell for the Callimachus Project (http://callimachusproject.org) that implements a client for the Callimachus REST API.
The Callimachus shell may be used in either interactive or non-interactive modes. When used in interactive mode, a prompt is given which accepts built-in commands. The built-in command "help" may be used to obtain usage information on built-in commands.
When used in non-interactive mode, the shell will accept a file on STDIN for processing. The file is expected to contain Callimachus shell commands.
cash.pl -i cash.pl [-s] -e ’<command>; <command>; ...’ cash.pl -u cash.pl -v cash.pl < script-file -e | --execute Execute the following commands. Commands are separated with semi-colons. -i | --interactive Provide an interactive shell environment with commands specific to Callimachus operations. -s | --silent Only provide output where necessary (e.g. errors and cat command). -u | --usage Show usage directions and exit. -v | --version Report the version number of this shell.
To get details for a particular command:
help <command>
# | Comment |
cd <folder> | Change the active folder |
debug | Report the state of the shell's server object |
echo <string> | Echo a string to STDOUT |
exec <command> | Execute command on the calling shell |
exit | Exit the shell |
export CAR [<filename>] | Exports the contents of the active folder into a CAR file |
get <file_title> | Retrieve a file from the active folder and save it |
help | Get this help message |
import CAR <filename> | Imports the contents of the filenme (a CAR file) into the active folder |
login <user><pass> | Login to the active server |
logout | Log out from the active server |
ls | List the contents of the active folder |
mkdir <foldername> | Make a new folder |
mv <filename1><filename2> | Move filename1 to filename2 |
put <filename> | Store a file in the active folder |
pwd | Return the path of the active folder |
quit | Exit the shell |
rm <filename> | Delete a file from the active folder |
rmdir <foldr_name> | Delete a folder from the active folder |
server <url> | Set the Callimachus server authority. Optionally set an HTTP proxy (-p <proxy>) |
set <option> <value> | Set a shell option |
version | Report the version of this shell |
# | Lines beginning with # are considered comments and are not processed |
cat | cat <file title>: Retrieves the designated file and send it to the standard output. The file title must be exactly as it appears in a folder listing, including spaces. This action may require authorization (see 'help login'). |
cd | cd <folder title>: Changes the active folder to the name given. The title provided may be relative to the current folder (without a leading '/') or absolute to the top folder for the active server (with a leading '/'). Leading '..' characters refer to the parent folder. If the folder title is omitted, the folder will be changed to the top level ('home') folder. |
debug | debug: Report the state of the shell's server object. This command is primarily used for debugging the shell. |
echo | echo <string>: Echo a string to STDOUT. This command may be used (e.g.) to mark up output when run with -e or a script file. |
exec | exec <command>: Issues a command to the calling shell. The exec command allows users to run external commands without exiting the Callimachus Shell. |
exit | exit: Exits the shell. |
export | export CAR [<filename>]: Exports the contents of the active folder into a Callimachus Archive (CAR) file. If a filename is not provided, the server's suggested filename (consisting of path-to-folder-servername.car) will be used. This action requires authorization (see 'help login'). |
get | get <file title>: Retrieves the designated file and saves it to the local file system. The file title must be exactly as it appears in a folder listing, including spaces. This action may require authorization (see 'help login'). |
help | help: Provides a list of built-in commands. |
import | import CAR [<filename>]: Retrieves the designated file and saves it to the local file system. The file title must be exactly as it appears in a folder listing, including spaces. This action may require authorization (see 'help login'). |
login | login <username> <password> |
logout | logout: Logs out of the active server. Actions requiring authentication will no longer work. |
ls | ls: Lists the contents of the active folder. Subfolder names are followed by a / character, e.g. 'rdf/'. Files are followed by their type in parentheses, e.g. 'helloworld (graph)'. |
mkdir | mkdir <foldername>: Make a new folder called foldername in the active folder or as provided by a path. The folder name given may be a URL, path or simple alphanumeric name. Folders will be created along a given path, as required. This action requires authorization (see 'help login'). |
mv | mv <filename1><filename2>: Move filename1 to filename2. Filenames may be simple names, which will rename a file in the active folder, paths relative to the active server or fully-qualified URLs. |
put | put <filename>: Puts the designated file onto the server in the active folder. The filename will become the filename on the server, but will be changed to lower case. This action requires authorization (see 'help login'). |
pwd | pwd: Returns the path of the active folder. |
quit | quit: Exits the shell. |
rm\s+ | rm <file title>: Deletes the designated file from the active folder. The file title must be exactly as it appears in a folder listing, including spaces. This action requires authorization (see 'help login'). |
rmdir | rmdir <folder title>: Deletes the designated folder from the active folder. The folder title must be exactly as it appears in a folder listing, including spaces. This action requires authorization (see 'help login'). |
server | server <url> or server -p <proxy><url>: Sets the Callimachus server authority. For example, 'server http://localhost:8080/' creates a server object with that base HTTP authority. The server URL must refer to a Callimachus instance. Further commands will relate to the last set server authority. Optionally set an HTTP proxy with -p to allow connection to a Callimachus server behind a proxy or running a DNS name different from its HTTP authority. The <proxy> field must contain a URL and may contain an optional port number (e.g. http://www.example.com:8080). The proxy port defaults to 1080 if not provided. The <proxy> field must contain 'http://'. |
set | set <option><value>: Set a shell option to the specified value. Current options are 'debug', which may be set to a non-negative integer value to cause an increasing level of additional information to be displayed, and 'autols', which may be set to 1 to cause an 'ls' command to be issued after every 'cd' command. |
ver | version: Report the version number of this shell. |