#!/usr/bin/env expect
set registry [lindex $argv 0]

spawn npm adduser --registry=$registry
expect "Username:"
send "test\n"
expect "Email:"
send "test@example.com\n"
expect eof

Add adduser command wrapped with expect
test: Add adduser command wrapped with expect

To allow it to be run automatically like:

./add-user.sh http://localhost:5984/registry/_design/app/_rewrite/
