CLI Reference
Complete command reference for the fluidsoul developer CLI.
CLI Reference
The fluidsoul CLI gives you full access to the fluidsoul API from your terminal — 28 commands covering events, context, rules, users, analytics, and workspace management.
Installation
npm (recommended):
npm install -g @fluidsoul/cliThis installs a prebuilt native binary for your platform. Works on macOS (x64, ARM64), Linux (x64, ARM64), and Windows (x64).
From GitHub Releases:
Download the prebuilt binary for your platform from GitHub Releases and add it to your PATH.
From source (requires Rust toolchain):
cargo install --path crates/fluidsoul-cliSetup
Initialize config
fluidsoul initCreates ~/.fluidsoul/config.toml with default settings.
Authenticate (Clerk JWT)
fluidsoul loginStores a Clerk session token for admin commands (workspace management, user listing).
Set API token
fluidsoul token set fs_tok_xxxxxxxxxxxxSets the workspace API token used for public API commands.
Verify connectivity
fluidsoul healthChecks that your API URL is reachable and returns ok.
Show current config
fluidsoul whoamiDisplays your configured API URL, workspace ID, token status, and API connectivity.
Configuration
View config
fluidsoul config viewSet a config value
fluidsoul config set api_url https://api.fluidsoul.io
fluidsoul config set workspace_id aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeeeValid keys: api_url, workspace_id, token, clerk_token.
Environment variable overrides
Environment variables take precedence over config file values:
| Env var | Config key | Description |
|---|---|---|
FLUIDSOUL_API_URL | api_url | API server URL |
FLUIDSOUL_API_TOKEN | token | Workspace API token |
FLUIDSOUL_WORKSPACE_ID | workspace_id | Workspace UUID |
Global flags
These flags work with any command:
| Flag | Description |
|---|---|
--json | Output as JSON instead of human-readable format |
--api-url <url> | Override API URL for this command |
--workspace-id <id> | Override workspace ID for this command |
--version | Show CLI version |
Events
Send an event
fluidsoul events send \
--user-id usr_123 \
--event-type feature_accessed \
--metadata '{"feature_name": "analytics"}'Auth: API token
Stream events (SSE)
fluidsoul events streamStreams real-time events for the configured workspace via Server-Sent Events.
Auth: API token (requires admin workspace)
Context
Get user context
fluidsoul context get usr_123Returns the computed context profile for a user — category, feature priorities, engagement level, and more.
Auth: API token
Refresh user context
fluidsoul context refresh usr_123Re-runs the rules engine on the user's events and updates their context profile.
Auth: API token
View context history
fluidsoul context history usr_123 --limit 10Shows historical context snapshots and dimension transitions.
Auth: API token
Segments
Query users by segment
fluidsoul segments query \
--dimension user_category \
--value analyst \
--limit 50Returns users matching a segment dimension and value.
Auth: API token
Users
List users
fluidsoul users list --search "usr_" --limit 20
fluidsoul users list --dimension user_category --value analystLists users with context summary. Supports search and dimension filtering.
Auth: Clerk JWT (admin)
View user detail
fluidsoul users detail usr_123Shows detailed user profile including context, events, and history.
Auth: Clerk JWT (admin)
Export user data (GDPR)
fluidsoul users export usr_123
fluidsoul users export usr_123 --output export.jsonExports all stored data for a user. Use --output to write to a file.
Auth: API token
Delete user data (GDPR)
fluidsoul users delete usr_123 --confirmPermanently deletes all data for a user. Requires --confirm flag — this is irreversible.
Auth: API token
Rules
View rules config
fluidsoul rules getDisplays the current workspace rules configuration.
Auth: API token
Update rules config
# From a file
fluidsoul rules set --file rules.json
# From stdin
cat rules.json | fluidsoul rules set --stdinUpdates the workspace rules configuration. See Configuring Rules for the schema.
Auth: API token
Analytics and Outcomes
View workspace analytics
fluidsoul analyticsShows aggregate workspace metrics — user counts, event counts, and segment breakdowns.
Auth: API token
View outcome rates
fluidsoul outcomes --outcome-type conversion --dimension user_categoryShows outcome/conversion rates broken down by a segment dimension.
Auth: API token
Audit Logs
View logs
fluidsoul logs --limit 50 --offset 0Paginated audit trail of all significant actions in the workspace.
Auth: API token
Workspace Management (Admin)
These commands use Clerk JWT authentication, not workspace API tokens. Run fluidsoul login first.
Create a workspace
fluidsoul workspace create "My App"List workspaces
fluidsoul workspace listView workspace details
fluidsoul workspace infoShows details for the configured workspace.
Generate API token
fluidsoul workspace token generateGenerates a new API token for the workspace. This invalidates the previous token. Requires owner role.
List members
fluidsoul workspace membersLists all members of the configured workspace.
Quick Reference
| Command | Description | Auth |
|---|---|---|
fluidsoul init | Create config file | — |
fluidsoul login | Authenticate with Clerk | — |
fluidsoul health | Check API connectivity | Token |
fluidsoul whoami | Show config and status | Token |
fluidsoul config view | View configuration | — |
fluidsoul config set <key> <value> | Set config value | — |
fluidsoul token set <token> | Set API token | — |
fluidsoul token show | Show API token | — |
fluidsoul events send | Send an event | Token |
fluidsoul events stream | Stream events (SSE) | Token |
fluidsoul context get <user_id> | Get user context | Token |
fluidsoul context refresh <user_id> | Refresh user context | Token |
fluidsoul context history <user_id> | View context history | Token |
fluidsoul segments query | Query users by segment | Token |
fluidsoul users list | List users | Clerk JWT |
fluidsoul users detail <user_id> | View user detail | Clerk JWT |
fluidsoul users export <user_id> | Export user data (GDPR) | Token |
fluidsoul users delete <user_id> | Delete user data (GDPR) | Token |
fluidsoul rules get | View rules config | Token |
fluidsoul rules set | Update rules config | Token |
fluidsoul analytics | View workspace analytics | Token |
fluidsoul outcomes | View outcome rates | Token |
fluidsoul logs | View audit logs | Token |
fluidsoul workspace create <name> | Create workspace | Clerk JWT |
fluidsoul workspace list | List workspaces | Clerk JWT |
fluidsoul workspace info | View workspace details | Clerk JWT |
fluidsoul workspace token generate | Generate API token | Clerk JWT |
fluidsoul workspace members | List members | Clerk JWT |