Skip to content

Remove alabaster-shellgenius and tighten key.env parsing#7

Merged
sderev merged 2 commits intomainfrom
remove-alabaster-shellgenius
Apr 13, 2026
Merged

Remove alabaster-shellgenius and tighten key.env parsing#7
sderev merged 2 commits intomainfrom
remove-alabaster-shellgenius

Conversation

@sderev
Copy link
Copy Markdown
Owner

@sderev sderev commented Apr 12, 2026

What changed

  • Remove the unsupported alabaster-shellgenius preset, its legacy fallback, and the hidden CLI aliases --plain, -p, and --command-only.
  • Tighten ~/.config/lmt/key.env parsing so ShellGenius accepts OPENAI_API_KEY=..., quoted values, and export OPENAI_API_KEY=..., while rejecting bare key lines and unrelated assignments.
  • Update README.md, regression tests, and changelog fragments for both user-facing changes.

Why

  • Keep the supported theme and CLI surface aligned with current behavior.
  • Stop treating arbitrary shell-style content in key.env as a valid API key source.

How to test

  • Run gate.
  • Manually run shellgenius --raw "show the current git branch", shellgenius --rich "show the current git branch", and shellgenius --cmd "show the current git branch" to confirm the supported output options still work and the removed hidden aliases are gone.
  • Put valid and invalid lines in ~/.config/lmt/key.env to verify accepted OPENAI_API_KEY forms still load and malformed content is rejected.

Risk/comp notes

  • Removes undocumented aliases and the unsupported alabaster-shellgenius preset.
  • Users with malformed or unrelated entries in key.env must switch to explicit OPENAI_API_KEY=... syntax.

Changelog fragment: yes (and why)

  • Yes. Both commits change user-visible CLI or configuration behavior, so the fragments belong in this PR.

sderev and others added 2 commits April 12, 2026 02:59
* drop the unsupported `alabaster-shellgenius` preset and legacy fallback
* remove hidden `--plain`, `-p`, and `--command-only` aliases in favor of `--raw` and `--cmd`
* keep shared `~/.config/lmt/...` behavior and default prompt routing intact
* update tests and the changelog note for the retrocompat cleanup

Co-authored-by: AI <ai@sderev.com>
* Parse `~/.config/lmt/key.env` as a dedicated ShellGenius key file
* Keep `OPENAI_API_KEY=...`, quoted values, and `export OPENAI_API_KEY=...`
* Reject bare key lines and unrelated assignments, with tests and a changelog fragment

Co-authored-by: AI <ai@sderev.com>
@sderev
Copy link
Copy Markdown
Owner Author

sderev commented Apr 13, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6135b698e2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread shellgenius/api_key.py Outdated
Comment on lines +39 to +43
if line.startswith("export OPENAI_API_KEY="):
value = line[len("export OPENAI_API_KEY=") :]
elif line.startswith("OPENAI_API_KEY="):
value = line[len("OPENAI_API_KEY=") :]
# Strip optional surrounding quotes.
if len(value) >= 2 and value[0] == value[-1] and value[0] in ("'", '"'):
value = value[1:-1]
return value.strip()

if line == "OPENAI_API_KEY":
saw_other_content = True
continue

if "=" in line:
saw_other_content = True
continue

if bare_key or saw_other_content:
saw_other_content = True
continue
else:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow flexible whitespace after export in key.env

The new parser only accepts lines starting with the exact prefix export OPENAI_API_KEY=, so valid shell-style exports like export OPENAI_API_KEY=... or export\tOPENAI_API_KEY=... are now rejected and the key resolves to empty. This is a regression from the previous behavior and can silently break existing ~/.config/lmt/key.env files that include extra spacing while still being semantically the same assignment.

Useful? React with 👍 / 👎.

@sderev
Copy link
Copy Markdown
Owner Author

sderev commented Apr 13, 2026

@codex review

@sderev sderev force-pushed the remove-alabaster-shellgenius branch from 6135b69 to f52e7d1 Compare April 13, 2026 17:58
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sderev sderev merged commit f52e7d1 into main Apr 13, 2026
6 checks passed
@sderev sderev deleted the remove-alabaster-shellgenius branch April 13, 2026 21:49
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.

1 participant