LinuxCommandLibrary

zapier-login

Log into Zapier account

TLDR

Log in to a Zapier account

$ zapier login
copy

Log in to a Zapier account with a deploy key for SSO
$ zapier login [[-s|--sso]]
copy

Display additional debug output
$ zapier login [[-d|--debug]]
copy

SYNOPSIS

zapier-login [options]
zapier-login --token API_KEY

PARAMETERS

--help
    Display help information and exit.

--version
    Show the Zapier CLI version and exit.

--token API_KEY
    Authenticate directly using a provided Zapier API key or access token. This is useful for CI/CD pipelines or non-interactive environments where a browser-based login is not feasible.

--browser
    Force opening a web browser for the OAuth login flow, even if other authentication methods might be available or default.

--no-browser
    Prevent the command from automatically opening a web browser. Useful when token-based authentication is preferred or for debugging in environments without a graphical interface.

--env environment
    Specify the Zapier environment to log into (e.g., production, staging, development). Defaults to production if not specified.

--host URL
    Override the default Zapier API host URL. This is primarily used for testing against custom Zapier instances or internal development environments.

DESCRIPTION

The zapier-login command is a crucial utility for developers and users interacting with the Zapier platform via its Command Line Interface (CLI). Its primary function is to authenticate the local Zapier CLI installation with a user's Zapier account.

This authentication typically involves an interactive process, often leveraging an OAuth 2.0 flow where the command opens a web browser to the Zapier login page. After successful login and authorization, Zapier issues an access token, which the CLI then stores securely on the local machine. This token grants the CLI the necessary permissions to perform operations on behalf of the user, such as creating, updating, testing, and deploying custom Zapier integrations (apps), managing zaps, or accessing other API-driven features.

Without a successful login, most other Zapier CLI commands will fail due to a lack of authorization. It streamlines the development workflow by providing a secure and persistent session, eliminating the need to re-authenticate for every command. It is the first step required to engage with the full power of the Zapier developer tools.

CAVEATS

The access token obtained through zapier-login is stored locally; ensure your machine is secure to protect these credentials.
Browser-based login requires a default web browser configured on your system.
Using the --token option directly exposes your API key in the command history; use with caution in shared environments.
Tokens can expire, requiring a re-login with zapier-login or refreshing the token if supported.
This command assumes the Zapier CLI is already correctly installed and configured.

TOKEN STORAGE LOCATION

Upon successful login, the Zapier CLI typically stores the authentication token in a configuration file within the user's home directory, often in a hidden folder like ~/.zapier/tokens.json (location may vary by OS and CLI version). This file contains sensitive information and should be protected with appropriate file permissions.

TROUBLESHOOTING LOGIN ISSUES

If zapier-login fails, ensure you have an active internet connection and that your system's default web browser is functioning correctly. Firewall or proxy settings can also interfere with the authentication flow. It's often helpful to first run zapier-logout to clear any potentially corrupted existing credentials, then attempt to log in again.

HISTORY

The zapier-login command, as part of the Zapier CLI, has evolved alongside modern cloud application development practices. Initially, CLI authentication might have relied on simpler API key entry. However, with the increasing emphasis on security and user experience, the command primarily shifted to an OAuth 2.0 based browser flow, providing a more secure and user-friendly way to authenticate without directly handling sensitive credentials on the command line. The inclusion of the --token option provides flexibility for automated environments, reflecting the need for both interactive and non-interactive authentication methods.

SEE ALSO

zapier-logout(1), zapier-whoami(1), zapier-init(1), zapier-deploy(1)

Copied to clipboard