Skip to content

Commit 31e7824

Browse files
authored
Merge pull request #31 from AnswerDotAI/devin/1738701021-enhance-docs-and-tmux
feat: enhance tmux config and documentation
2 parents 7ddceed + 0bb94e5 commit 31e7824

File tree

3 files changed

+149
-2
lines changed

3 files changed

+149
-2
lines changed

.tmux.conf

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,36 @@ set -g status-right '#{pane_id} | %H:%M '
33
set-option -g alternate-screen off
44

55
set-window-option -g mode-keys vi
6+
7+
# Pane splitting (keep current path)
8+
bind-key / split-window -h -c "#{pane_current_path}"
9+
bind-key - split-window -v -c "#{pane_current_path}"
10+
11+
# Window management
12+
bind-key -n M-n new-window -c "#{pane_current_path}"
13+
bind-key -n M-1 select-window -t 1
14+
bind-key -n M-2 select-window -t 2
15+
bind-key -n M-3 select-window -t 3
16+
bind-key -n M-4 select-window -t 4
17+
bind-key -n M-5 select-window -t 5
18+
19+
# Pane navigation (vim-style)
20+
bind-key -n M-h select-pane -L
21+
bind-key -n M-j select-pane -D
22+
bind-key -n M-k select-pane -U
23+
bind-key -n M-l select-pane -R
24+
25+
# Pane resizing
26+
bind-key -n M-H resize-pane -L 5
27+
bind-key -n M-J resize-pane -D 5
28+
bind-key -n M-K resize-pane -U 5
29+
bind-key -n M-L resize-pane -R 5
30+
31+
# Session management
32+
bind-key -n M-s choose-session
33+
bind-key -n M-d detach-client
34+
35+
# Copy mode and search
636
bind-key / copy-mode\; send-key ?
737
bind-key -T copy-mode-vi y \
838
send-key -X start-of-line\; \
@@ -11,4 +41,6 @@ bind-key -T copy-mode-vi y \
1141
send-key -X cursor-left\; \
1242
send-key -X copy-selection-and-cancel\; \
1343
paste-buffer
44+
45+
# Clear history
1446
bind-key -n C-l send-keys C-l \; send-keys -R \; clear-history

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,60 @@ ssage --provider openai --model gpt-4o-mini "explain this error"
173173
ssage --history-lines 50 "what commands did I just run?"
174174
```
175175

176+
### Advanced Use Cases
177+
178+
#### Git Workflow Enhancement
179+
180+
``` sh
181+
# Review changes before commit
182+
git diff | ssage summarize these changes
183+
184+
# Get commit message suggestions
185+
git diff --staged | ssage suggest a commit message
186+
187+
# Analyze PR feedback
188+
gh pr view 123 | ssage summarize this PR feedback
189+
```
190+
191+
#### Log Analysis
192+
193+
``` sh
194+
# Quick error investigation
195+
journalctl -xe | ssage what's causing these errors?
196+
197+
# Apache/Nginx log analysis
198+
tail -n 100 /var/log/nginx/access.log | ssage analyze this traffic pattern
199+
200+
# System performance investigation
201+
top -b -n 1 | ssage explain system resource usage
202+
```
203+
204+
#### Docker Management
205+
206+
``` sh
207+
# Container troubleshooting
208+
docker logs my-container | ssage "what is wrong with this container?"
209+
210+
# Image optimization
211+
docker history my-image | ssage suggest optimization improvements
212+
213+
# Compose file analysis
214+
cat docker-compose.yml | ssage review this compose configuration
215+
```
216+
217+
#### Database Operations
218+
219+
``` sh
220+
# Query optimization
221+
psql -c "EXPLAIN ANALYZE SELECT..." | ssage optimize this query
222+
223+
# Schema review
224+
pg_dump --schema-only mydb | ssage review this database schema
225+
226+
# Index suggestions
227+
psql -c "\di+" | ssage suggest missing indexes
228+
```
229+
176230
## Tips & Best Practices
177231
178232
### Effective Usage Patterns

nbs/index.ipynb

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@
77
"source": [
88
"# ShellSage\n",
99
"\n",
10-
"> ShellSage saves sysadmins sanity by solving shell script snafus super swiftly\n",
10+
"> ShellSage saves sysadmins' sanity by solving shell script snafus super swiftly\n",
1111
"\n",
12-
"ShellSage is an AI-powered command-line assistant that integrates seamlessly with your terminal workflow through tmux. It provides contextual help for shell operations, making it easier to navigate complex command-line tasks, debug scripts, and manage your system."
12+
"ShellSage is an AI-powered command-line assistant that integrates seamlessly with your terminal workflow through tmux. It provides contextual help for shell operations, making it easier to navigate complex command-line tasks, debug scripts, and manage your system.\n",
13+
"\n",
14+
"[![PyPI version](https://badge.fury.io/py/shell-sage.svg)](https://badge.fury.io/py/shell-sage)\n",
15+
"[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)\n",
16+
"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n",
17+
"[![Documentation](https://img.shields.io/badge/docs-nbdev-blue.svg)](https://answerdotai.github.io/shell_sage/)"
1318
]
1419
},
1520
{
@@ -192,6 +197,62 @@
192197
"```"
193198
]
194199
},
200+
{
201+
"cell_type": "markdown",
202+
"id": "47d6bfb8",
203+
"metadata": {},
204+
"source": [
205+
"### Advanced Use Cases\n",
206+
"\n",
207+
"#### Git Workflow Enhancement\n",
208+
"```sh\n",
209+
"# Review changes before commit\n",
210+
"git diff | ssage summarize these changes\n",
211+
"\n",
212+
"# Get commit message suggestions\n",
213+
"git diff --staged | ssage suggest a commit message\n",
214+
"\n",
215+
"# Analyze PR feedback\n",
216+
"gh pr view 123 | ssage summarize this PR feedback\n",
217+
"```\n",
218+
"\n",
219+
"#### Log Analysis\n",
220+
"```sh\n",
221+
"# Quick error investigation\n",
222+
"journalctl -xe | ssage what's causing these errors?\n",
223+
"\n",
224+
"# Apache/Nginx log analysis\n",
225+
"tail -n 100 /var/log/nginx/access.log | ssage analyze this traffic pattern\n",
226+
"\n",
227+
"# System performance investigation\n",
228+
"top -b -n 1 | ssage explain system resource usage\n",
229+
"```\n",
230+
"\n",
231+
"#### Docker Management\n",
232+
"```sh\n",
233+
"# Container troubleshooting\n",
234+
"docker logs my-container | ssage \"what is wrong with this container?\"\n",
235+
"\n",
236+
"# Image optimization\n",
237+
"docker history my-image | ssage suggest optimization improvements\n",
238+
"\n",
239+
"# Compose file analysis\n",
240+
"cat docker-compose.yml | ssage review this compose configuration\n",
241+
"```\n",
242+
"\n",
243+
"#### Database Operations\n",
244+
"```sh\n",
245+
"# Query optimization\n",
246+
"psql -c \"EXPLAIN ANALYZE SELECT...\" | ssage optimize this query\n",
247+
"\n",
248+
"# Schema review\n",
249+
"pg_dump --schema-only mydb | ssage review this database schema\n",
250+
"\n",
251+
"# Index suggestions\n",
252+
"psql -c \"\\di+\" | ssage suggest missing indexes\n",
253+
"```"
254+
]
255+
},
195256
{
196257
"cell_type": "markdown",
197258
"id": "73adb8a7",

0 commit comments

Comments
 (0)