Documentation
¶
Overview ¶
Package initcmd implements the `slack-acp init` first-run wizard.
The wizard's only job is to collapse the after-manifest-paste steps — capture the two Slack tokens, sanity-check them, and persist them somewhere a supervisor unit can find them — into a single command.
$ slack-acp init Bot token (xoxb-…): xoxb-... App-level token (xapp-…): xapp-... verifying with Slack auth.test … ok (team T01… user U01…) wrote /Users/you/.config/slack-acp/config.json wrote /Users/you/.config/slack-acp/env next: run `slack-acp` (or set up a supervisor with the deploy skill)
Tokens can also come from flags (`--bot-token` / `--app-token`) for non-interactive provisioning, in which case stdin isn't read at all.
Verification (a live `auth.test` call) is on by default and can be skipped with `--skip-verify` for offline bootstrap.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultVerifier ¶
DefaultVerifier calls Slack's auth.test with the bot token and returns a human-readable identity string on success. The app-level token is currently only shape-checked (a full Socket Mode handshake would add complexity for little gain — operators who fat-finger the app token find out within seconds of `slack-acp` starting).
Honours SLACK_API_BASE for parity with internal/slackproto so the e2e harness's mock Slack works with `init` too.
Types ¶
type Options ¶
type Options struct {
// Pre-set tokens (from --bot-token / --app-token). Empty → prompt.
BotToken string
AppToken string
// Output paths. Zero → config.DefaultConfigPath / DefaultEnvPath.
ConfigPath string
EnvPath string
// Behaviour switches.
NonInteractive bool // if true and a required token is missing, fail instead of prompting
SkipVerify bool // if true, don't call Verifier
Force bool // if true, overwrite existing files; otherwise refuse
// IO. Zero → os.Stdin / os.Stdout.
In io.Reader
Out io.Writer
// Verifier. Zero → DefaultVerifier.
Verify Verifier
}
Options bundles the wizard's inputs. Zero values are filled in with sensible defaults by Run.