Skip to main content

Discord to tmux session bridge for agent-driven workflows.

Project description

tetherly icon

tetherly

Discord channel ↔ tmux session bridge.

📖 Documentation is in docs/ — split into user docs (setup, commands, troubleshooting) and contributing docs (internals). This README is a quick start.

Features

  • /bind session:<name>: bind the current Discord channel to a tmux session
  • /config auto_send:<true|false>: enable or disable plain-text auto-send for the current bound channel
  • /send text:<message>: send text plus Enter into the bound tmux session
  • /key key:<Enter|Escape|Ctrl-C|Ctrl-D|Tab|Up|Down|Left|Right>: send a special key into the bound tmux session
  • /tail lines:<n>: fetch recent tmux output
  • /status: inspect the current binding and tmux session status
  • tetherly discord-send --message <text>: let an agent inside a bound tmux session send a reply back to Discord
  • tetherly codex-stop / tetherly codex-permission-request: Codex hook handlers that forward messages to the bound Discord channel

Requirements

  • Python 3.11+
  • tmux installed
  • A Discord bot token (Message Content Intent enabled if you want plain-text auto-send)

Setup

Install once on your machine:

pipx install tetherly
tetherly init

tetherly init is interactive. It writes ~/.tetherly/.env and asks where to install Codex hooks:

  • Global — writes ~/.codex/hooks.json once. Hooks fire in every project automatically; nothing per-project.
  • Project — skip global hooks and run tetherly install-hooks inside each project where you want them.
  • Skip — don't touch Codex hooks.

Then start the bot:

tetherly

That's it. State lives at ~/.tetherly/state.json so a single bot can serve every project.

Per-project usage

For each project you want to drive from Discord:

tmux new -s <session-name>
# inside the bound channel on Discord:
#   /bind session:<session-name>
#   /config auto_send:true

If you chose Project mode during init, also run once per project:

cd <project>
tetherly install-hooks

install-hooks accepts --global to (re)install user-level hooks instead.

Sending from inside a session

tetherly discord-send --message "작업 끝났습니다"
cat result.txt | tetherly discord-send --stdin
tetherly discord-send --session t1 --message "..."   # explicit session

Configuration

tetherly init writes everything you need. Advanced overrides live in ~/.tetherly/.env or shell env:

Variable Default Notes
DISCORD_BOT_TOKEN (required) Bot token
TETHERLY_ALLOWED_USER_IDS (required) Comma-separated user IDs
TETHERLY_ALLOWED_GUILD_IDS Restrict commands to these guilds
TETHERLY_ALLOWED_ROLE_IDS Allow members holding any of these roles
TETHERLY_TEST_GUILD_ID Dev guild for instant slash-command sync
TETHERLY_STATE_PATH ~/.tetherly/state.json Where bindings are persisted
TETHERLY_DEFAULT_TAIL_LINES 40 Default /tail line count
TETHERLY_MAX_TAIL_LINES 200 Cap for /tail
TETHERLY_LOG_LEVEL INFO Logger verbosity

A .env in the current working directory still overrides ~/.tetherly/.env.

Codex hooks

Both hooks only fire when the active tmux session has TETHERLY_NOTIFY_ON_FINISH=1/bind sets that flag automatically, so projects without a binding stay silent even when global hooks are installed.

  • Stoptetherly codex-stop forwards last_assistant_message to the bound channel.
  • PermissionRequesttetherly codex-permission-request forwards the tool/command/reason. It does not return an allow/deny decision, so Codex's normal approval prompt still appears.

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

tetherly-0.1.0.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

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

tetherly-0.1.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file tetherly-0.1.0.tar.gz.

File metadata

  • Download URL: tetherly-0.1.0.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for tetherly-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7b747f71010a91f2ddc4286f5ccd73988d9f5a726fa436aa0b644a1f6fd3e364
MD5 f19739247b414a1272039de4e59ec693
BLAKE2b-256 21759ced8fcee06b5230f308d69b6f63b2b2950186ec77f0f6e0b707c3e6a177

See more details on using hashes here.

File details

Details for the file tetherly-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tetherly-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for tetherly-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d517256b1a1df15b3c9b0d392a47acbb7427f9b3b9e27f20fa98931eb530d2e4
MD5 4ff5a5e3f74ec528b7c31836a143912c
BLAKE2b-256 87fd8459eece7e12263f79a83c43ae5b5ac4a96e3dad6278282dafcf991471ee

See more details on using hashes here.

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