Skip to content

feat: support custom container environment variables - #24

Merged
laosb merged 1 commit into
laosb:mainfrom
Alice39s:feat/custom-environment-variables
Jul 31, 2026
Merged

feat: support custom container environment variables#24
laosb merged 1 commit into
laosb:mainfrom
Alice39s:feat/custom-environment-variables

Conversation

@Alice39s

@Alice39s Alice39s commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add repeatable -e/--env KEY=VALUE options for container sessions
  • support project-level defaults through agent.environment in .agentc/settings.json
  • merge project and CLI environment variables by name, with CLI values taking precedence
  • persist environment options when generating settings with agentc init

Motivation

Container images don't always ship sane locale and time-zone defaults, so tools can behave differently across hosts. Setting variables like TZ, LANG, and LC_ALL explicitly fixes that without having to build a custom image.

Usage

Pass one or more variables on the command line:

agentc run \
  --env TZ=America/Los_Angeles \
  --env LANG=en_US.UTF-8 \
  --env LC_ALL=en_US.UTF-8

Or define project defaults in .agentc/settings.json:

{
  "agent": {
    "environment": {
      "TZ": "America/Los_Angeles",
      "LANG": "en_US.UTF-8",
      "LC_ALL": "en_US.UTF-8"
    }
  }
}

CLI values override project settings with the same name:

agentc run --env TZ=Europe/Berlin

Empty values and values containing additional = characters are preserved. If a CLI variable is repeated, the last value wins.

@laosb laosb self-assigned this Jul 31, 2026
@laosb

laosb commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Thank you!

@laosb
laosb merged commit 796ccd9 into laosb:main Jul 31, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants