Note: You are viewing the documentation for an older major version of the AWS CLI (version 1).

AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.

[ aws . codeartifact ]



Sets up the idiomatic tool for your package format to use your CodeArtifact repository. Your login information is valid for up to 12 hours after which you must login again.

See 'aws help' for descriptions of global parameters.


--tool <value>
--domain <value>
[--domain-owner <value>]
[--namespace <value>]
[--duration-seconds <value>]
--repository <value>


--tool (string) The tool you want to connect with your repository

--domain (string) Your CodeArtifact domain name

--domain-owner (string) The AWS account ID that owns your CodeArtifact domain

--namespace (string) Associates a namespace with your repository tool

--duration-seconds (integer) The time, in seconds, that the login information is valid

--repository (string) Your CodeArtifact repository name

--dry-run (boolean) Only print the commands that would be executed to connect your tool with your repository without making any changes to your configuration

See 'aws help' for descriptions of global parameters.


To configure authentication to your repository with the login command

The following login example configures the npm package manager with a repository named test-repo in a domain named test-domain.

aws codeartifact login \
    --domain test-domain \
    --repository test-repo \
    --tool npm


Successfully configured npm to use AWS CodeArtifact repository
Login expires in 12 hours at 2020-11-12 01:53:16-05:00

For more information, see Getting started with the AWS CLI in the AWS CodeArtifact User Guide.