Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [ main ]

jobs:
lint:
lint-ruff:
name: Lint (Ruff)
runs-on: ubuntu-latest
steps:
Expand All @@ -23,9 +23,25 @@ jobs:
- name: Run Ruff
run: ruff check .

lint-flake8:
name: Lint (Flake8)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run Flake8
run: flake8 .

test-linux:
name: Test (Linux)
needs: lint
needs: [lint-ruff, lint-flake8]
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -47,7 +63,7 @@ jobs:

test-windows:
name: Test (Windows)
needs: lint
needs: [lint-ruff, lint-flake8]
runs-on: windows-latest
strategy:
matrix:
Expand All @@ -69,7 +85,7 @@ jobs:

test-macos:
name: Test (macOS)
needs: lint
needs: [lint-ruff, lint-flake8]
runs-on: macos-latest
strategy:
matrix:
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pytest
ruff
flake8
build
twine
6 changes: 5 additions & 1 deletion shellmind/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ def _trim_history(messages: list[dict]) -> None:

def _direct_shell_command(text: str) -> str | None:
if text.startswith("!"):
return text[1:].strip()
cmd = text[1:].strip()
for prefix in ["shell ", "run "]:
if cmd.startswith(prefix):
return cmd[len(prefix):].strip()
return cmd

return None

Expand Down
Loading