Skip to content

Commit 5be9423

Browse files
authored
Merge pull request #56 from AnswerDotAI/lisette
Rewrite shell sage to use lisette
2 parents 461b7d7 + 41042d8 commit 5be9423

File tree

15 files changed

+1565
-1471
lines changed

15 files changed

+1565
-1471
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,4 @@ checklink/cookies.txt
151151

152152
# Quarto
153153
.quarto
154+
index_files/

.tmux.conf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,11 @@ bind-key -T copy-mode-vi y \
4444

4545
# Clear history
4646
bind-key -n C-l send-keys C-l \; send-keys -R \; clear-history
47+
48+
# Extract code block with prompt
49+
bind e command-prompt -p "Code block ID:" -I "0" '
50+
run-shell "
51+
blk=$(ssage_extract %%)
52+
tmux send-keys \"$blk\"
53+
"
54+
'

README.md

Lines changed: 500 additions & 170 deletions
Large diffs are not rendered by default.

nbs/00_core.ipynb

Lines changed: 301 additions & 483 deletions
Large diffs are not rendered by default.

nbs/01_config.ipynb

Lines changed: 8 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"id": "8d5eaf1e",
1616
"metadata": {},
1717
"source": [
18-
"# ShellSage Configuration"
18+
"# Configuration"
1919
]
2020
},
2121
{
@@ -37,9 +37,7 @@
3737
"from dataclasses import dataclass\n",
3838
"from fastcore.all import *\n",
3939
"from fastcore.xdg import *\n",
40-
"from typing import get_type_hints\n",
41-
"\n",
42-
"import claudette as cla, cosette as cos"
40+
"from typing import get_type_hints"
4341
]
4442
},
4543
{
@@ -74,7 +72,7 @@
7472
{
7573
"data": {
7674
"text/plain": [
77-
"Path('/Users/nathan/.config/shell_sage/shell_sage.conf')"
75+
"Path('/home/natedawg/.config/shell_sage/shell_sage.conf')"
7876
]
7977
},
8078
"execution_count": null,
@@ -86,54 +84,6 @@
8684
"_cfg_path()"
8785
]
8886
},
89-
{
90-
"cell_type": "code",
91-
"execution_count": null,
92-
"id": "25b71dc6",
93-
"metadata": {},
94-
"outputs": [],
95-
"source": [
96-
"#| export\n",
97-
"providers = { 'anthropic': cla.models, 'openai': cos.models}"
98-
]
99-
},
100-
{
101-
"cell_type": "code",
102-
"execution_count": null,
103-
"id": "d7c2100c",
104-
"metadata": {},
105-
"outputs": [
106-
{
107-
"data": {
108-
"text/plain": [
109-
"{'anthropic': ['claude-3-opus-20240229',\n",
110-
" 'claude-3-7-sonnet-20250219',\n",
111-
" 'claude-3-5-sonnet-20241022',\n",
112-
" 'claude-3-haiku-20240307',\n",
113-
" 'claude-3-5-haiku-20241022'],\n",
114-
" 'openai': ('o1-preview',\n",
115-
" 'o1-mini',\n",
116-
" 'gpt-4o',\n",
117-
" 'gpt-4o-mini',\n",
118-
" 'gpt-4-turbo',\n",
119-
" 'gpt-4',\n",
120-
" 'gpt-4-32k',\n",
121-
" 'gpt-3.5-turbo',\n",
122-
" 'gpt-3.5-turbo-instruct',\n",
123-
" 'o1',\n",
124-
" 'o3-mini',\n",
125-
" 'chatgpt-4o-latest')}"
126-
]
127-
},
128-
"execution_count": null,
129-
"metadata": {},
130-
"output_type": "execute_result"
131-
}
132-
],
133-
"source": [
134-
"providers"
135-
]
136-
},
13787
{
13888
"cell_type": "code",
13989
"execution_count": null,
@@ -144,10 +94,10 @@
14494
"#| export\n",
14595
"@dataclass\n",
14696
"class ShellSageConfig:\n",
147-
" provider: str = \"anthropic\"\n",
148-
" model: str = providers['anthropic'][1]\n",
97+
" model: str = 'claude-sonnet-4-5-20250929'\n",
98+
" search: str = ''\n",
14999
" mode: str = 'default'\n",
150-
" base_url: str = ''\n",
100+
" api_base: str = ''\n",
151101
" api_key: str = ''\n",
152102
" history_lines: int = -1\n",
153103
" code_theme: str = \"monokai\"\n",
@@ -164,7 +114,7 @@
164114
{
165115
"data": {
166116
"text/plain": [
167-
"ShellSageConfig(provider='anthropic', model='claude-3-7-sonnet-20250219', mode='default', base_url='', api_key='', history_lines=-1, code_theme='monokai', code_lexer='python', log=False)"
117+
"ShellSageConfig(model='claude-sonnet-4-5-20250929', search='', mode='default', api_base='', api_key='', history_lines=-1, code_theme='monokai', code_lexer='python', log=False)"
168118
]
169119
},
170120
"execution_count": null,
@@ -205,13 +155,7 @@
205155
]
206156
}
207157
],
208-
"metadata": {
209-
"kernelspec": {
210-
"display_name": "python3",
211-
"language": "python",
212-
"name": "python3"
213-
}
214-
},
158+
"metadata": {},
215159
"nbformat": 4,
216160
"nbformat_minor": 5
217161
}

0 commit comments

Comments
 (0)