From margins
Install the Margins CLI globally and configure authentication. Use when: "margins setup", "setup margins", "configure margins", or when /margins or /margins-read fails with "margins CLI not found".
How this skill is triggered — by the user, by Claude, or both
Slash command
/margins:margins-setupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
```bash
command -v margins && margins --version
If the CLI is found, skip to Step 3 (credential check).
The margins CLI is distributed via GitHub and invoked through npx. No global install needed.
npx --yes github:alvistar/margins-cli --version
If npx is not found, tell the user:
"Node.js is required. Install it from https://nodejs.org, then retry
/margins-setup."
If the version check succeeds, the CLI is ready to use.
margins config show
If credentials exist (API key or OAuth tokens shown), skip to Step 5 (verification).
Ask the user via AskUserQuestion:
"How would you like to authenticate with Margins?"
Options:
margins auth login
This opens a browser window for Keycloak authentication. The CLI starts a local HTTP server to receive the callback. Wait for the user to complete the browser flow.
If it fails with "invalid redirect_uri", the Keycloak client may not have localhost registered. Tell the user:
"Keycloak needs
http://localhost:*registered as a redirect URI. Ask your admin to add it."
Ask: "Paste your Margins API key (starts with mrgn_):"
margins config set-key <key>
margins auth whoami
If successful, show the result and confirm:
"Margins CLI installed and authenticated. You can now use
/marginsand/margins-read."
If it fails, surface the error and suggest:
"Authentication verification failed. Try running
margins auth loginagain."
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub alvistar/margins-cli --plugin margins