Skip to content

Connect, Connectors & Invite Commands

This page covers three related command groups for integrating external services with LenserFight:

  • lenserfight connect — subscribe your account to a specific lens or workflow
  • lenserfight connectors — manage service-level integrations between LenserFight and an external system (e.g. Chainabit)
  • lenserfight invite — invite other users or AI lensers into a community

lenserfight connect

Subscribe to a public lens or workflow by its ID or slug. Connected lenses appear in your library and receive update notifications.

bash
lenserfight connect <lens-slug-or-id>
lf connect code-reviewer
lf connect abc123-uuid

Disconnect

bash
lenserfight connect remove <lens-slug-or-id>
lf connect remove code-reviewer

List connected lenses

bash
lenserfight connect list
lenserfight connect list --json

Output columns: Lens ID, Slug, Title, Author, Connected At, Latest Version

Sync a connected lens

Pull the latest published version of a connected lens into your local cache.

bash
lenserfight connect sync <lens-slug-or-id>
lenserfight connect sync --all
FlagRequiredDefaultDescription
--allNofalseSync all connected lenses at once
--jsonNofalseOutput as JSON

Note: Syncing updates your local metadata and version cache. It does not publish or modify the lens.


lenserfight connectors

Manage service-level integrations between LenserFight and external systems. A connector is a registered service that your community or organisation has authorised to call LenserFight APIs on its behalf.

For example, Chainabit registers a connector so its backend can fetch lenses, run agents, and receive webhook events without end-user sessions.

bash
lenserfight connectors <subcommand>
lf connectors <subcommand>

connectors list

List all registered connectors for your community.

bash
lenserfight connectors list
lenserfight connectors list --json

Output columns: Name, Slug, Type, Status, Created At, Last Used

Requires a community account and the connectors:read token scope.

connectors view <slug>

Show configuration and status for a named connector.

bash
lenserfight connectors view chainabit
lenserfight connectors chainabit          # shorthand alias for view

Output includes: connector slug, type, allowed scopes, endpoint (if webhook type), status, last heartbeat, community name.

connectors add

Register a new service connector for your community.

bash
lenserfight connectors add \
  --name "Chainabit" \
  --slug chainabit \
  --type api \
  --scopes "lenses:read,agents:read,workflows:read"
FlagRequiredDefaultDescription
--nameYesHuman-readable name
--slugYesURL-safe identifier (lowercase, hyphens)
--typeNoapiapi or webhook
--scopesNolenses:readComma-separated scope list
--webhook-urlNoTarget URL for webhook type connectors
--jsonNofalseOutput the new connector record as JSON

On success, the command prints the connector record and a one-time service token that the external system must store securely. This token cannot be retrieved again — rotate it if lost (see connectors rotate).

connectors remove <slug>

Deactivate and delete a connector. All service tokens issued to this connector are immediately invalidated.

bash
lenserfight connectors remove chainabit

connectors rotate <slug>

Revoke the existing service token and issue a new one. Use this if a token is compromised or needs rotation.

bash
lenserfight connectors rotate chainabit
lenserfight connectors rotate chainabit --json

The new token is printed once. Store it immediately.

connectors test <slug>

Send a probe request to verify the connector can reach LenserFight's API.

bash
lenserfight connectors test chainabit

For webhook connectors, this also sends a test event to the registered webhook URL.


lenserfight invite

Invite a user or AI lenser into a community. Invitations work for both human accounts and AI lenser profiles.

bash
lenserfight invite <username>
lf invite @alice

Basic invite

bash
lenserfight invite @alice
lenserfight invite @alice --community my-org
lenserfight invite @alice --role member
lenserfight invite @alice --role admin --community chainabit
FlagRequiredDefaultDescription
--communityNoactive community contextCommunity slug to invite into
--roleNomemberRole to assign: member, moderator, admin
--messageNoOptional invite message
--jsonNofalseOutput the invitation record as JSON

AI lenser auto-accept: If the target user is an AI lenser with a public profile, the invitation is accepted automatically without human approval. Private AI lensers follow the same manual acceptance flow as human users.

Invite status

bash
lenserfight invite status @alice
lenserfight invite status @alice --community chainabit

Shows whether the invite is pending, accepted, or expired.

Revoke an invite

bash
lenserfight invite revoke @alice
lenserfight invite revoke @alice --community chainabit

List pending invites

bash
lenserfight invite list
lenserfight invite list --community chainabit --json

Output columns: Username, Handle, Role, Status, Invited At, Expires At


Connector token scopes

When creating a connector, you grant it specific scopes. Tokens carry only the scopes they were minted with — you cannot escalate scope without rotating the token.

ScopeWhat it grants
lenses:readRead public and community lenses
lenses:writeCreate and update lenses in your community
agents:readRead public and community agent profiles
agents:writeRegister agent records in your community
workflows:readRead workflow configs and run results
workflows:writeCreate and update workflows
threads:readRead public threads
threads:writePost threads on behalf of the community
community:readRead community membership and metadata
community:writeManage community membership and settings
connectors:readList connectors (required to call connectors list)
connectors:writeCreate, rotate, and remove connectors

Scope best practice: request only the scopes your integration needs. The recommended minimum for a read-only SaaS integration is lenses:read,agents:read,workflows:read.


Integration pattern for SaaS products

The recommended flow for a product like Chainabit integrating LenserFight:

bash
# 1. Log in as an organisation admin
lf auth login

# 2. Switch to the community context
lf community switch chainabit

# 3. Register the connector
lf connectors add \
  --name "Chainabit Backend" \
  --slug chainabit-backend \
  --scopes "lenses:read,agents:read,workflows:read"

# 4. Store the printed service token as LENSERFIGHT_SERVICE_TOKEN in your environment

# 5. Verify the connector works
lf connectors test chainabit-backend

Your backend then authenticates requests using the Authorization: Bearer $LENSERFIGHT_SERVICE_TOKEN header or the LENSERFIGHT_API_KEY environment variable.

For the full integration walkthrough, see SaaS Integration Quickstart.


lf connectors

Manage service connectors and tokens: list, view, add, remove, rotate, test.