Opencog Shell for Noobs
THIS PAGE IS OBSOLETE. SEE HERE INSTEAD
This page describes some simple shell commands to give new users a basic understanding of its capabilities.
This page has the following prerequisites:
- The ability to start the Cogserver (see Starting_cogserver for details)
- The ability to connect to the Cogserver (see Connecting to the Cogserver for details)
See the prerequisites section above for details about starting and connecting to the CogServer.
Once connected to the CogServer, you should have a command prompt as shown below.
Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. opencog>
type "help"<enter> to get a list of commands:
Available commands: agents-list: List running agents agents-start: Start some agents agents-start-loop: Start the agent loop agents-step: Run a single cycle of an agent(s) agents-stop: Stop some agents running agents-stop-loop: Stop the agent loop data: loads inline xml data into the atomspace exit: closes connection and exit help: list the available commands or print the help for a specific command list: list the atom currently at the atomtable load: load the contents of a xml file loadmodule: load an opencog module; give the module filename as the argument pln: Run a PLN command save: save the AtomSpace to an XML file scm: Enter the scheme shell shutdown: shut down the cogserver sql-close: Close the SQL database sql-load: Load contents of SQL database sql-open: Open connection to SQL storage sql-store: Save the atomtable on the SQL database unloadmodule: unload an opencog module
To get information about any of the commands, use "help <name of command>".
Next we'll go through each command to describe some of their potential uses.
Allows you to enter data in XML format inline, current functionality unknown.
Closes the connection to the CogServer and exits the telnet session.
Shows the above list of possible commands.
Lists the atoms currently available in the AtomTable, in bracketed Scheme-like format.
Loads atom data from an XML file into the AtomSpace. Old, broken, obsolete and no longer supported. This should be removed from the interfaces. Use SCM instead.
Loads a module (Mind Agent) into the CogServer and starts it. The correct syntax for this is:
You can control the time allocated to the Mind Agents by changing the default values in the /lib/opencog.conf file (see Understanding the opencog.conf file for details).
Saves the contents of the AtomSpace to an xml file. Old, broken, obsolete and no longer supported. Should be removed. Use SCM instead.
Starts the Scheme shell within the CogShell. See this page for more details on using the Scheme shell.
Like it says, shuts down the CogServer. This will also disconnect any running telnet sessions to the CogServer.
Closes the connection to the MySQL database.
Loads a previously saved state from the MySQL database into the in-memory AtomTable. This provides an alternative to loading the same (generally static) scheme file of atom definitions every time, and allows the sql-save and sql-load calls to be used to continue work on an AtomTable that has been altered by Mind Agents.
Opens a connection to the MySQL database so the sql-load and sql-save commands can be used. Details about configuring the login credentials for this will be added here once discovered.
Dumps the current contents of the in-memory Atom-Table to the underlying SQL database. MySQL has been used up to now, but the current functionality of this interface is unknown.
This command unloads a module, generally a Mind Agent, that has been loaded into the CogServer's process list. By unloading it, the Mind Agent will no longer be given processing cycels to do its work.
Commands are not recognized
I could install and build opencog successfully, but the cogserver does not recognize any commands:
Connected to localhost.
Escape character is '^]'.
command "help" not found
What should I do?
I could solve this problem using the local opencog build in opencog/build/opencog/server instead of opencog/server. I used the config from the local build as well in my start_server.sh:
./cogserver -c ../../lib/opencog.conf