Here's an incomplete list of commands. The most important commands are listed first. A more complete listing of the auth commands follows.
It's important to understand the structure of commands. Most commands are handled by dispatch objects, which are specified by the first word of the command. The second word is a function to be called by the dispatch object. Additional words are parameters for the function.
auth firstuser [user] [pass]
This command tells the auth dispatch object to execute the firstuser function given username 'user' and password 'pass'. A new user account will be created with superuser permissions, but only if no user currently exists.
Attempting to add a "firstuser" user when other users already exist will result in an error.
As of version 0.0016, this initial command can now be handled on the Home tab (when connected through http://localhost:4180) using a form built for this specific purpose. There should be no reason to do it in the command tab, but it's still possible. The command is useful if you need to create your first user via a raw connection to port 4101.
auth login [user] [pass]
This command tells the auth dispatch object to execute the login function given username 'user' and password 'pass'. If the user exists and the password is correct, a user session is returned.
version
Dispatcher returns this always-public command's result containing version information about the running app.
root status
Tells the root dispatch object to retrieve the status information for the root object.
shutdown
Shuts down the aimy software. No further commands will be possible until aimy is started again.
Unlike the previous commands, this command has no dispatch prefix. It interacts with the core container that manages the entire system, so is handled directly by the dispatcher object.
root names
Returns a result with a list of the names of service items currently running directly under the root object.
root tree
Returns a result with a tree of items currently running under the root object.
coreload
Decore's all aimy software objects, deletes the old objects, reloads all aimy software python code, and restores the original objects with their previous cores intact. This is meant for development purposes only - to reload aimy without closing established connections.
Like "shutdown", this command directly affects the core, so is handled directly by the dispatcher.
The service command lets you forward a command to any object in the root object's service tree. The syntax works like this: Type "service [path.to.service] [command] [args ...]"
You can determine which services are available (and their path) by refreshing the list in the "Service" tab. NOTE that some services come and go, such as the HTTP connections used to run aimy's web admin page.
As an example, here's how to tell the app.update service to
check for new versions of the aimy software by sending the
check
command to the app.update
service:
service app.update check
Each service will have it's own set of commands and arguments. I'll try to (eventually) get them all listed/updated, but you might find a lot of "easter eggs" by looking through the code.
I'll start with the commands that all objects support:
service [path] status
Returns a status dict for the service at [path].
service [path] tree
Returns the tree of objects contained by the service at [path].
service [path] names
Returns the list of the names of objects directly contained by the service at [path].
I see aimy as typically being a single-user app, but the auth dispatcher has all these nifty commands that let you add, manage, and delete other users so I'll include the commands here.
auth logout
Logs you out of your current session.
auth empty
Returns a "true" result if there are no existing accounts. This will never return true unless you make it public in config - it will return "command unauthorized".
auth session
Returns the account record for the currently logged in user.
auth account [user]
Returns the account record for the specified user.
auth accountadd [user] [pass]
Adds an account for the given user with the given password.
auth accountdel [user]
Deletes the specified user's account.
auth accountpass [user] [pass]
Sets the specified user's password.
auth password [oldPassword] [newPassword]
Change the currently logged-in user's password.
auth hasrole [user] [role]
Returns a true result if the specified user has the given role. Roles are given in dot notation, starting with the dispatch object's name. For example, a user must have the 'auth.hasrole' role to check roles.
auth roleset [UzEr] role value [value...]
Sets the given user's role to the following values. To allow user 'UzEr' to check roles and delete accounts, use the following command:
auth roleset UzEr auth hasrole accountdel
auth roledel [UzEr] role
Deletes all special permissions for the specified user for the specified role. For example, to remove all of UzEr's auth-related roles:
auth roledel [UzEr] auth
Note that this does not affect role permissions for any other roles that may be set for UzEr.
Here's a screenshot of the aimy command page.