Command-line wrapper of Adium
Adium Shell (adium-sh) is a command-line tool and Python wrapper for Adium.
adium-sh provides shell utilities and Python wrapper based on AppleScript support of Adium.
The current features are:
- Set default service and account
- Send messages using exact account name or alias
- Receive and reply to messages using patterns or external API (SimSimi currently supported)
- React to events
$ pip install adium-sh
You must specify the account and service to associate with the current use, either as command-line arguments or in the config file. When specifying them as arguments, you must put them before the sub-commands.
Send a message using account name:
$ adiumsh -s GTalk -t yourname@gmail send -b firstname.lastname@example.org Hello, there <<EOF
Send a message using alias:
$ adiumsh -s GTalk -t email@example.com send -a 'John Smith' Hello, there <<EOF
Set default configuration file at ~/.adiumsh:
[default] service = GTalk account = firstname.lastname@example.org
Then you can send messages without specifying -s/--service and -t/--account:
$ adiumsh send -a 'John Smith'
You can also pass as argument your message:
$ adiumsh send -a 'John Smith' -m 'Hello, there'
You must specify a chat method to receive messages. By default, adium-sh uses “Simple Chat”, which basically replies to received messages according to the patterns you set. You must set the patterns in the config file, possibly like the following settings:
[default] service = GTalk account = email@example.com [chat-default] type = wildcard patterns = *hello*: hi *what*: sorry *: I'm not available now
Then, you can invoke the “receive” sub-command with the -c/--chat arguments:
$ adiumsh receive -c default
The patterns is a list of string pairs where each pair is separated by a colon. The string to the left of the colon is the pattern against which the received text will be matched, and the right one is the corresponding reply text. There is also a “type” option in the chat section, which defaults to “wildcard” that uses globbing pattern matching; another value to it is “regex”, which uses regular expression.
You can also use “SimSimi Chat” which hits the SimSimi API with the messages received. You have to set the API key in the config file and the key type (“trial”, which is default, or “paid”):
[chat-simi] simi-key = some-really-long-key simi-key-type = trial
Then, invoke “receive” with this chat from command line:
$ adiumsh receive -c simi
Set the default chat in the default settings:
[default] service = GTalk account = firstname.lastname@example.org chat = default [chat-default] patterns = *hello*: hi *what*: sorry *: I'm not available now [chat-another] patterns = *: not here
Now you can also switch between chats from the command line other than the default:
$ adiumsh receive -c another
- Complete Python wrapper API to AppleScript support
- Exhaustive commands based on the wrapper