Log in to npm programmatically without STDIN/STDOUT for use in CI/CD pipelines and automated scripts.
npm-cli-login is a Node.js command-line tool and library that allows programmatic login to npm registries. It solves the problem of authenticating npm in environments without interactive input, such as CI/CD pipelines, by updating the `.npmrc` file with authentication tokens using environment variables or command-line arguments.
DevOps engineers and developers setting up automated build pipelines, CI/CD systems, or scripts that require npm authentication without manual intervention.
It provides a reliable, scriptable way to handle npm authentication in headless environments, supporting both public and private registries with flexible credential input methods, unlike the standard interactive `npm login` command.
npm-cli-login is a utility that enables programmatic authentication with npm registries, including private registries, by modifying the .npmrc configuration file. It's designed for environments where interactive login isn't possible, such as continuous integration systems and automated deployment scripts.
.npmrc file, with support for quoted tokens containing special characters.npm-cli-login focuses on simplicity and reliability for automated npm authentication, ensuring secure credential handling in non-interactive environments.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Designed for headless environments like Jenkins or GitHub Actions, it authenticates without STDIN or STDOUT, enabling automatic npm logins in automated pipelines, as highlighted in the README for CI build systems.
Supports custom npm registries and scoped packages for private organizations, allowing authentication beyond the public registry, as demonstrated in the usage examples for private NPM registries.
Accepts credentials via environment variables or command-line arguments, providing flexibility for different automation workflows, as specified in the CLI and environment variable sections.
Can be imported as a Node.js module for integration into custom scripts and tools, enabling developers to embed npm login logic directly, as shown in the programmatic API examples.
Handles quoted tokens with special characters through the --quotes option, ensuring compatibility with complex authentication tokens, as mentioned in the CLI arguments description.
Relies on plain-text passwords passed via environment variables or CLI arguments, which can be logged or exposed in scripts, unlike more secure methods like npm tokens or integrated secret management.
Only supports username/password authentication, not modern npm features like access tokens or OAuth, which may be required for registries with enhanced security policies.
Modifies .npmrc files directly, which could lead to conflicts if other tools or processes are managing the same file, though the config-path option provides some mitigation.
The README doesn't specify robust error handling for network issues or authentication failures, which could cause silent failures in automated pipelines without clear debugging steps.