1
0
Files
shell/README.md

67 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# aishell
aiosのシェル。OSの起動と同時に起動し、AIとの対話がデフォルトのインターフェースになる。
## コンセプト
従来のOS: 起動 → shell → 人間がコマンドを打つ
aios: 起動 → aishell → 人間はAIと会話する
aishellはshellの置き換えではない。shellを内包したAIインターフェース。
## UI
画面は上下に分割される。
```
┌─────────────────────────────────┐
│ [上] shell │
│ $ pacman -Syu │
│ :: Synchronizing package... │
│ ... │
│ │
├─────────────────────────────────┤
│ [下] ai │
│ > macbookのフリーズの原因を調べて │
│ │
│ アイね、dmesgとjournalctlを │
│ 確認してみるね。 │
│ │
└─────────────────────────────────┘
```
## 入力の振り分け
入力は一つ。enterを押した時に
1. **有効なコマンドの場合** → 上のshellで実行される。下のAI入力バッファは取り消される
2. **有効なコマンドでない場合** → 下のAIに送信される
入力中のテキストはリアルタイムで下のAIバッファにも表示される。ユーザーは「コマンドを打っているのか、AIに話しかけているのか」を意識する必要がない。
## 判定ロジック
コマンド判定の基準:
- PATH上に存在する実行可能ファイルと一致するか
- shell builtin (cd, export, alias等) と一致するか
- パイプ (|)、リダイレクト (>, >>)、変数代入 (=) を含むか
上記に該当しなければAIへの入力として扱う。
## 技術スタック
- Rust
- Claude API (MCPまたは直接)
- PTY制御 (上のshell)
- TUIフレームワーク (ratatui等)
## aiosとの統合
```
aios起動 → systemd → aishell (login shell)
├── [上] shell (PTY)
└── [下] AI (Claude API + core.md + memory.md)
```
aishellはaiosのエントリーポイント。起動した瞬間からAIが使える状態になる。