Skip to main content
The Tightknit CLI is currently in alpha. Commands and options may change between releases. Install with the @alpha tag: npm i -g @tightknitai/tightknit@alpha
The Tightknit CLI gives you command-line access to the Tightknit Admin API. It also includes a built-in MCP server so AI agents like Claude can manage your community programmatically.

Installation

npm install -g @tightknitai/tightknit@alpha
Verify the installation:
tightknit --version

Authentication

The CLI resolves your API key in the following order:
PrioritySourceBest for
1 (highest)--api-key <key> flagOne-off commands, scripting
2TIGHTKNIT_API_KEY environment variableCI/CD pipelines, MCP server
3 (lowest)Stored config (tightknit config set api-key)Interactive CLI usage
1

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.
2

Configure the CLI

tightknit config set api-key sk_your_key_here
The key is stored at ~/.config/tightknit/config.json.Alternatively, set the environment variable:
export TIGHTKNIT_API_KEY=sk_your_key_here
3

Verify

tightknit feeds list
If your key is valid, you will see a list of your community’s feeds.

Commands

Every command supports --json for machine-readable output and --help for usage details.

Events

CommandDescription
tightknit events listList calendar events
tightknit events get <id>Get a calendar event by ID
tightknit events createCreate 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
tightknit events list --time-filter upcoming --status published --json
Example: create an event
tightknit events create \
  --title "Community Meetup" \
  --description "Join us for our monthly meetup" \
  --start-date "2025-06-01T18:00:00Z" \
  --end-date "2025-06-01T20:00:00Z" \
  --location "Zoom"

Feeds & Posts

CommandDescription
tightknit feeds listList 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
tightknit feeds posts fd_abc123 --sort newest --per-page 10

Members

CommandDescription
tightknit members addAdd a member (Enterprise)
tightknit members check <email>Check if an email is a member
Example: add a member
tightknit members add --email [email protected] --full-name "Jane Doe"

Messages

CommandDescription
tightknit messages sendSend a Slack message
Example: send a message
tightknit messages send --channel C0123456 --text "Hello from the CLI!"

Groups

CommandDescription
tightknit groups add-member <id>Add a user to a group

Awards

CommandDescription
tightknit awards assign <id>Assign an award to a member
Example: assign an award
tightknit awards assign awd_abc123 --recipient-email [email protected]
CommandDescription
tightknit search query <query>Search posts, events, and content
Example: search for posts
tightknit search query "onboarding" --type post --per-page 5 --json
Search is currently in Beta.

Config

CommandDescription
tightknit config set <key> <value>Set a configuration value
tightknit config get <key>Get a configuration value
Valid config keys: api-key, default-output (json or table), environment (production or staging).

Global Options

FlagDescription
--api-key <key>API key for this invocation (not persisted)
--jsonOutput as JSON (available on all commands)
--no-colorDisable colored output
--verboseEnable verbose output
-v, --versionPrint the CLI version
-h, --helpShow 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
tightknit events list --json | jq '.[] | .title'
You can change the default output format globally:
tightknit config set default-output json

Exit Codes

The CLI uses differentiated exit codes for scripting and CI/CD integration:
CodeMeaning
0Success
1General or unknown error
2Input validation error (invalid arguments, bad email format)
3Authentication or authorization error (invalid or missing API key)
4Resource not found
Example: check exit code in a script
tightknit members check [email protected] --json
if [ $? -eq 3 ]; then
  echo "API key is invalid or missing"
fi

CI/CD

Set the TIGHTKNIT_API_KEY environment variable in your pipeline. The CLI skips interactive features (like update notifications) when the CI environment variable is set.
- name: Check membership
  env:
    TIGHTKNIT_API_KEY: ${{ secrets.TIGHTKNIT_API_KEY }}
  run: |
    npx @tightknitai/tightknit@alpha members check [email protected] --json

Shell Completions

Generate tab-completion scripts for your shell:
# Add to ~/.bashrc
eval "$(tightknit completion bash)"

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:
{
  "mcpServers": {
    "tightknit": {
      "command": "npx",
      "args": ["@tightknitai/tightknit@alpha", "mcp"],
      "env": {
        "TIGHTKNIT_API_KEY": "sk_your_key_here"
      }
    }
  }
}

Available Tools

The MCP server exposes 15 tools with read/write annotations so agents can understand the impact of each action:
ToolDescriptionType
list_eventsList calendar eventsRead
get_eventGet a calendar event by IDRead
create_eventCreate a calendar eventWrite
delete_eventDelete a calendar eventDestructive
update_event_attendeeUpdate an event attendeeWrite
assign_awardAssign an award to a memberWrite
list_feedsList feedsRead
get_feedGet a feed by IDRead
list_feed_postsList posts in a feedRead
get_postGet a post by IDRead
add_memberAdd a community memberWrite
check_membershipCheck if an email is a memberRead
send_messageSend a Slack messageWrite
add_group_memberAdd a user to a groupWrite
searchSearch posts, events, and contentRead

Testing

You can test the MCP server using the MCP Inspector:
npx @modelcontextprotocol/inspector node $(which tightknit) mcp

API Coverage

All endpoints from the Tightknit Admin API are supported:
MethodEndpointCLI Command
GET/admin/v0/calendar_eventsevents list
POST/admin/v0/calendar_eventsevents create
GET/admin/v0/calendar_events/:idevents get
DELETE/admin/v0/calendar_events/:idevents delete
PATCH/admin/v0/calendar_events/:id/attendeesevents update-attendee
POST/admin/v0/awards/:id/assignawards assign
GET/admin/v0/feedsfeeds list
GET/admin/v0/feeds/:idfeeds get
GET/admin/v0/feeds/:id/postsfeeds posts
GET/admin/v0/posts/:idposts get
POST/admin/v0/membersmembers add
POST/admin/v0/members/checkmembers check
POST/admin/v0/messagesmessages send
POST/admin/v0/groups/:id/membersgroups add-member
GET/admin/v0/searchsearch query