Skip to main content
The PickFu CLI (@pickfu/cli) lets you create surveys, check results, and manage polls directly from your terminal. It supports structured JSON output for automation and CI/CD workflows.

Installation

npm install -g @pickfu/cli
Or run commands directly with npx:
npx @pickfu/cli <command>

Authentication

Log in through the browser to connect the CLI to your PickFu account:
pickfu auth login
This opens a browser window for OAuth authorization. Once approved, your credentials are stored locally and refreshed automatically. For headless environments (servers, CI), use the --headless flag to print the authorization URL instead of opening a browser:
pickfu auth login --headless

API key

For non-interactive environments like CI pipelines or automation scripts, use an API key instead of OAuth:
# Via environment variable
export PICKFU_API_KEY=your_api_key
pickfu survey list

# Or via flag (overrides env var and stored OAuth token)
pickfu survey list --token your_api_key
Token precedence: --token flag > PICKFU_API_KEY env var > stored OAuth token.

Managing credentials

pickfu auth status       # Check authentication status
pickfu auth status --local  # Check without contacting the API
pickfu auth logout       # Clear stored credentials

Commands

All commands support --json for machine-readable output.

Surveys

Create a survey

pickfu survey create
The CLI walks you through poll creation interactively. You can also provide options via flags:
pickfu survey create \
  --name "Logo test" \
  --question "Which logo do you prefer?" \
  --type head_to_head \
  --option "Logo A" \
  --option "Logo B" \
  --sample-size 50 \
  --country US \
  --targeting gender=female
Or create from a JSON file:
pickfu survey create --from-file survey.json
FlagDescription
--from-filePath to a JSON file with survey definition
--nameSurvey name
--questionThe question text
--typeQuestion type (see supported types)
--optionOption text (repeatable — use once per option)
--sample-sizeNumber of respondents
--countryCountry code (default: US)
--targetingTargeting trait in key=value format (repeatable)

Get survey details

pickfu survey get <survey-id>

List surveys

pickfu survey list
FlagDescriptionDefault
--statusFilter by status (completed, in-progress, unpublished, archived)All
--limitResults per page20
--pagePage number1
--sort-bySort field (createdAt, name, creator, status)createdAt
--dirSort direction (asc, desc)desc

Update a draft survey

pickfu survey update <survey-id> --name "Updated name" --sample-size 100
Or update from a JSON file:
pickfu survey update <survey-id> --from-file updated-survey.json
FlagDescription
--from-filePath to JSON file with updates
--nameUpdated survey name
--sample-sizeUpdated respondent count
--countryUpdated country code

Publish a survey

Publish a draft survey to start collecting responses:
pickfu survey publish <survey-id>

View responses

Get individual responses with explanations and demographics:
pickfu survey responses <survey-id>
FlagDescriptionDefault
--pagePage number1
--limitResponses per page20
--question-idFilter responses by questionAll questions

Watch a survey

Block until a survey completes — useful in scripts and CI:
pickfu survey watch <survey-id>
FlagDescriptionDefault
--intervalPolling interval in seconds30
--exit-statusExit with code 2 if cancelled or archivedfalse

Targeting and reporting

List available targeting traits

pickfu targeting list --country US
Returns all demographic targeting traits available for the specified country. Use the permalink values as targeting keys in survey create --targeting.

List available reporting demographics

pickfu reporting list --country US
Returns all demographic breakdowns available for survey results.

Tags

pickfu tag list                    # List your tags
pickfu tag list --query "amazon"   # Search tags
pickfu tag create "Q2 testing"     # Create a new tag

Schema introspection

View the full input/output schemas for any command — useful for building integrations:
pickfu schema             # List all commands
pickfu schema survey.create  # Detailed schema for a specific command

Generic API access

Make authenticated API requests directly:
pickfu api GET /v1/surveys
pickfu api POST /v1/surveys --body '{"name": "test"}'
pickfu api GET /v1/traits/targeting --query country=US

Supported question types

TypeDescription
head_to_headA/B comparison where respondents pick a favorite (2 options)
rankedRespondents rank options in preference order (3-8 options)
open_endedSingle-concept poll with written feedback
click_testHeatmap generation from image clicks
emoji_ratingEmoji sentiment selection with explanation
star_rating1-5 star rating with feedback
five_second_testBrief timed exposure for first impressions
screen_recordingRecord user interaction with content
single_selectChoose one from multiple options (3-8 options)
multi_selectSelect multiple answers from options (3-8 options)

Sample sizes

Available respondent counts: 15, 30, 50, 75, 100, 200, 500

Need help?

pickfu --help
pickfu survey --help
pickfu survey create --help
Or contact support@pickfu.com for assistance.