Add from_env() configuration helper for OpenShell Python SDK
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 8.7k
- Forks
- 1.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 253
Description
Motivation
The Python SDK should be easy to configure in CI, containers, and developer shells. A from_env() helper would make OpenShell configuration explicit and repeatable while complementing existing XDG / OPENSHELL_GATEWAY discovery.
Proposed change
Add a config constructor or client factory that loads OpenShell settings from environment variables, for example gateway address, auth/material paths, and timeout defaults.
Example shape:
client = openshell.Client.from_env()
or:
config = openshell.Config.from_env()
client = openshell.Client(config)
Acceptance criteria
- Define and document the supported environment variables and precedence rules.
- Add
from_env()tests for defaults, explicit overrides, and invalid values. - Keep existing configuration/discovery behavior backward compatible.
- Include a short docs example for local development and CI usage.
Notes
This should be SDK-only and should not require gateway/proto changes.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the Python SDK's existing XDG and OPENSHELL_GATEWAY discovery and configuration entry points first. Define the supported environment variables and precedence, then add from_env() tests covering defaults, overrides, and invalid values. Done means existing discovery remains compatible and a short local-development and CI example is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- developer-experience, documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100