These docs are for v1.3.0. Click to read the latest docs for v1.6.

Aliasing EOSIO components

👍

Recommended Step

Aliasing your EOS components will simplify your development workflow and following documentation will be more easy for you.

For Docker

alias cleos='docker exec -it eosio /opt/eosio/bin/cleos -u http://localhost:8888'
alias keosd='docker exec -it eosio /opt/eosio/bin/keosd --wallet-url http://localhost:8888'

Determining your paths

Find your path to eos

$ cd eos
$ pwd
/Users/sandwich/Develop/block.one/eos

Open your ~/.bash_profile file in a text editor and replace YOURPATH in examples below with the path you just retrieved.

Using alias

#NODEOS
alias nodeos=YOURPATH/build/programs/nodeos
#CLEOS
alias cleos=YOURPATH/build/programs/cleos
#KEOSD
alias keosd=YOURPATH/build/programs/keosd
#EOSIOCPP
alias eosiocpp=YOURPATH/build/tools/eosiocpp

Adding to PATH

#VIM
vi ~/.bash_profile
#NANO
nano ~/.bash_profile
#PICO
pico ~/.bash_profile
#ATOM
atom ~/.bash_profile
#Default text editor (mac)
open ~/.bash_profile
#CLEOS
export PATH=YOURPATH/build/programs/cleos:$PATH
#NODEOS
export PATH=YOURPATH/build/programs/nodeos:$PATH
#KEOSD
export PATH=YOURPATH/build/programs/keosd:$PATH
#EOSIOCPP
export PATH=YOURPATH/build/tools/eosiocpp:$PATH

Using the path I discovered with pwd in the example a few steps above, here's what my paths look like:

#CLEOS
export PATH=YOURPATH/build/programs/cleos:$PATH
#NODEOS
export PATH=YOURPATH/build/programs/nodeos:$PATH
#KEOSD
export PATH=YOURPATH/build/programs/keosd:$PATH
#EOSIOCPP
export PATH=YOURPATH/build/tools/eosiocpp:$PATH

I can now access cleos, nodeos, keosd, eosiocpp from anywhere on my system.

$ cleos
ERROR: RequiredError: Subcommand required
Command Line Interface to EOSIO Client
Usage: cleos [OPTIONS] SUBCOMMAND

Options:
  -h,--help                   Print this help message and exit
  -H,--host TEXT=localhost    the host where nodeos is running
  -p,--port UINT=8888         the port where nodeos is running
  --wallet-host TEXT=localhost
                              the host where keosd is running
  --wallet-port UINT=8888     the port where keosd is running
  -v,--verbose                output verbose actions on error

Subcommands:
  version                     Retrieve version information
  create                      Create various items, on and off the blockchain
  get                         Retrieve various items and information from the blockchain
  set                         Set or update blockchain state
  transfer                    Transfer EOS from account to account
  net                         Interact with local p2p network connections
  wallet                      Interact with local wallet
  sign                        Sign a transaction
  push                        Push arbitrary transactions to the blockchain
  multisig                    Multisig contract commands

Above, I gave a messy example of aliasing your EOSIO programs and tools. This was so you could easily alias individual components. This one-liner is a bit more clean

export PATH=YOURPATH/build/programs/cleos:YOURPATH/build/programs/nodeos:YOURPATH/build/programs/keosd:YOURPATH/build/tools/eosiocpp:$PATH