Skip to content

Feature: Add environment variable support for additional CLI arguments #123

Closed

Description

@httpdss

Description

Follow-up to #122. In addition to --structures-path, several other CLI arguments would benefit from environment variable support to improve usability, especially in CI/CD pipelines and containerized environments.

Proposed Environment Variables

High Priority

  1. STRUCTKIT_GLOBAL_SYSTEM_PROMPT (for --global-system-prompt / -p)

    • Typically a long or sensitive value that users want to set once
    • Avoids repeating the same prompt across multiple invocations
    • Ideal for CI/CD workflows and container initialization
  2. STRUCTKIT_INPUT_STORE (for --input-store / -n)

    • Allows users to set a consistent default location for input data
    • Useful for workflows that need persistent input across multiple runs
    • Currently defaults to /tmp/structkit/input.json
  3. STRUCTKIT_BACKUP_PATH (for --backup / -b)

    • Set a default backup location project-wide or environment-wide
    • Saves typing in repetitive operations
    • Useful for ensuring backups go to a specific location (e.g., mounted volume in containers)

Medium Priority

  1. STRUCTKIT_FILE_STRATEGY (for --file-strategy / -f)

    • Let users set a preferred default strategy (overwrite, skip, append, rename, backup)
    • Could prevent accidental data loss if set to 'skip' or 'backup' by default
  2. STRUCTKIT_NON_INTERACTIVE (for --non-interactive)

    • Boolean flag useful for CI/CD pipelines
    • Could be set in environment and applied across all commands
  3. STRUCTKIT_OUTPUT_MODE (for --output / -o)

    • Some users might prefer 'console' output by default
    • Useful for pipeline integration

Implementation Notes

  • Command-line arguments should take precedence over environment variables
  • The pattern from STRUCTKIT_LOG_LEVEL in structkit/main.py (lines 72-74) can serve as a reference
  • Consider adding environment variable hints to the help text for each argument

Priority Recommendation

Start with High Priority items (#1-3) as they provide the most value for typical use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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