Skip to main content

Control AI coding agents from your phone via Discord

Project description

discoder

English

AIコーディングエージェント(Claude Code等)をスマホからDiscord経由で操作するツール。

discoder demo

特徴

  • Discordスレッド = セッション。スマホからコーディング指示が出せる
  • ターミナル↔Discord間でセッションの双方向引き継ぎ
  • ストリーミング応答(途中経過がリアルタイム表示、ツール実行状況も表示)
  • 返信候補ボタン(応答ごとに次のアクション候補をボタンで提示)
  • ポート開放不要(Discord Gateway、外向き接続のみ)
  • tmuxで常駐させるだけのシンプル運用

セットアップ

1. Discord Bot作成

1-1. アプリケーション作成

  1. Discord Developer Portal を開く
  2. 右上の「New Application」→ 名前を入力(例: discoder)→「Create」

1-2. Botトークン取得

  1. 左メニュー「Bot」を開く
  2. 「Reset Token」→ 表示されたトークンをコピーして控えておく(後で使う)
  3. 下にスクロールし「MESSAGE CONTENT INTENT」を ON にして「Save Changes」

1-3. 招待URLの生成

  1. 左メニュー「OAuth2」→「URL Generator」を開く
  2. SCOPES で以下にチェック:
    • bot
    • applications.commands
  3. 下に表示される BOTの権限 で以下にチェック:
    • メッセージを送信 (Send Messages)
    • 公開スレッドを作成 (Create Public Threads)
    • Threadsでメッセージを送る (Send Messages in Threads)
    • メッセージ履歴を読む (Read Message History)
  4. ページ最下部に生成されたURLをコピー

1-4. サーバーに招待

  1. コピーしたURLをブラウザで開く
  2. 「サーバーに追加」のドロップダウンから招待先のサーバーを選択
  3. 「はい」→「認証」で完了

Tips: Botを追加するにはそのサーバーの「サーバー管理」権限が必要です。自分専用のサーバーがなければ、Discordアプリの左下「+」→「オリジナルの作成」で無料で作れます。

2. インストール・起動

pip install discoder
discoder init     # 1-2で控えたBotトークンを入力
discoder start    # Bot起動(tmux内で実行推奨)

バックエンド切り替え(Codex対応)

デフォルトはClaude Codeバックエンドです。OpenAI Codex CLIを使う場合:

discoder start --backend codex   # Codexバックエンドで起動
discoder set-backend codex       # デフォルトをCodexに変更

開発版を使いたい場合:

git clone https://github.com/fuumin621/discoder.git
cd discoder
pip install -e .

使い方

Discordコマンド

コマンド 場所 説明
/new <prompt> チャンネル 新規セッション作成(--dir /path でディレクトリ指定可)
/resume [session_id] チャンネル セッション引き継ぎ(ID省略で直近セッション)
/sessions どこでも アクティブセッション一覧
/handoff スレッド ターミナル引き継ぎ用のセッションIDとコマンドを表示
/compact スレッド コンテキスト圧縮
/model スレッド モデル切替(opus / sonnet / haiku)
/cost スレッド セッションコスト表示
/stop スレッド 実行中のタスクを中断
/clear どこでも 全セッション情報をクリア

スレッド内は返信するだけで会話が継続します。

セッション引き継ぎ

ターミナル → Discord(スマホで続きをやりたい時)

スマホでDiscordを開いて /resume するだけ。直近のターミナルセッションが引き継がれます。

Discord → ターミナル(PCに戻った時)

PCに戻ったらターミナルで claude --continue を実行するだけ。直近のセッション(=Discordで使っていたセッション)が再開されます。

cd /your/project && claude --continue

別のセッションを間に挟んだ場合など、特定セッションを再開したい時はスレッド内で /handoff → 表示されたコマンドをターミナルで実行。

CLIコマンド

コマンド 説明
discoder init Botトークンの初期設定
discoder start Discord Bot起動(常駐)
discoder start --backend codex Codexバックエンドで起動
discoder set-backend <name> デフォルトバックエンドを変更(claude / codex)

注意事項

  • 権限チェックは常にスキップされます。 Claude Codeでは --dangerously-skip-permissions、Codexでは --dangerously-bypass-approvals-and-sandbox が有効です。全ツール(ファイル編集、任意コマンド実行等)が確認なしで実行されます。Discordサーバーへのアクセス権 ≒ マシンの操作権限となるため、信頼できるメンバーだけのサーバーで使ってください
  • タイムアウトは15分です。 それを超えるとセッションが中断されます。長時間かかる処理(推論実行等)はtmux経由で実行するようプロンプトで指示してください
  • 画像・ファイルの添付には対応していません。 テキストメッセージのみ処理されます
  • メッセージはキューイングされます。 応答中に次のメッセージを送った場合、前の処理が完了してから順番に実行されます

動作要件

  • Python 3.10+
  • 以下のいずれか(使用するバックエンドに応じて):
    • Claude Code CLI(claude コマンドがPATHに通っていて、API認証済みであること)
    • Codex CLI(codex コマンドがPATHに通っていて、認証済みであること)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

discoder-0.2.2.tar.gz (105.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

discoder-0.2.2-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file discoder-0.2.2.tar.gz.

File metadata

  • Download URL: discoder-0.2.2.tar.gz
  • Upload date:
  • Size: 105.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for discoder-0.2.2.tar.gz
Algorithm Hash digest
SHA256 650a5d2479d5c4cb7db08f3046576e38e9532d87d194c4888b05cdb41a4f5b10
MD5 6d61adaaaa025b2fa17749d152b1a7ca
BLAKE2b-256 10dc8dbdd93b1d5c550284ad5acd7d6dbf34cb72b3516e7fbb7f92fdda474b84

See more details on using hashes here.

Provenance

The following attestation bundles were made for discoder-0.2.2.tar.gz:

Publisher: publish.yml on fuumin621/discoder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file discoder-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: discoder-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for discoder-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8de5a7100c1b14cf7e843cbefa0a284b7ca2f85d1cb2985d5e1c1d0406f735be
MD5 0ce7f915fdd3e0d53fd10c034b3c18e8
BLAKE2b-256 6c34679b4ae7615c6e9448bb8e94fa3a27e5cbd2b113078fbe2395b97607fca4

See more details on using hashes here.

Provenance

The following attestation bundles were made for discoder-0.2.2-py3-none-any.whl:

Publisher: publish.yml on fuumin621/discoder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page