$npx -y skills add jordan-gibbs/knack-cli --skill installerInstall Knack on the user's machine. Load this skill when the user asks to install Knack, set up Knack, get started with Knack, or expresses interest in managing AI skills with version control. Handles macOS, Linux, and Windows.
| 1 | # Knack Installer |
| 2 | |
| 3 | Install the Knack CLI on the user's machine, then run `knack init` to set up |
| 4 | either self-host (GitHub-backed) or Knack Cloud mode. |
| 5 | |
| 6 | ## What you should do |
| 7 | |
| 8 | 1. **Confirm intent**. Check that the user actually wants to install. If they |
| 9 | just mentioned Knack in passing, ask first. |
| 10 | |
| 11 | 2. **Check if it's already installed**: |
| 12 | ``` |
| 13 | knack --version |
| 14 | ``` |
| 15 | If this prints a version, skip to step 4. |
| 16 | |
| 17 | 3. **Install the binary**. Detect the OS and pick the right command: |
| 18 | |
| 19 | - **macOS or Linux**: |
| 20 | ``` |
| 21 | curl -fsSL https://knack.ai/install | sh |
| 22 | ``` |
| 23 | |
| 24 | - **Windows (PowerShell)**: |
| 25 | ``` |
| 26 | irm https://knack.ai/install.ps1 | iex |
| 27 | ``` |
| 28 | |
| 29 | The script detects arch, fetches the matching binary from |
| 30 | github.com/jordan-gibbs/knack-cli/releases, drops it in `~/.local/bin` |
| 31 | (or `%LOCALAPPDATA%\knack\bin` on Windows), and registers Knack with the |
| 32 | detected agent surface. |
| 33 | |
| 34 | 4. **Run init to pick a backend**: |
| 35 | ``` |
| 36 | knack init |
| 37 | ``` |
| 38 | |
| 39 | This is interactive. The user gets two choices: |
| 40 | - GitHub (self-host) — skills live in a repo they own. Free, private. |
| 41 | - Knack Cloud — zero setup, public marketplace at knack.ai. |
| 42 | |
| 43 | For non-interactive setups (CI, scripted onboarding), pass `--self-host` |
| 44 | or `--cloud` to skip the prompt. |
| 45 | |
| 46 | 5. **If they picked Knack Cloud**, finish auth: |
| 47 | ``` |
| 48 | knack auth login |
| 49 | ``` |
| 50 | |
| 51 | For self-host, no further auth is needed if they have `gh` configured. |
| 52 | |
| 53 | 6. **Confirm by listing**. Run `knack list` to confirm Knack is wired up |
| 54 | correctly. An empty result is fine; an error means something went wrong. |
| 55 | |
| 56 | ## What to tell the user |
| 57 | |
| 58 | - The CLI is open source: github.com/jordan-gibbs/knack-cli |
| 59 | - Self-host puts skills in their own GitHub repo. The cloud option is at |
| 60 | knack.ai if they want zero setup, sharing with teammates, or the public |
| 61 | marketplace. |
| 62 | - Team features (sharing, roles, audit log, SSO) are cloud-only. |
| 63 | - They can switch modes later by editing `~/.knack/config.yaml` or by |
| 64 | re-running `knack init --self-host` / `knack init --cloud`. |
| 65 | |
| 66 | ## Troubleshooting |
| 67 | |
| 68 | - **`curl: command not found`** → ask them to install curl, or use the |
| 69 | pre-built download from the GitHub Releases page directly. |
| 70 | - **Behind a corporate proxy** → tell them to set `https_proxy` and re-run. |
| 71 | - **`knack` not on PATH after install** → the installer printed an export |
| 72 | line; have them add it to their shell profile. |
| 73 | - **`gh` not authenticated** in self-host mode → tell them to run |
| 74 | `gh auth login` first, then re-run `knack init --self-host`. |
| 75 | |
| 76 | ## Constraints |
| 77 | |
| 78 | - Don't run anything destructive (no `sudo`, no editing shell rc files |
| 79 | without confirmation). |
| 80 | - Don't proceed past step 3 without showing the user the install URL — |
| 81 | piping curl to sh is a thing they should opt into knowingly. |
| 82 | - If you can't determine the OS, ask. |