@fynlink/cli
v0.1.0-beta.2
Published
Official command-line interface for Fynlink
Readme
@fynlink/cli
Official command-line interface for Fynlink, powered by @fynlink/sdk.
Website: https://fyn.link
Requirements
- Node.js
>= 20.10.0
Install
npm i -g @fynlink/cliThe package exposes two equivalent commands:
fyn --help
fynlink --helpQuick Start
- Add a profile (interactive):
fyn profile add- Add a profile (non-interactive):
fyn profile add \
--name dev \
--token "$FYN_TOKEN" \
--secret "$FYN_SECRET" \
--set-active- Verify active profile:
fyn profile current- Call APIs:
fyn links list --limit 10Global Options
These options work on every command:
--profile <name>
--token <value>
--secret <value>
--base-url <url>
--timeout-ms <number>
--debug
--quiet
--no-progress
--output <json|table|yaml>
--json
--no-colorEnvironment variables are also supported:
FYN_PROFILE
FYN_TOKEN
FYN_SECRET
FYN_BASE_URL
FYN_TIMEOUT_MS
FYN_DEBUG
FYN_QUIET
FYN_PROGRESS
FYN_COLORResolution precedence is: CLI flags -> environment -> selected profile.
About
# Show CLI build/runtime metadata
fyn aboutDoctor
# Run runtime/profile/token/connectivity diagnostics
fyn doctor
# Machine-readable diagnostics
fyn doctor --jsonShell Completion
# Bash
fyn completion bash > ~/.bashrc.d/fyn-completion.sh
# Zsh
fyn completion zsh > ~/.zsh/completions/_fyn
# Fish
fyn completion fish > ~/.config/fish/completions/fyn.fishProfiles
# Add profile with prompts for missing values
fyn profile add
# Add profile fully from flags
fyn profile add --name staging --token "<token>" --secret "<secret>" --set-active
# List all profiles
fyn profile list
# Show active profile
fyn profile current
# Switch active profile
fyn profile use staging
# Show one profile
fyn profile show staging
# Remove profile (skip confirmation)
fyn profile remove staging --yesprofile add validates the token by calling bootstrap info and stores team metadata (team id/name, token name) on success.
Info
# Get bootstrap info
fyn info get
# Force refresh (bypass SDK bootstrap cache)
fyn info get --forceTeams
# Get current team
fyn teams get
# Update team (interactive if --name is omitted)
fyn teams update --name "Growth Team"Members
# List members
fyn members list
# Include owner
fyn members list --include-owner
# Get a member
fyn members get member_123
# Invite (interactive if flags omitted)
fyn members invite --email [email protected] --role admin
# Update role (interactive if --role omitted)
fyn members update member_123 --role editor
# Remove member (skip confirmation)
fyn members remove member_123 --yesDomains
# List domains
fyn domains list --page 1 --limit 20
# Get domain by id
fyn domains get domain_123
# Create domain (interactive if --domain omitted)
fyn domains create \
--domain links.example.com \
--description "Primary branded domain" \
--not-found-url "https://www.example.com/404" \
--root-redirect "https://www.example.com" \
--gpc
# Verify DNS/status
fyn domains verify domain_123
# Update domain fields
fyn domains update domain_123 --description "Updated description" --gpc true
# Remove domain (skip confirmation)
fyn domains remove domain_123 --yesLinks
# Create link (interactive if --target omitted)
fyn links create \
--target "https://www.example.com/pricing" \
--slug spring-sale \
--title "Spring Campaign" \
--notes "Created from CLI" \
--tag campaign spring \
--ios-target "https://apps.apple.com/app/id123" \
--android-target "https://play.google.com/store/apps/details?id=com.example.app" \
--geo US=https://us.example.com/pricing CA=https://ca.example.com/pricing \
--safe-mode true \
--analytics full \
--expiry-seconds 86400
# Get one link
fyn links get link_123
# List links with filters
fyn links list \
--page 1 \
--limit 20 \
--sort-by created_at \
--sort-order desc \
--filter-domain links.example.com \
--filter-tracking full \
--filter-safe-mode true \
--filter-private false \
--filter-password false
# Update link
fyn links update link_123 --title "Updated title" --tag campaign q2 --private false
# Clear password and expiry
fyn links update link_123 --password null --expiry-seconds null
# Delete link (skip confirmation)
fyn links delete link_123 --yesNotes:
domainis optional for link create. If omitted, CLI uses the team default domain from refreshed bootstrap info.- Link
statusandviaApiare response fields from backend/system state. - They are not accepted as create/update input flags.
- Progress indicators are transient. Use
--no-progressfor fully quiet automation logs. - Create/update mutations print a short result header before the returned record in table output for better visual separation.
Analytics
# Total clicks
fyn analytics clicks link_123
# Timeseries with date range
fyn analytics timeseries link_123 \
--start 2026-03-01T00:00:00Z \
--end 2026-03-31T23:59:59Z \
--granularity day
# Browser split with filters
fyn analytics browsers link_123 \
--country US IN \
--browser Chrome Safari
# Other breakdowns
fyn analytics devices link_123
fyn analytics countries link_123
fyn analytics referrers link_123 --referrer google.com x.comOutput Modes
# Human-readable default output
fyn links get link_123
# JSON for scripting
fyn links list --json
# YAML output
fyn links list --output yaml
# Disable ANSI colors
fyn links get link_123 --no-colorAutomation Examples
# Select profile once and reuse
fyn profile use production
fyn links list --limit 100 --json
# Use env vars in CI
FYN_TOKEN="<token>" FYN_SECRET="<secret>" fyn links list --json
# Parse JSON output
fyn links list --json | jq '.data[0].id'