def get_token(args, env):
    """ Get token from args or environment """
    if args.token:
        return args.token
    if "DYNALIST_TOKEN" in env:
        return env["DYNALIST_TOKEN"]
    raise Exception("ERROR: Please pass in a Dynalist token "
                    "or set DYNALIST_TOKEN environment variable.")