Skip to content

Commit e157cb2

Browse files
committed
add config show command
1 parent be82f63 commit e157cb2

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ dependencies = [
3737
"yaspin~=3.1",
3838
"tomlkit~=0.13",
3939
"google-generativeai~=0.8",
40+
"pygments~=2.19",
4041
]
4142

4243
[dependency-groups]

src/shelloracle/cli/config/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from shelloracle.cli.config.edit import edit
44
from shelloracle.cli.config.init import init
5+
from shelloracle.cli.config.show import show
56

67

78
@click.group()
@@ -10,3 +11,4 @@ def config(): ...
1011

1112
config.add_command(edit)
1213
config.add_command(init)
14+
config.add_command(show)

src/shelloracle/cli/config/show.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import click
2+
import pygments
3+
from prompt_toolkit import print_formatted_text
4+
from prompt_toolkit.formatted_text import PygmentsTokens
5+
from pygments.lexers import TOMLLexer
6+
7+
from shelloracle.cli.application import Application
8+
9+
10+
@click.command()
11+
@click.pass_obj
12+
def show(app: Application):
13+
"""Display shelloracle configuration."""
14+
with app.config_path.open("r") as f:
15+
tokens = list(pygments.lex(f.read(), lexer=TOMLLexer()))
16+
print_formatted_text(PygmentsTokens(tokens))

uv.lock

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)