Here some more examples to connect as Guest to an AFP share from the command line. The lines in red are the result of the mount command, without any arguments.
The osascript doesn't require to create the target directory.
osascript -s o -e 'mount volume "afp://server/Repository"'
//;AUTH=No%20User%20Authent@server/Repository on /Volumes/Repository (afpfs, nodev, nosuid, mounted by alberto)
The following two lines are equivalent. The key word here is AUTH, and must be in capitals
mkdir /Volumes/Repository; mount_afp afp://";AUTH=No User Authent"@server/Repository /Volumes/Repository
mkdir /Volumes/Repository; mount_afp “afp://;AUTH=No%20User%20Authent@server/Repository” /Volumes/Repository
//;AUTH=No%20User%20Authent@server/Repository on /Volumes/Repository (afpfs, nodev, nosuid, mounted by alberto)
mkdir /Volumes/Repository; mount_afp afp://server/Repository /Volumes/Repository
//;AUTH=No%20User%20Authent@server/Repository on /Volumes/Repository (afpfs, nodev, nosuid, mounted by alberto)
The following line is Bonjour style mount
mkdir /Volumes/Repository; mount_afp afp://server._afpovertcp._tcp.local/Repository /Volumes/Repository
//;AUTH=No%20User%20Authent@server._afpovertcp._tcp.local/Repository on /Volumes/Repository (afpfs, nodev, nosuid, mounted by alberto)
In all examples, when the share is unmounted, target directory under /Volume is automatically deleted. As I previously wrote my user is an OD user and my computer is bound to OD.