Skip to content
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

add llm keys remove [name] command #475

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

harabat
Copy link

@harabat harabat commented Apr 26, 2024

These commits add the remove functionality to llm keys, add a test for that option, and update the relevant docs section.

Comment on lines +544 to +548
try:
current = json.loads(path.read_text())
except json.decoder.JSONDecodeError:
click.echo("Error reading keys file")
return

Choose a reason for hiding this comment

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

I think try could be ommited like in keys_list.

Comment on lines +549 to +551
if name not in current:
click.echo(f"Key '{name}' not found")
return

Choose a reason for hiding this comment

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

I think this should return error (useful for scripting).

if name not in current:
click.echo(f"Key '{name}' not found")
return
del current[name]

Choose a reason for hiding this comment

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

This maybe should check for special note key "// Note" like keys_list does.

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