Skip to content

Feature: Support setting structures-path via environment variable #122

@httpdss

Description

@httpdss

Description

Currently, the --structures-path (-s) argument can only be set via the command-line flag. It would be convenient to also support setting this via an environment variable, similar to how STRUCTKIT_LOG_LEVEL works for logging.

Motivation

  • Allows users to set a default custom structures path without repeating the -s flag on every command
  • Useful for CI/CD pipelines and Docker containers where environment variables are the standard way to configure applications
  • Consistent with the existing pattern used for STRUCTKIT_LOG_LEVEL

Proposed Solution

Add support for a STRUCTKIT_STRUCTURES_PATH environment variable that would be used as the default value for --structures-path if not explicitly provided via the command-line flag.

Example Usage

export STRUCTKIT_STRUCTURES_PATH=~/custom-structures
structkit generate python-basic ./my-project
# Would behave the same as:
# structkit generate -s ~/custom-structures python-basic ./my-project

Priority

Command-line arguments should take precedence over the environment variable (current behavior for other similar tools).

Related Code

The environment variable pattern is already implemented for logging in structkit/main.py (lines 72-74), which could serve as a reference for this implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions