CLI toolkit for KnowStack project setup and management.
Connects to a running KnowStack API via MCP, creates your organization and project, ingests documents, and seeds agents, skills, commands, and templates — all in one interactive flow.
- Node.js >= 18
- A running KnowStack API instance
npx @knowstack/sdk --initWith a named profile:
npx @knowstack/sdk --init --profile staging| Flag | Description |
|---|---|
--init |
Start the interactive setup wizard |
--profile <name> |
Use or create a named profile |
--version, -v |
Print the installed version |
--help, -h |
Show usage information |
The wizard walks through these steps:
- Load or create a profile from
knowstack.config.json - Prompt for the MCP endpoint URL (default:
http://localhost:3100/api/v1/mcp) - Health-check the API
- Create or select an organization
- Create or select a project
- Select context projects (for cross-project knowledge)
- Save the profile locally
- Ingest documents from
./docs/ - Seed agents, skills, commands, and templates from
./docs/agents/,./docs/skills/, etc. - Generate embeddings (async, non-blocking)
- Print setup summary
The wizard saves your choices to knowstack.config.json in the directory where you run the command. Each named profile stores:
{
"profiles": {
"default": {
"mcpUrl": "http://localhost:3100/api/v1/mcp",
"organizationId": "...",
"projectId": "...",
"documentsDir": "./docs",
"contextProjects": []
}
}
}All commands run from the repository root (packages/sdk/ is a pnpm workspace package).
# Build the SDK
pnpm sdk:build
# Watch mode
pnpm --filter @knowstack/sdk dev
# Type-check only
pnpm --filter @knowstack/sdk typecheckOr from inside packages/sdk/:
pnpm build # compile TypeScript → dist/
pnpm dev # watch mode
pnpm typecheck # tsc --noEmit
pnpm clean # rm -rf dist| Change | Bump | Example |
|---|---|---|
| Bug fix, metadata update | patch | 0.1.2 → 0.1.3 |
| New feature or step | minor | 0.1.2 → 0.2.0 |
| Breaking change (CLI args, config format) | major | 0.1.2 → 1.0.0 |
Edit packages/sdk/package.json:
"version": "X.Y.Z"pnpm sdk:buildFix any type errors before continuing.
From the repository root:
pnpm sdk:releaseThis runs: clean → build → npm publish --access public.
You need to be authenticated (npm login) and a member of the @knowstack npm organization. If 2FA is enabled, you will be prompted for an OTP.
npm view @knowstack/sdk version # should match the version you set
npx @knowstack/sdk --version # should print the new version
npx @knowstack/sdk --help # should respond correctlyFor the full checklist including troubleshooting, see
docs/commands/sdk-release.md.
MIT