Circle commands


If you use Circle in GUI mode, the commands listed below are not mandatory.
However, you will find them practical. They interact smoothly with the GUI.

If you use Circle in text mode (circle -t), you need to use these commands.


1. Text mode only
2. General-purpose commands
3. Chat related commands
4. File sharing commands
5. Gossip related commands
6. Shell commands
7. Python commands
8. Commands with multiple lines



Text-mode only:

In text mode, you can enter the shell by pressing Ctrl-D.
Since Ctrl-D will also exits from a shell, you can use it to toggle between shell and circle.

While in the shell running circle -s will display the number of unread messages you have.
It will also save your current working directory for the next time you enter the shell.
You may find it convenient to add this to your shell prompt:

bash: add the following line to your .bashrc file

      PS1="$PS1\`circle -s\`"

zsh: add the following lines to you .zshrc file

      old_prompt="$prompt"
precmd() {
prompt="$old_prompt`circle -s`"
}

General-purpose commands:

/clear

Clears the content of the chat window. This command is aliased to Crtl-L

/help [command-name]

Show this web page, optionally starting at the description of the specified commands

/exit [message]

Exit the Circle. If anyone is watching you, they will see the message, if given.

/logout [message]

Log out, but don't close the Circle window.

/stats [-p | --profile]

Report network usage and number of peers.

If `-p' or `--profile' is given, then give an itemized account of network usage. This is for people who are interested in modifying Circle to use less bandwidth. Thus, the figures don't necessarily make much sense without reading the source code.

The given summary figure is a sum of data sent & received. The `direct recvfrom' item of `/stats --profile' represents amount received; the rest are the components in sent data.

`hdl msg' items represent the total size of replies to the given request type. `grep "def handle(" *.py' shows the places where these replies are generated. Most requests belong to node.py (see perform_standard_request). The return value of Whatever.handle is what gets sent (after being picked in node.py:handle_message).

`send msg' items can usually be found with `grep "call.*message" *.py'. (Also for finding the triggers of `hdl msg message' traffic.)

At the time of writing, the `glob' messages aren't broken down into their components in the network profile.


Chat related commands:

These are kind of like IRC commands, and, well, kind of not.

/msg nick/channel[,nick/channel...] message

Send a message to a person or people.

Eg:

      /msg pfh,#arvotea wassup?

/join [+ or -] nick/channel[,nick/channel...]

Treat all non-commands as messages to the list of people or channels.

If a + or - is put in front of the list, respectively add or subtract the people or channels to the list.

Eg:

      /join bob,tony,#buffy
/join - tony
/join + sam,tracy

/listen [+ or -] channel[,channel...]

Modify the list of channels you are listening to.

Eg:

      /listen #welcome
/listen - #trek
/listen + #buffy

To list the channels you are currently listening to, type

      /listen

/who [#channel]

List watched people who are currently online, or people currently listening to a channel.

/quiet [activity]

Toggle quietness. When you are quiet, messages are not displayed but instead stored for later, and the sender of the message will be told that you are quiet.

Eg:

      /quiet working

/read

Read messages received while you were quiet.

/me [activity]

Specify what you are currently doing. When someone sends you a message, or "/look"s at you they will be told what you are doing. (Note that this differs from the IRC meaning of /me.)

Eg:

      /me is avoiding his phd

/look [nick]

See what other people are doing. You can look at a specific person by specifying their nick. If you don't specify a nick, it will print out what everyone in your watch list is doing.

/give file [message]
/give !python_expression [message]

Give a reference to a file, or the result of a python expression to the people you have "/join"ed.

If it is a file, the recipients will be able to download it using the "/take" command.

If it is a python expression, the expression should not contain any spaces.

/giveto nick[,nick...] file [message]
/giveto nick[,nick...] !python_expression [message]

Like "/give", but to a person or people other than those you have "/join"ed.

/take [reference]

Download a reference that someone has "/give"n you.

/say message

Like typing message by itself, except without trying to parse message as a command.

(Useful for the rare occasions when you want to say something beginning with `/' or `!'.)

/repeat n

Repeat the last n messages you received.

/recall

Recall the last message you sent.

This only works for messages sent to people who aren't currently online.


/find [ -options ] [ nickname]

/find searches for people. Search results are diplayed in a list.
You may add listed people to your contact list using /add.

Available options are:

Examples:

      
/find bob
/find --online tony

Type just /find to list all people online.

/remember nickname

Add a person to your contact list.

/forget nickname

Remove a person from your contact list.

/set [parameter value]

Set a configuration parameter. /set on its own will display your current configuration.

Available parameters are:

Examples:

      /set
/set name John Smith



File sharing commands:

/search [keywords]

/search searches the network for files.
Results are diplayed in a list.

You may download listed files with /get or /play
In the GUI mode, you may also click on them.

Available options are:

Examples:

     /search mozart
     /search -a mozart
     /search mozart mp3

/get filename | all

The /get command downloads files found with /search or with /ls.
Type /get n to download the n-th file of the list.
Type /get all to download the whole list. This is useful if you want to download a whole directory.

/play filename

/play plays a file listed with /search or with /ls.

/ls [options] [nickname:path] [keywords]

/ls lists the files published in a directory.
Typing only /ls lists your locally published files.
Adding a nickname followed by a colon lists somebody else's files.
/ls uses the same options as /search

Examples:
    /ls -a avalon
    /ls thomas:
    /ls thomas:/music/
    /ls :/music/mozart/ ogg

Gossip related commands:

/gossip

Fetch and show the latest gossip.

/post

Open a window to compose a new item of gossip.

Shell commands:

You can execute shell commands if you preface them with a double slash ("//"). For example:

      //ls

The command can be interactive (i.e. prompt for values), but there is no terminal emulation, so things like vi or emacs wont work.

This just happens to be sufficient to use the "goofey" chat program popular at Monash University. For example:

      //goofey
//goofey -s pfh
> hi!

Python commands:

You can execute arbitrary Python commands if you preface them with an exclamation mark ("!"). There are two predefined variables: app is the application object, and node is the network node object. Eg:

      !node.call_p_success

Backslashes at the end of lines will be removed before the expression is passed to the python interpreter, allowing multi-line python statements. Eg:

      !for item in node.link_states.values(): \
print item.round_trip

Commands with multiple lines:

Commands can contain multiple lines. Put a "\" character at the end of each non-final line, eg:

      /msg pfh\
Hello Paul\
How are you today?