Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/release ci #33

Merged
merged 2 commits into from
Sep 22, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
source: ./docs
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

`q-cli`は、[traQ](https://github.com/traQ)のWebhook機能を使ってtraQにテキストメッセージを送信するためのCLIツールです。

**このドキュメントはv0.2.2のものです。他のバージョンのドキュメントを確認したい場合は、GitHubの過去のリリースもしくは[「以前のバージョンのドキュメント」ページ](versions)を確認してください。**
**このドキュメントはv0.2.3のものです。他のバージョンのドキュメントを確認したい場合は、GitHubの過去のリリースもしくは[「以前のバージョンのドキュメント」ページ](versions)を確認してください。**

## 各コマンド

Expand All @@ -25,7 +25,7 @@ Webhook IDとWebhookシークレットが必要になります。
#### Go

```sh
go install github.com/ikura-hamu/q-cli@v0.2.2
go install github.com/ikura-hamu/q-cli@v0.2.3
```

`$GOPATH/bin`以下に`q-cli`という名前でインストールされます。
Expand All @@ -36,7 +36,7 @@ go install github.com/ikura-hamu/q-cli@v0.2.2
https://github.com/ikura-hamu/q-cli/releases

```sh
curl -OJL https://github.com/ikura-hamu/q-cli/releases/download/v0.2.2/q-cli_{OS}_{architecture}.(tar.gz|zip)
curl -OJL https://github.com/ikura-hamu/q-cli/releases/download/v0.2.3/q-cli_{OS}_{architecture}.(tar.gz|zip)
```

ダウンロードしたら解凍します。
Expand Down
86 changes: 86 additions & 0 deletions docs/v0.2.3/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# `q-cli`

`q-cli`は、[traQ](https://github.com/traQ)のWebhook機能を使ってtraQにテキストメッセージを送信するためのCLIツールです。

**このドキュメントはv0.2.3のものです。他のバージョンのドキュメントを確認したい場合は、GitHubの過去のリリースもしくは[「以前のバージョンのドキュメント」ページ](versions)を確認してください。**

## 各コマンド

- [`q`](q.md)
- [`q init`](q_init.md)

## Preparation

traQのWebhookをSecure形式で作成してください。
traPで使用しているtraQインスタンスで使用する場合は、bot-consoleから作成できます。
Webhook IDとWebhookシークレットが必要になります。

## Installation

1. [ダウンロード](#ダウンロード)
2. [Webhookの設定](#webhookの設定)

### ダウンロード

#### Go

```sh
go install github.com/ikura-hamu/q-cli@v0.2.3
```

`$GOPATH/bin`以下に`q-cli`という名前でインストールされます。

#### GitHub Release

リリースページから該当するOS、バージョンのものを探してダウンロードしてください。
https://github.com/ikura-hamu/q-cli/releases

```sh
curl -OJL https://github.com/ikura-hamu/q-cli/releases/download/v0.2.3/q-cli_{OS}_{architecture}.(tar.gz|zip)
```

ダウンロードしたら解凍します。

```sh
tar -zxvf q-cli_{OS}_{architecture}.tar.gz
```


```sh
unzip q-cli_{OS}_{architecture}.zip
```

など、適切な方法で解凍してください。

解凍して出てくる`q`というファイルが実行ファイルです。パスが通る場所に移動させてください。`README.md`が一緒に解凍されますが、削除して問題ありません。

### webhookの設定

環境変数を用いるか、設定ファイルを配置します。

#### 環境変数の場合

`Q_WEBHOOK_HOST`: traQのドメイン
`Q_WEBHOOK_ID`: traQのWebhook ID
`Q_WEBHOOK_SECRET`: traQのWebhook シークレット

#### 設定ファイルを使う場合

以下のような`~/.q-cli.yml`を用意します。

```json:.q-cli.yml
webhook_host: "{traQのドメイン}"
webhook_id: "{traQのWebhook ID}"
webhook_secret: "{traQのWebhookシークレット}"
channels:
channel: "{チャンネルのUUID}"
```

または、

```sh
q init
```

を実行することで、対話形式で設定を行えます。
38 changes: 38 additions & 0 deletions docs/v0.2.3/q.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## q

traQ Webhook CLI

### Synopsis

"q-cli" は、traQにWebhookを使ってメッセージを送信するためのCLIツールです。設定に基づいてWebhookを送信します。
設定は設定ファイルに記述するか、環境変数で指定することができます。
メッセージは標準入力からも受け取ることができます。
設定ファイルの場所は、何も指定しない場合、$HOME/.q-cli.yaml です。

```
q [message] [flags]
```

### Examples

```
q print("Hello, world!") -c -l py
```

### Options

```
-C, --channel string チャンネル名を指定して、デフォルト以外のチャンネルにメッセージを送信します。
チャンネル名は設定ファイルの channels に記述されたキーを指定します。
-c, --code コードブロック付きでメッセージを送信します。
--config string 設定ファイルの場所を指定します。 (デフォルトは $HOME/.q-cli.yaml)
-h, --help help for q
-l, --lang string コードブロックの言語を指定します。
-v, --version Print version information and quit
```

### SEE ALSO

* [q init](q_init.md) - Initialize the configuration file

###### Auto generated by spf13/cobra on 23-Sep-2024
30 changes: 30 additions & 0 deletions docs/v0.2.3/q_init.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## q init

Initialize the configuration file

### Synopsis

initコマンドは、設定ファイルの値を対話形式で設定することができます。

```
q init [flags]
```

### Options

```
-f, --force 既存の設定ファイルを上書きします
-h, --help help for init
```

### Options inherited from parent commands

```
--config string 設定ファイルの場所を指定します。 (デフォルトは $HOME/.q-cli.yaml)
```

### SEE ALSO

* [q](q.md) - traQ Webhook CLI

###### Auto generated by spf13/cobra on 23-Sep-2024
9 changes: 9 additions & 0 deletions docs/v0.2.3/versions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 以前のバージョンのドキュメント


- [v0.2.0](v0.2.0)

- [v0.2.1](v0.2.1)

- [v0.2.2](v0.2.2)

2 changes: 2 additions & 0 deletions docs/versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@

- [v0.2.1](v0.2.1)

- [v0.2.2](v0.2.2)