Skip to content

Configuration

Every option is set in the plugin's entry in opencode.json:

{
  "plugins": [
    {
      "package": "github:we-the-rebel-alliance/slack-plugin#v0.0.5",
      "options": {
        "access": "ask-changes",
        "accounts": { "work": {}, "personal": {} },
        "oauth": { "client_id": "1234567890.1234567890" },
        "events": { "channels": ["C0123ABCD45"] }
      }
    }
  ]
}
Option Type Default Description
access all | ask-changes | read-only "all" How much the plugin's methods may do: everything, ask before changes, or reads only.
accounts object — One profile per account alias. Each alias is one Slack workspace with its own sign-in.
oauth object — The Slack app the sign-ins use. Set client_id here, or paste it in /connect under "Slack app client ID".
events object — What the workspace source reads when a call names no channels. A private channel's history needs groups:history, which is not a default scope.
allowUntestedHost boolean false Start outside the tested OpenCode range.

Nested options

Option Type Default Description
events.channels list of ids [] The channel and direct-message ids a read uses when its call names no scope. A private channel's history needs groups:history, which is not a default scope.
oauth.client_id string — The Slack app's client ID. The /connect "Slack app client ID" entry sets it otherwise.
oauth.client_secret string — Only for a Slack app without PKCE; prefer {env:SLACK_CLIENT_SECRET}.
oauth.redirect_uri string http://localhost:8765/callback A redirect URL registered on the app.
oauth.callback_port integer — The local port a proxy forwards an https: redirect to; set only with an https: redirect.
oauth.scopes list of scopes the plugin's default list The most Slack user scopes any sign-in may ask for.
oauth.auth_server_metadata_url string — An OAuth metadata document to read instead of Slack's.
accounts.<alias>.access read | write "write" What that alias's sign-in asks Slack for: Read-only or Read and write.
accounts.<alias>.scopes list of scopes the alias uses oauth.scopes The most user scopes that alias's sign-in may ask for.
accounts.<alias>.attribution boolean true Say in every message the plugin posts through that alias that an agent sent it, as a last line. Set it to false to turn the line off for that alias alone.

The Slack app

oauth.client_id is the app's client ID. Set it here for a managed configuration; otherwise leave it out and paste the ID in /connect under Slack app client ID. oauth.client_secret is only for a Slack app without PKCE, and should be {env:SLACK_CLIENT_SECRET} so the value stays out of the file. oauth.redirect_uri must be one of the app's redirect URLs: the loopback default http://localhost:8765/callback, or an https: address your proxy forwards to OpenCode, with oauth.callback_port naming the local port. oauth.scopes is the most a sign-in may ask for; a profile's own scopes list is that alias's ceiling.

The app's scopes must include every scope a sign-in asks for. The default list reads public and private messages, direct and group messages, the user's profile, and the searches the mentions source uses. It also holds the public and private channel write scopes (channels:write, groups:write) that create a channel, invite people to it and mark it read. It holds chat:write, which the actions use to post and delete, im:write, which slack.send uses to open a person's direct message, and files:write, which slack.send uses to share files. It deliberately leaves out groups:history.

Channels

events.channels is the list of ids a read uses when its call names no scope. A private channel's history needs groups:history, which is not a default scope: add it to the app and to oauth.scopes before reading a G… channel that is private. channels:write and groups:write are default: Slack's slack_create_conversation tool uses them to create a channel and invite people to it, channel_invite uses them to invite people to a channel that already exists, and mark_read uses them for a channel. A direct or group message marked read needs im:write or mpim:write, which are not default.

Access

The plugin's access is all (the default), ask-changes or read-only. It is the ceiling; no option widens it. A method's effect: deny is denied at every level, all included, until a later allow rule names it for one agent or tool. allowUntestedHost lets the plugin start outside >=2.4.1 <2.5.0; leave it off.

An account's access is the person's sign-in choice, separate from the plugin's access: read asks Slack for the read scopes only, and write (the default) asks for the read and write scopes. A host shows the choice and may preselect it; a sign_in shortfall's signIn answer carries the choice that would allow a missing scope.

Accounts

accounts maps an alias to a profile. An empty object is a valid profile; access is read or write, and scopes is the most that alias's sign-in may ask for instead of oauth.scopes. attribution is on unless it is false: every message the plugin posts through the alias then ends with _Sent by an agent on your behalf._, so a colleague reads who sent it. Turning it off is the alias's own explicit choice, and it is part of the account a grant names.