Overview

The Store Command class allows you to manage a store (possibly more) with a primary key but how do you actually manage the elements in it? This answer is CLI (Command Line Interface) which lets you do a wide variety of administrative tasks directly. You may wonder why not just, say, use a database directly? The reason is that objects in the store have their own logic and many operations that make sense on the objects (such as copying them or creating them) are at best frightfully awkward to do directly.

The CLI has two basic parts, a driver which manages your interaction with the store and the store itself. The driver will do things like keep a history of every command you enter, let you save one, read it, organized a set of commands in a file and run it as a batch command, and lastly manage a help facility. These are called meta-commands. All meta-commands start with a / and are not passed to the store.

Meta-Commands

The list of them is

  • /? - list help for the meta commands
  • /help topic - show help for a topic
  • /h - show the history

Help!

Online Command Help

Every command supports online help. If you are running the CLI then issue

    >command --help

And a great deal of help will be printed. Online help is

Online help for properties etc.

A help facility for properties and such is available. This is accessed with

    /help topic

For instance, each object may have multiple properties and they should be described using this facility.

The Environment

By environment we mean a set of keys and values that may be used as a pre-processor. You set them and access them with ${key} which is replaced by the value. This happens before any other processing of the commands and is a very useful labor saving device. You may set, store, load, etc. these. You do not have to use them, but in many cases where there is a limited functionality of the command line itself (such as no clipboard operations), this can be a very useful tool indeed.

  • clear_env
  • get_env
  • print_env
  • read_env
  • save_env
  • set_env

Serialization of objects.

To serialize an object means to turn it into (in this case) a small XML document. These may be treated like any other document and edited, stored, shared. They may then be imported or deserialized into the store. A common use is to exchange items between stores, or to serialize an object, edit it then restore it.

  • deserialize
  • serialize

CRUD Operations on objects.

  • copy
  • create
  • list_keys
  • ls
  • rename
  • rm
  • update

Working with a single object

You may set an identifier which is then used for all subsequent operations.

  • clear_id -- erase the current default identifier.
  • get_id -- print the current identifier if set.
  • edit -- edit the current object with the identifier
  • set_id -- set the current default identifier

Archiving objects.

Objects may be archived in the store and restored. This is done by making a complete copy of the object and saving it with an overloaded identifier. This is quite useful if you are making changes to an object, but may need to back out of them, or just to have a an audit trail (archive an object before updating it).

  • archive

Searching

  • rs
  • search

Scripting, Batch files

Batch processing, i.e., writing a rudimentary script of commands you would type in and executing it, is supported. For more complex operations, you may need to use something like a bash or QDL script, but a wide variety of cases can be handled.

  • echo -- echo the argument to this command.
  • set_output_on -- toggel output. Of off, then no output of any sort is created.
  • set_verbose_on -- if on, then the system gets a lot chattier about what it is doing.

Miscellaneous Commands.

  • print_help -- print generic help
  • size -- show the size of the store, i.e., the number of entries
  • version --print out the version string for store commands