{"id":13872536,"url":"https://github.com/norio-nomura/cli_discord_bot","last_synced_at":"2025-07-07T17:40:26.140Z","repository":{"id":46533362,"uuid":"406597300","full_name":"norio-nomura/cli_discord_bot","owner":"norio-nomura","description":"CLI Discord Bot","archived":false,"fork":false,"pushed_at":"2023-02-12T07:45:15.000Z","size":191,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T14:40:18.701Z","etag":null,"topics":["deno","discord-bot","docker","hacktoberfest","heroku","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/norio-nomura.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-09-15T03:12:39.000Z","updated_at":"2023-02-09T12:21:30.000Z","dependencies_parsed_at":"2023-02-14T14:50:19.550Z","dependency_job_id":null,"html_url":"https://github.com/norio-nomura/cli_discord_bot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/norio-nomura%2Fcli_discord_bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/norio-nomura%2Fcli_discord_bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/norio-nomura%2Fcli_discord_bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/norio-nomura%2Fcli_discord_bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/norio-nomura","download_url":"https://codeload.github.com/norio-nomura/cli_discord_bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248255721,"owners_count":21073370,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deno","discord-bot","docker","hacktoberfest","heroku","typescript"],"created_at":"2024-08-05T23:00:45.217Z","updated_at":"2025-07-07T17:40:26.134Z","avatar_url":"https://github.com/norio-nomura.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# CLI Discord Bot\n\n\u003e ⚠️ **This repository has been archived. Please use [cli_discord_bot2](https://github.com/norio-nomura/cli_discord_bot2) from now on. CLI Discord Bot is deprecated and will no longer be maintained.**\n\nWritten in [Deno](https://deno.land) and deployed with Docker.\n\nThis is a generalized version of [SwiftCompilerDiscordappBot](https://github.com/norio-nomura/SwiftCompilerDiscordappBot) that can be used with various CLIs by configuration.\n\n## How to use\n\n1. Set Up Bot Account\n\n   [Creating a discord bot \u0026 getting a token](https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-\u0026-getting-a-token)\n\n   Required Permissions:\n\n   - `CHANGE_NICKNAME` for update nickname\n   - `READ_MESSAGE_HISTORY` and `VIEW_CHANNEL` for update replies on updating\n     request from user\n\n2. Invite Bot to Your Guild\n\n   Open following URL with changing `\u003cClient ID\u003e` to your bot's Client ID:\n   `https://discord.com/api/oauth2/authorize?client_id=\u003cClient ID\u003e\u0026scope=bot\u0026permissions=67174400`\n\n3. Run bot on local host using `docker compose`\n   ```terminal.sh-session\n   export DISCORD_TOKEN=\"\u003cdiscord token here\u003e\" # discord token\n   docker compose up\n   ```\n\n4. Send mention to Bot\n\n   - The bot will use the first code block as its standard input.\n   - The bot will treat the mentioned lines as arguments for CLI command lines.\n   - The bot will run the CLI for each command line and return them in replies.\n   - When you edit/delete a mention, the bot will also edit/delete its replies.\n   - The bot will reply in DM channel without mentions.\n\n   ![screenshot](screenshot.png)\n\n## Configuration\n\n### Build time configuration\n\n| Variable Name  | Description                                | default       |\n| -------------- | ------------------------------------------ | ------------- |\n| `DOCKER_IMAGE` | Docker image that provides swift on ubuntu | ubuntu:latest |\n\n### Environment variables for run time configurations\n\n| Variable Name              | Description                           | default            |\n| -------------------------- | ------------------------------------- | ------------------ |\n| `DISCORD_TOKEN`            | Discord Bot's token                   |                    |\n| `DISCORD_NICKNAME`         | Discord Nickname                      | `TARGET_CLI` value |\n| `DISCORD_PLAYING`          | status for \"Playing\"                  | `TARGET_CLI` value |\n| `ENV_COMMAND`              | Env command launching Timeout command | `/usr/bin/env`     |\n| `ENV_ARGS`                 | arguments for Env command             | `-i`               |\n| `TARGET_CLI`               | target CLI                            | `cat`              |\n| `TARGET_ARGS_TO_USE_STDIN` | arguments for CLI with input          |                    |\n| `TARGET_DEFAULT_ARGS`      | arguments for CLI with no arguments   |                    |\n| `TIMEOUT_COMMAND`          | Timeout command launching target CLI  | `timeout`          |\n| `TIMEOUT_ARGS`             | arguments for timeout command         | `--signal=KILL 30` |\n\n### Examples\n\n#### swift 5.4 compiler bot:\n\n```terminal.sh-session\nexport DISCORD_TOKEN=\"\u003cdiscord token here\u003e\" # discord token\nexport DOCKER_IMAGE=swift:latest            # docker image\nexport TARGET_CLI=swift                     # target cli\nexport TARGET_ARGS_TO_USE_STDIN=-           # swift requires \"-\" to use stdin as code\ndocker compose up\n```\n\n#### jq bot:\n\n```terminal.sh-session\nexport DISCORD_TOKEN=\"\u003cdiscord token here\u003e\" # discord token\nexport DOCKER_IMAGE=stedolan/jq:latest      # docker image\nexport TARGET_CLI=jq                        # target cli\ndocker-compose up\n```\n\n## Author\n\nNorio Nomura\n\n## License\n\nCLI Discord Bot is available under the MIT license. See the LICENSE file for\nmore info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnorio-nomura%2Fcli_discord_bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnorio-nomura%2Fcli_discord_bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnorio-nomura%2Fcli_discord_bot/lists"}