# Pull token output formats and credential names

URL: https://edu.chainguard.dev/platform/chainctl-usage/pull-token-output.md
Last Modified: September 3, 2026
Tags: chainctl, Reference

A reference for the output formats chainctl auth pull-token create supports and the names each format gives to the identity ID and token.

chainctl auth pull-token create returns two values:
An identity ID, the identifier of the pull token identity that chainctl just created. It takes the form ORGANIZATION_ID/TOKEN_ID, where both parts are hexadecimal strings. A token, a JSON Web Token that authenticates as that identity until the token&rsquo;s time to live expires. Every tool that consumes a pull token takes that pair as a username and a password for HTTP basic authentication: the identity ID is the username, and the token is the password. What changes between output formats is only the label.
Terminology mapping Value Default output --output=json --output=env Identity ID Username identity_id CHAINGUARD_IDENTITY_ID or CHAINGUARD_&lt;ECOSYSTEM&gt;_IDENTITY_ID Token Password token CHAINGUARD_TOKEN or CHAINGUARD_&lt;ECOSYSTEM&gt;_TOKEN The Chainguard Console labels the same two values Username and Password when it displays a new access token.
chainctl auth pull-token without a subcommand is equivalent to chainctl auth pull-token create, so the formats described here apply to both.
chainctl auth pull-token create supports two output formats, env and json, plus the default output you get when you pass no --output flag at all.
Default output With no --output flag, chainctl prints instructions for the repository type you asked for.
For --repository=oci, the default, it prints a ready-to-run docker login command:
chainctl auth pull-token createTo use this pull token in another environment, run this command: docker login &#34;cgr.dev&#34; --username &#34;45a.....764595/095.....68679&#34; --password &#34;eyJhbGciO..........WF0IjoxN&#34;The --username value is the identity ID and the --password value is the token. Both work with any tool that logs in to an OCI registry, including Podman, Helm, and registry mirroring tools. Refer to Authenticate to Chainguard&rsquo;s Registry for examples.
For every other repository type, chainctl prints the pair as a username and a password:
chainctl auth pull-token create --repository=javaTo use this pull token in another environment, supply the following for Basic authorization: Username: 45a.....764595/095.....68679 Password: eyJhbGciO..........WF0IjoxN JSON output --output=json prints one compact object with an identity_id field and a token field:
chainctl auth pull-token create --repository=java --output=json{&#34;identity_id&#34;:&#34;45a.....764595/095.....68679&#34;,&#34;token&#34;:&#34;eyJhbGciO..........WF0IjoxN&#34;}The field names stay the same for every repository type. Pipe the object to jq or another JSON processor to extract either value:
TOKEN_JSON=$(chainctl auth pull-token create --repository=java --output=json) USERNAME=$(echo &#34;$TOKEN_JSON&#34; | jq -r &#39;.identity_id&#39;) PASSWORD=$(echo &#34;$TOKEN_JSON&#34; | jq -r &#39;.token&#39;) Environment output --output=env prints two export statements, one per value:
chainctl auth pull-token create --repository=java --output=envexport CHAINGUARD_JAVA_IDENTITY_ID=45a.....764595/095.....68679 export CHAINGUARD_JAVA_TOKEN=eyJhbGciO..........WF0IjoxNWrap the command in eval to run those export statements, which sets both variables in your current session:
eval $(chainctl auth pull-token create --repository=java --output=env)The variable names depend on the repository type. For a library ecosystem, chainctl uppercases the --repository value and inserts it into the name; for oci and apk it uses the unqualified names.
--repository Identity ID variable Token variable oci (default) CHAINGUARD_IDENTITY_ID CHAINGUARD_TOKEN apk CHAINGUARD_IDENTITY_ID CHAINGUARD_TOKEN java CHAINGUARD_JAVA_IDENTITY_ID CHAINGUARD_JAVA_TOKEN javascript CHAINGUARD_JAVASCRIPT_IDENTITY_ID CHAINGUARD_JAVASCRIPT_TOKEN python CHAINGUARD_PYTHON_IDENTITY_ID CHAINGUARD_PYTHON_TOKEN Because the ecosystem name is part of the variable, credentials for two ecosystems can coexist in one shell session or one secrets file:
eval $(chainctl auth pull-token create --repository=java --output=env) eval $(chainctl auth pull-token create --repository=python --output=env)Each invocation creates a new pull token identity. Write the export statements to a file or a secrets manager rather than rerunning the command whenever you need the values again, because chainctl displays the token only once.
Chainguard and tool-specific variables chainctl emits variables starting with CHAINGUARD_. However, build tools that read credentials from the environment typically use their own names, and don&rsquo;t read the CHAINGUARD_* variables directly. In such cases, you must map one to the other explicitly.
For example, uv reads index-scoped credentials from UV_INDEX_&lt;NAME&gt;_USERNAME and UV_INDEX_&lt;NAME&gt;_PASSWORD, where &lt;NAME&gt; is the index name in uppercase, with underscores replacing hyphens. For an index named chainguard:
export UV_INDEX_CHAINGUARD_USERNAME=&#34;${CHAINGUARD_PYTHON_IDENTITY_ID}&#34; export UV_INDEX_CHAINGUARD_PASSWORD=&#34;${CHAINGUARD_PYTHON_TOKEN}&#34;The same pattern applies wherever a tool defines its own variable, such as the HTTP_AUTH variable used for private APK repositories:
export HTTP_AUTH=&#34;basic::${CHAINGUARD_IDENTITY_ID}:${CHAINGUARD_TOKEN}&#34;Names you choose yourself, such as GitHub Actions secrets, are also independent of the CHAINGUARD_* convention. Whatever you call them, the identity ID is the username and the token is the password.
Why the --output help text lists more formats If you pass any other value, chainctl prints a warning to standard error, then falls back to default output. Requesting csv, for example, produces a warning along these lines:
&#34;csv&#34; is not a supported output. Supported: [ env json]. Using print to command lineEven when a command returns this warning, it still creates the pull token. It refuses only the formatting request, so a script that expects machine-readable output on standard output receives prose instead. This matters most for eval: eval $(chainctl auth pull-token --output=csv) creates a token, sends the warning to your terminal, and then tries to run the human-readable text as shell commands.
The --output flag is global, so chainctl --help and every reference page describe it the same way:
-o, --output string Output format. One of: [csv, env, go-template, id, json, markdown, none, table, terse, tree, wide]That list is the union of every format any chainctl command supports, not a list of formats that all commands support. Each command declares its own subset. Table-shaped commands such as chainctl iam identities list accept csv and markdown; pull-token create returns a single credential pair and accepts only env and json.
Related pages Authenticate to Chainguard&rsquo;s Registry for container pull tokens Chainguard Libraries access for library pull tokens Private APK repositories for APK pull tokens chainctl auth pull-token create for the generated flag reference Automating with chainctl for other scripting patterns 
