Skip to content

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

@cbejensen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions