https://github.com/gw31415/bots
Universal bot I/O using proto
https://github.com/gw31415/bots
bot proto
Last synced: 6 months ago
JSON representation
Universal bot I/O using proto
- Host: GitHub
- URL: https://github.com/gw31415/bots
- Owner: gw31415
- License: agpl-3.0
- Archived: true
- Created: 2020-07-24T12:33:47.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-22T15:24:15.000Z (over 4 years ago)
- Last Synced: 2025-03-25T06:02:16.939Z (7 months ago)
- Topics: bot, proto
- Language: Go
- Homepage:
- Size: 165 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bots
## コンセプト
* プラットフォームによらないコマンドハンドラ
* 開発言語によらず開発できるコマンド群
* コマンドハンドラ毎に設定できる出力デザイン
* 集団および分散開発のしやすさ
* 他者の開発したコマンドの導入のしやすさ## 仕様
### コマンドハンドラ
1. あるただ一つの特定のディレクトリを読みこむ. それを読みこみディレクトリとする.
2. 読みこみディレクトリ直下に読みこまれる全てのコマンドが置かれる.
3. 読みこみディレクトリにはコマンドの他のファイルを配置しない.
4. ある特定のコマンドを呼びだす操作は, 引数なしで呼びだすコマンドを実行することによって行なわれる.
5. ある特定のコマンドのヘルプを呼びだす操作は, ただひとつの引数 `--help` または `-h` で呼びだすコマンドを実行することによって行なわれる.
6. コマンドのヘルプは, [proto/help.proto](https://github.com/gw31415/bots/blob/master/proto/help.proto) に基づきシリアライズされている.
7. コマンドへの入力は, コマンドの実行中に標準入力に書きこむ.
8. コマンドの入力は [proto/cmdin.proto](https://github.com/gw31415/bots/blob/master/proto/cmdin.proto) に基づきシリアライズされている.
9. コマンドの出力は, コマンドの実行中に標準出力から読みこむ.
10. コマンドの出力は [proto/cmdout.proto](https://github.com/gw31415/bots/blob/master/proto/cmdout.proto) に基づきシリアライズされている.### コマンド
1. 実行ファイル, またはそのシンボリックリンク, またはその実行ファイルの入ったディレクトリとする.
2. コマンドのファイル名(ディレクトリ名)はコマンド名とする. ディレクトリの場合はディレクトリの直下に最初に起動する実行ファイルを, ファイル名をコマンド名にして配置しておく.
3. コマンド名の全体は `\w+` に適合する.
4. コマンドの通常動作は引数なしで呼びだされると行なわれる.
5. コマンドのヘルプを呼びだす操作は, ただひとつの引数 `--help` または `-h` で呼びだすコマンドを実行することによって行なわれる.
6. コマンドのヘルプは, [proto/help.proto](https://github.com/gw31415/bots/blob/master/proto/help.proto) に基づきシリアライズされている.
7. コマンドへの入力は, コマンドの実行中に標準入力に書きこむ.
8. コマンドの入力は [proto/cmdin.proto](https://github.com/gw31415/bots/blob/master/proto/cmdin.proto) に基づきシリアライズされている.
9. コマンドの出力は, コマンドの実行中に標準出力から読みこむ.
10. コマンドの出力は [proto/cmdout.proto](https://github.com/gw31415/bots/blob/master/proto/cmdout.proto) に基づきシリアライズされている.