@gugu910/pi-slack-api
Typed Slack Web API client and CLI generated from Slack's OpenAPI spec
Package details
Install @gugu910/pi-slack-api from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@gugu910/pi-slack-api- Package
@gugu910/pi-slack-api- Version
0.1.0- Published
- Apr 7, 2026
- Downloads
- 83/mo · 5/wk
- Author
- gugu910
- License
- UNLICENSED
- Types
- package
- Size
- 236.7 KB
- Dependencies
- 2 dependencies · 0 peers
Pi manifest JSON
{}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
slack-api
Typed Slack Web API client + CLI generated from Slack's OpenAPI spec with
@hey-api/openapi-ts.
What it includes
generated/— generated type-safe Slack Web API SDKcli.ts— CLI wrapper for calling generated SDK methodsscripts/generate.ts— re-downloads the Slack spec and regenerates the client
Regenerate the client
pnpm --filter @gugu910/pi-slack-api run generate
The generator currently tries these sources in order:
- Official Slack GitHub spec
https://raw.githubusercontent.com/slackapi/slack-api-specs/master/web-api/slack_web_openapi_v2.json
- Community fallback
https://raw.githubusercontent.com/api-evangelist/slack/main/openapi/slack-web-api-openapi.yml
CLI usage
List all generated Slack methods:
pnpm --filter @gugu910/pi-slack-api exec node --experimental-strip-types cli.ts list
Call a method with repeated key/value params:
pnpm --filter @gugu910/pi-slack-api exec node --experimental-strip-types cli.ts conversations.list \
--token "$SLACK_TOKEN" \
--param limit=50
Call a method with JSON input:
pnpm --filter @gugu910/pi-slack-api exec node --experimental-strip-types cli.ts chat.postMessage \
--token "$SLACK_TOKEN" \
--input '{"channel":"C123","text":"hello from slack-api"}'
Or use the package-local bin wrapper directly:
cd slack-api
./bin/slack-api auth.test --token "$SLACK_TOKEN"
Notes
- The CLI accepts Slack method names like
auth.testandchat.postMessage. - Flat
--paramand--inputfields are automatically routed intoheaders,query,path, orbodybased on the OpenAPI parameter location for the selected method. --tokenis injected astokenwhen the method input does not already define one, then routed to the correct request section.- If you need an escape hatch, you can pass explicit nested sections like
{ "headers": { "token": "..." } }. - Generated imports are rewritten from
.jsto.tsso the SDK can run directly via Node's--experimental-strip-typesmode without a separate build step.