Repository navigation
Conversation
New darwin package + universal module. The CLI finds every Slack
channel named devopsinc-N (N >= 1000) that you're in, via
users.conversations, and leaves each one with conversations.leave. This
replaces the AppleScript that drove Slack.app's Cmd+K switcher, which
needed channel numbers by hand, a focused Slack window and Accessibility
permission.
- pkgs/slack-leave-devopsinc.{sh,nix}: writeShellApplication (curl, jq).
It reads a Slack user token from $SLACK_LEAVE_TOKEN or the login
Keychain item "slack-leave-devopsinc". curl --retry handles 429s. The
package also ships "Leave devopsinc Channels.app", an LSUIElement
bundle whose executable is a makeBinaryWrapper around the CLI with
--notify, which reports the result as a macOS notification.
- modules/darwin/slack-leave-devopsinc.nix: adds the package to
environment.systemPackages on all Macs. Only systemPackages apps are
copied into /Applications/Nix Apps, where Spotlight indexes them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PZ3r25VNh276wrx6Z1GwRS
Package and module catalog docs; a decision record covering why the PagerDuty incident channels are left via the Slack Web API (Keychain user token, Spotlight .app with a binary-wrapper executable, systemPackages for /Applications/Nix Apps) rather than the keystroke-driven AppleScript; log entries in the packages/modules/decisions bundles; regenerated indexes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PZ3r25VNh276wrx6Z1GwRS
Resolves the knowledge/modules/log.md conflict: both sides added 2026-10-02 entries; kept main's two noctalia/nh updates and this branch's slack-leave-devopsinc creation under the same date heading. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PZ3r25VNh276wrx6Z1GwRS
kriswill
marked this pull request as ready for review
October 5, 2026 17:00
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (15)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the keystroke-driven
leave-devopsinc.applescriptwith a Slack Web API tool you can launch from Spotlight. It finds the channels by itself, so you don't type channel numbers, Slack doesn't need focus, and no Accessibility permission is required.pkgs/slack-leave-devopsinc.{sh,nix}: awriteShellApplication(curl, jq). It pages throughusers.conversations(public and private channels, archived ones excluded), keeps names matchingdevopsinc-<digits>with N ≥ 1000 (the same guard as the original script), and callsconversations.leaveon each. If one channel fails (e.g.last_member), it reports that and carries on; exit status is 1 at the end.curl --retry 5waits out 429s usingRetry-After. Flags:-n/--dry-run,--notify.xoxp-…) from$SLACK_LEAVE_TOKEN, or else the login Keychain itemslack-leave-devopsinc. It is passed to curl viaprintf | curl --config -, the same way cbissue does it, so it never appears in argv.Applications/Leave devopsinc Channels.app. It's anLSUIElementbundle (no Dock icon) whose executable is amakeBinaryWrapperthat runs the CLI with--notify, so the result shows up as a macOS notification.modules/darwin/slack-leave-devopsinc.nix: universal (all Macs). It usesenvironment.systemPackagesbecause nix-darwin only copies systemPackages apps into/Applications/Nix Apps, which Spotlight indexes.modules/packages.nix(aarch64-darwin guard) andoverlays/+modules/overlays.nix.decisions/slack-leave-devopsinc-api.md), and log entries.okf validatepasses with 0 errors and 0 warnings.One-time setup (per Mac)
channels:read,groups:read,channels:write,groups:write. Install it (or "Request to Install" if the workspace needs admin approval) and copy the User OAuth Token (xoxp-…).security add-generic-password -U -a "$USER" -s slack-leave-devopsinc -w(paste the token at the prompt).slack-leave-devopsinc -nfor a dry run, or open Spotlight and run "Leave devopsinc Channels".Test plan
writeShellApplication's build-time checkInfo.plist, binary wrapper (--notify) and thebin/link all look right.devopsinc-999,devopsinc-abc,devopsinc-1500-oldandgeneral; alast_memberfailure is reported and the other leaves still go through (exit 1);missing_scopenames the scope it needs; no-matches exits 0; a missing token and a curl transport failure both fail cleanly; notifications fire only with--notify, with the message passed as an argv item.limitagainst Slack's OpenAPI spec.users.conversationsis sent as GET (-G), as the spec lists it.darwin-kbuild (the first real darwin build of the package) andnixos-nebula: greenk): Slack app created from a manifest with the four user scopes and installed after admin approval; token stored in the Keychain;nrsrebuild put the CLI on PATH and the app in/Applications/Nix Apps-nlisted 43devopsinc-Nchannels (1473 to 1520) and nothing else; the real run left all 43 with no failures; a dry run afterwards reports none lefthttps://claude.ai/code/session_01PZ3r25VNh276wrx6Z1GwRS
Summary by CodeRabbit
devopsinc-1000and higher Slack channels.