Fix cli to inject database to core library