Why does bitcoin-cli not know about working directory of bitcoind?
The bitcoin-cli use the bitcoin-rpc, so for used a bitcoin-cli, you must ran the bitcoind with the configuration and when it is OK, you can get command with the bitcoin-cli

A simple file configuration could be it

##
## bitcoin.conf configuration file. Lines beginning with # are comments.
##
# On client-side, you add the normal user/password pair to send commands:
rpcuser=alice
rpcpassword=bob


or you can run the bitcoind with this command bitcoind -rpcuser=alice -rpcpassword=bob