Featurely Docs

CLI

featurely-cli — set up all Featurely SDKs in any project with a single command.

featurely-cli

The Featurely CLI automates SDK installation, API key creation, code injection, and optional Vercel and MCP configuration.

Run without installing:

npx featurely-cli@latest init

Or install globally:

npm install -g featurely-cli
pnpm add -g featurely-cli
yarn global add featurely-cli
bun add -g featurely-cli

Node.js requirement: Node.js 18 or later.

Commands

CommandAuthDescription
initSessionFull guided setup: auth, packages, API key, code injection, optional Vercel + MCP config
login—Open browser sign-in and store a session token locally. Use --force to re-authenticate
logout—Remove the locally stored session token
whoamiSessionPrint the signed-in account, user ID, and token expiry
status—Check your Featurely setup: auth state, .env.local config, installed packages, and CLI version
scanAPI keyUpload the project's full dependency list to your Featurely dashboard. Reads NEXT_PUBLIC_FEATURELY_API_KEY from .env.local or pass --api-key
mcp / mcp setup—Register the docs MCP server as featurely-docs (npx -y featurely-mcp@latest) without running init

mcp setup registers the docs server as featurely-docs (a legacy featurely entry whose command runs featurely-mcp is removed and replaced by that featurely-docs entry). An existing featurely entry for https://www.featurely.no/api/mcp (the hosted MCP) is left unchanged, as are other servers. Running the command again updates featurely-docs in place and does not create a duplicate.

What init does — step by step

  1. Opens a browser to sign in with your Featurely account
  2. Lets you pick which packages to set up — featurely-mcp is registered as the featurely-docs MCP server, not installed as a local dependency
  3. Creates an API key with the correct permissions for your chosen packages
  4. Detects your framework and generates a featurely-providers.tsx initializer file — featurely-logger requires manual setup
  5. Writes NEXT_PUBLIC_FEATURELY_API_KEY and NEXT_PUBLIC_FEATURELY_PROJECT_ID to .env.local
  6. Optionally syncs those env vars to Vercel when a .vercel/ folder is detected
  7. If featurely-mcp was selected: configures the featurely-docs MCP server for Claude Desktop, Cursor, VS Code, or Windsurf

Available packages

PackageAuto initNotes
featurely-error-trackerYesGenerates useEffect initializer
featurely-feature-reporterYesGenerates useEffect initializer
featurely-site-managerYesGenerates useEffect initializer
featurely-i18nYesGenerates useEffect initializer
featurely-loggerNoInstalled but requires manual setup
featurely-mcpYesConfigured as the featurely-docs MCP server via npx -y featurely-mcp@latest, not installed as a local dep

Framework detection

The CLI detects your framework automatically:

FrameworkDetection
Next.js App Routernext dependency + app/ directory
Next.js Pages Routernext dependency + pages/ directory
Reactreact dependency (no next)
Vuevue dependency
Nuxtnuxt dependency
Node.jsFallback

Package managers detected by lockfile: npm, yarn, pnpm, bun.