The Tightknit CLI is currently in alpha. Commands and options may change between releases.
Install with the
@alpha tag: npm i -g @tightknitai/tightknit@alphaInstallation
- npm (global)
- npx (no install)
Authentication
The CLI resolves your API key in the following order:| Priority | Source | Best for |
|---|---|---|
| 1 (highest) | --api-key <key> flag | One-off commands, scripting |
| 2 | TIGHTKNIT_API_KEY environment variable | CI/CD pipelines, MCP server |
| 3 (lowest) | Stored config (tightknit config set api-key) | Interactive CLI usage |
Create an API key
Go to Settings > Integrations > API Keys in the Studio.
Click Create API key, give it a descriptive name, and select the permissions your commands need.Copy the key (starts with
sk_) — it is only shown once.Configure the CLI
~/.config/tightknit/config.json.Alternatively, set the environment variable:Commands
Every command supports--json for machine-readable output and --help for usage details.
Events
| Command | Description |
|---|---|
tightknit events list | List calendar events |
tightknit events get <id> | Get a calendar event by ID |
tightknit events create | Create a new calendar event |
tightknit events delete <id> | Delete a calendar event |
tightknit events update-attendee <id> | Update an event attendee |
Example: list upcoming events as JSON
Example: create an event
Feeds & Posts
| Command | Description |
|---|---|
tightknit feeds list | List feeds |
tightknit feeds get <id> | Get a feed by ID |
tightknit feeds posts <id> | List posts in a feed |
tightknit posts get <id> | Get a post by ID |
Example: list newest posts in a feed
Members
| Command | Description |
|---|---|
tightknit members add | Add a member (Enterprise) |
tightknit members check <email> | Check if an email is a member |
Example: add a member
Messages
| Command | Description |
|---|---|
tightknit messages send | Send a Slack message |
Example: send a message
Groups
| Command | Description |
|---|---|
tightknit groups add-member <id> | Add a user to a group |
Awards
| Command | Description |
|---|---|
tightknit awards assign <id> | Assign an award to a member |
Example: assign an award
Search
| Command | Description |
|---|---|
tightknit search query <query> | Search posts, events, and content |
Example: search for posts
Search is currently in Beta.
Config
| Command | Description |
|---|---|
tightknit config set <key> <value> | Set a configuration value |
tightknit config get <key> | Get a configuration value |
api-key, default-output (json or table), environment (production or staging).
Global Options
| Flag | Description |
|---|---|
--api-key <key> | API key for this invocation (not persisted) |
--json | Output as JSON (available on all commands) |
--no-color | Disable colored output |
--verbose | Enable verbose output |
-v, --version | Print the CLI version |
-h, --help | Show help for a command |
Output Behavior
By default, the CLI formats output as a human-readable table. Use--json on any command for structured JSON, which is useful for scripting and piping:
Piping JSON output
Exit Codes
The CLI uses differentiated exit codes for scripting and CI/CD integration:| Code | Meaning |
|---|---|
0 | Success |
1 | General or unknown error |
2 | Input validation error (invalid arguments, bad email format) |
3 | Authentication or authorization error (invalid or missing API key) |
4 | Resource not found |
Example: check exit code in a script
CI/CD
Set theTIGHTKNIT_API_KEY environment variable in your pipeline. The CLI skips interactive features (like update notifications) when the CI environment variable is set.
Shell Completions
Generate tab-completion scripts for your shell:MCP Server
The CLI includes a built-in Model Context Protocol (MCP) server, allowing AI agents to manage your Tightknit community through natural language.Setup with Claude
Add this to your Claude MCP configuration:Available Tools
The MCP server exposes 15 tools with read/write annotations so agents can understand the impact of each action:| Tool | Description | Type |
|---|---|---|
list_events | List calendar events | Read |
get_event | Get a calendar event by ID | Read |
create_event | Create a calendar event | Write |
delete_event | Delete a calendar event | Destructive |
update_event_attendee | Update an event attendee | Write |
assign_award | Assign an award to a member | Write |
list_feeds | List feeds | Read |
get_feed | Get a feed by ID | Read |
list_feed_posts | List posts in a feed | Read |
get_post | Get a post by ID | Read |
add_member | Add a community member | Write |
check_membership | Check if an email is a member | Read |
send_message | Send a Slack message | Write |
add_group_member | Add a user to a group | Write |
search | Search posts, events, and content | Read |
Testing
You can test the MCP server using the MCP Inspector:API Coverage
All endpoints from the Tightknit Admin API are supported:| Method | Endpoint | CLI Command |
|---|---|---|
| GET | /admin/v0/calendar_events | events list |
| POST | /admin/v0/calendar_events | events create |
| GET | /admin/v0/calendar_events/:id | events get |
| DELETE | /admin/v0/calendar_events/:id | events delete |
| PATCH | /admin/v0/calendar_events/:id/attendees | events update-attendee |
| POST | /admin/v0/awards/:id/assign | awards assign |
| GET | /admin/v0/feeds | feeds list |
| GET | /admin/v0/feeds/:id | feeds get |
| GET | /admin/v0/feeds/:id/posts | feeds posts |
| GET | /admin/v0/posts/:id | posts get |
| POST | /admin/v0/members | members add |
| POST | /admin/v0/members/check | members check |
| POST | /admin/v0/messages | messages send |
| POST | /admin/v0/groups/:id/members | groups add-member |
| GET | /admin/v0/search | search query |

