Skip to content

feat: configuration via env variables #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 5, 2025
Merged

Conversation

hugodutka
Copy link
Collaborator

@hugodutka hugodutka commented Aug 5, 2025

Allow configuring AgentAPI using environment variables. At the same time, I also refactored httpapi.NewServer to accept a struct config instead of positional arguments, because I noticed it's getting crowded.

@hugodutka hugodutka requested a review from johnstcn August 5, 2025 15:16
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add some tests around the CLI / env parsing and precedence in e.g. server_test.go?

Suggest:

  • All args
  • All env
  • Args vs Env precedence

Comment on lines 267 to 270
os.Setenv("AGENTAPI_TYPE", "goose")
os.Setenv("AGENTAPI_TERM_WIDTH", "120")
defer os.Unsetenv("AGENTAPI_TYPE")
defer os.Unsetenv("AGENTAPI_TERM_WIDTH")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: t.Setenv

@hugodutka hugodutka force-pushed the hugodutka/env-vars branch from 5deeb8a to 4d2eeb7 Compare August 5, 2025 18:01
@hugodutka hugodutka merged commit 9986f0d into main Aug 5, 2025
2 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