Skip to content

Commit 336c660

Browse files
committed
add edit config command
1 parent 43e0c45 commit 336c660

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,13 @@ Refer to the [Ollama docs](https://ollama.ai) for installation, available models
9797

9898
To use ShellOracle with OpenAI's models, create an [API key](https://platform.openai.com/account/api-keys). Edit
9999
your `~/.shelloracle/config.toml` to change your provider and enter your API key.
100+
You can use `shor config edit` as a shorthand to edit this file.
100101
101102
### Deepseek
102103
103104
To use ShellOracle with Deepseek's models, create an [API key](https://platform.deepseek.com/api_keys). Edit
104105
your `~/.shelloracle/config.toml` to change your provider and enter your API key.
106+
You can use `shor config edit` as a shorthand to edit this file.
105107

106108
### LocalAI
107109

@@ -111,17 +113,19 @@ Refer to the [LocalAI docs](https://localai.io/) for installation, available mod
111113

112114
To use ShellOracle with XAI's models, create an [API key](https://docs.x.ai/docs/quickstart#creating-an-api-key).
113115
Edit your `~/.shelloracle/config.toml` to change your provider and enter your API key.
116+
You can use `shor config edit` as a shorthand to edit this file.
114117
115118
### Google
116119
117120
To use ShellOracle with Google's models, create an [API key](https://aistudio.google.com/app/apikey).
118121
Edit your `~/.shelloracle/config.toml` to change your provider and enter your API key.
122+
You can use `shor config edit` as a shorthand to edit this file.
119123

120124
## Configuration
121125

122126
ShellOracle's configuration is your gateway to tailoring the utility to match your preferences and requirements.
123127
The `~/.shelloracle/config.toml` file serves as the control center for customizing various aspects of ShellOracle's
124-
behavior.
128+
behavior. You can quickly access and edit this file using the command `shor config edit`.
125129

126130
## System Requirements
127131

+2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import click
22

3+
from shelloracle.cli.config.edit import edit
34
from shelloracle.cli.config.init import init
45

56

67
@click.group()
78
def config(): ...
89

910

11+
config.add_command(edit)
1012
config.add_command(init)

src/shelloracle/cli/config/edit.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import click
2+
3+
from shelloracle.cli.application import Application
4+
5+
6+
@click.command()
7+
@click.pass_obj
8+
def edit(app: Application):
9+
"""Edit shelloracle configuration."""
10+
click.edit(filename=app.config_path)

0 commit comments

Comments
 (0)