[ 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 use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.

Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal’s quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .

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 https://test-domain-111122223333.d.codeartifact.us-west-2.amazonaws.com/npm/test-repo/
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.