Skip to content

[Bug]: env var not available in container #330

Open

Description

@cbejensen

What happened?

I have an environment variable in Fish shell:

set -Ux NPM_TOKEN <token>

And I have verified it's available, even in a new terminal instance

echo $NPM_TOKEN # works

So I tried to follow the docs by adding it as a secret:

cu secret set NPM_TOKEN "env://NPM_TOKEN"

And I've verified that something was added to the config:

> cu config show
Base Image:             node:22
Workdir:                /workdir
Setup Commands:         (none)
Install Commands:       (none)
Environment Variables:  (none)
Secrets:                
  1.                    NPM_TOKEN=env://NPM_TOKEN

But when I ask AI to do something that needs that token, like update a package, it creates an environment, then fails saying NPM_TOKEN cannot be found (for context, it's needed because we use a custom NPM registry, which requires npmAuthToken: ${NPM_TOKEN} in .yarnrc.yml, which works fine locally). I have also verified that particular env has the same config as above.

What am I doing wrong?

Version

container-use version 0.4.2
commit: 89ebe7765ec067a07c51de104822056eb217c1b9
built: 2025-08-19T22:23:38Z

Activity

  1. added
    bug
    on Dec 22, 2025
  2. added a commit that references this issue on Mar 26, 2026
    1d34eaa
  3. added a commit that references this issue on Nov 1, 2026
    7d8a978
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions