ashlr

/ashlr-team-invite

Invite someone to your ashlr team by email. Sends a magic-link invite (admin role required).

Invite a new member to the caller's team.

Usage: The user invokes this skill with an email, optionally followed by admin or member (default: member):

/ashlr-team-invite alice@example.com
/ashlr-team-invite bob@example.com admin

Steps:

  1. If the first non-flag argument is missing or doesn't look like an email (no @), reply:

    "Usage: /ashlr-team-invite <email> [admin|member]"

    and stop.

  2. Resolve the API base URL (default https://api.ashlr.ai, override with ASHLR_API_URL), and the API token:

    TOKEN="${ASHLR_PRO_TOKEN:-$(cat ~/.ashlr/pro-token 2>/dev/null)}"
    [ -z "$TOKEN" ] && { echo "Not signed in. Run /ashlr-upgrade first."; exit 1; }
  3. POST the invite:

    curl -sS -X POST "${ASHLR_API_URL:-https://api.ashlr.ai}/team/invite" \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{"email":"<EMAIL>","role":"<ROLE>"}'
  4. Interpret the response:

    • HTTP 200 → print ✓ invite sent to <email>. Expires in 7 days.
    • HTTP 403 with {"error":"Admin role required."} → print ✗ You must be a team admin to invite members.
    • HTTP 404 with {"error":"Not a team member."} → print ✗ You're not on a team yet. Create one with POST /team/create first.
    • Any other error → print the server's error field verbatim.
  5. Print no preamble. Print no trailing summary. Just the one-line outcome.

No other commands. No branching beyond the four response cases above.