Overview
The Farseer CLI is a command-line tool for managing Farseer tenants directly from your terminal. It enables a professional development workflow for building and maintaining Farseer Apps — with bidirectional file sync, local execution, and AI assistant integration.
Combined with the farseer-client TypeScript SDK, the CLI gives developers everything they need to write, test, and deploy automation scripts without leaving their code editor.
Key Capabilities
Bidirectional Sync — Pull and push scripts between your local folder and Farseer instances with diff and conflict detection
Local Development — Run apps locally with automatic credential injection — no hardcoded credentials needed
App Management — Create, configure, run, and delete apps from the command line
Model Inspection — List variables, dimensions, formulas, and export data to CSV
AI Integration — Claude, Cursor, and other AI assistants can interact with Farseer via MCP (Model Context Protocol)
Prerequisites
Node.js version 18.0 or higher
npm (included with Node.js)
A Farseer account with access to at least one tenant
A code editor (VS Code, Cursor, or similar) with TypeScript support recommended
Installing the CLI
Install the Farseer CLI globally via npm:
npm install -g farseer-cli
Verify the installation:
farseer --version
Authentication
The CLI supports two authentication methods. Browser login (OAuth) is recommended as it provides full access to all features including app management.
Browser Login (Recommended)
Log in through your browser using Farseer's OAuth flow:
farseer login
This opens your default browser to the Farseer login page. After successful authentication, the CLI stores your tokens securely in ~/.farseer/config.json. Tokens are automatically refreshed when they expire.
If your organization uses a custom authentication realm:
farseer login --realm your-realm
API Key Login
Alternatively, authenticate with an API key (supports file sync operations only — app management requires browser login):
farseer login --api-key
You will be prompted for your tenant ID, organization, and API key. You can also configure it directly:
farseer config set my-tenant --api-key sk_xxx --org my-org
Verifying Authentication
Check your current authentication status at any time:
farseer whoami
Setting Up the Development Environment
Step 1: Check Out a Tenant
Select the Farseer tenant you want to work with. This sets the default tenant for all subsequent commands:
farseer checkout my-org my-tenant
Where my-org is your organization subdomain (e.g., acme for acme.farseer.io) and my-tenant is the workspace name.
This command verifies your authentication and automatically pulls all files and app configurations from the remote instance.
Step 2: Understand the Project Structure
After checkout, the CLI creates the following local folder structure:
farseer-apps/
my-tenant/
package.json # Auto-generated with Farseer dependencies
.farseer-sync.json # Sync state (do not edit manually)
files/
Scripts/
my-import-script.ts
helpers/
utils.ts
Data/
config.json
apps/
My Import App.json
Sync Actuals.jsonFolder / File | Purpose |
| Your TypeScript/JavaScript app scripts — maps to the Files > Scripts folder on the Farseer instance |
| Data files (JSON, CSV, etc.) — maps to Files > Data |
| App configurations as JSON files — each file defines an app's entrypoint, arguments, and actions |
| Auto-generated with standard Farseer dependencies including |
| Internal sync state used for three-way merge — do not edit |
Step 3: Install Dependencies
Navigate to the tenant folder and install the npm dependencies:
farseer install
This runs npm install in your tenant directory, installing farseer-client and all other standard dependencies.
Writing Apps
Farseer Apps are TypeScript scripts that use the farseer-client SDK to interact with the Farseer API. They can import data, transform values, sync with external systems, and automate workflows.
Basic Script Structure
Create a new script in files/Scripts/:
import * as farseer from 'farseer-client';const client = new farseer.FarseerClient();
await client.initializeTagMap();// Your app logic here
const variables = client.getVariables();
console.log(`Found ${variables.length} variables`);// Example: export variable data
const data = await client.exportVariableToCsv('Revenue', {
query: 'Revenue',
dimensions: ['Months', 'Years', 'Products']
});
console.log(data);
No Hardcoded Credentials
When using the CLI, new FarseerClient() with no arguments is all you need. The CLI automatically injects credentials via environment variables (TENANT_ID, FARSEER_URL, FARSEER_API_KEY or FARSEER_ACCESS_TOKEN) when running locally.
Initializing the Tag Map
Most operations require the tag map to be initialized first. This loads variables, dimension tables, and members into memory:
await client.initializeTagMap();
Call this once at the start of your script. Results are cached for the duration of execution.
Common Operations
Operation | Method |
List variables |
|
List dimension tables |
|
Load dimension data |
|
Export variable to CSV |
|
Create an import job |
|
Evaluate a formula |
|
Upload a file |
|
List users |
|
For the complete SDK reference with detailed examples, see the Farseer Client Documentation.
Running Apps Locally
The CLI can run apps locally with automatic credential injection — no need to configure FarseerClient constructors manually.
Running an App
Run a configured app by name:
farseer run My Import App
You can pass arguments to override the app's default parameters:
farseer run My Import App --arg "Year=2025" --arg "Mode=full"
Running a Script Directly
Run any script file without a configured app wrapper:
farseer run-script files/Scripts/my-script.ts
Both commands inject credentials automatically and execute the script using tsx from your tenant's working directory.
Syncing Files with Farseer
The CLI provides a Git-like workflow for keeping local scripts in sync with the Farseer instance.
Pulling Changes
Download the latest files and app configurations from the remote instance:
farseer pull
Use --all to include all file types (not just scripts):
farseer pull --all
Pushing Changes
Upload your local changes back to Farseer:
farseer push
The CLI shows a diff summary and asks for confirmation before uploading. Use -y to skip the confirmation prompt.
Checking Status and Diffs
See what has changed locally vs. remotely:
farseer status
View a specific file's diff:
farseer diff Scripts/my-script.ts
Conflict Resolution
When both local and remote versions of a file have changed, the CLI detects the conflict and offers interactive resolution options: keep local, keep remote, or keep both (creating a .remote copy for manual merging).
Managing Apps from the CLI
Manage the full lifecycle of Farseer Apps without opening the browser.
Command | Description |
| List all apps on the current tenant |
| View app details (entrypoint, arguments, actions) |
| Create a new app |
| Set the app's entrypoint script |
| Add a default argument |
| Delete an app (requires |
Inspecting the Model
The CLI provides read access to the entire model structure — useful for understanding the data model before writing scripts.
Variables
# List all variables farseer variables list# Get details for a specific variable (dimensions, formula, rollup type) farseer variable details Revenue# Export variable data to CSV farseer variable export Revenue --format csv --output revenue.csv
Dimensions
# List all dimension tables farseer dimensions list# Get table details with members farseer dimension details Products --members 50# List members of a table farseer dimensions members Products
Full Model Export
# Export the entire model structure as JSON farseer model --json
Sheets and Dashboards
# List sheets and dashboards farseer sheets list farseer dashboards list# Get sheet data farseer sheets data "Revenue Plan"# Get dashboard configuration farseer dashboards show "Management Report" --tiles
Formulas and Cells
# Evaluate a formula expression farseer formula eval "sum(Revenue)" --filter "Years=2025"# Query cell values farseer cells query --variable Revenue --dimension "Products=Widget A" --dimension "Years=2025"# Update a cell value farseer cells update --variable Revenue --dimension "Products=Widget A" --dimension "Months=Jan" --value 50000
AI Integration (MCP)
The Farseer CLI includes a built-in MCP server (Model Context Protocol) that allows AI assistants like Claude, Cursor, and Claude Code to interact with Farseer directly.
Setting Up MCP
Add the following to your AI assistant's MCP configuration file:
{
"mcpServers": {
"farseer": {
"command": "farseer",
"args": ["mcp-server"]
}
}
}AI Assistant | Config File Location |
Claude Desktop |
|
Cursor |
|
Claude Code |
|
Or simply ask Claude: "Set up farseer MCP server" — it will configure everything automatically.
What AI Can Do
With MCP enabled, your AI assistant has access to 30+ tools covering:
Sync — pull, push, status, diff files
Apps — list, create, configure, run, and delete apps
Model — export model, list variables/tables, get details, create/update variables and dimension members
Data — export variable data, create import jobs, upload files
Sheets & Dashboards — list, inspect, read and write sheet data
Cells — query and update individual cell values
This means you can ask your AI assistant to do things like:
"Inspect the model and write me an import script for sales data"
"Export Revenue data for 2025 as CSV"
"Create a new app called Data Sync and configure it to run my-script.ts"
"What variables use the Products dimension?"
Farseer Client SDK
The farseer-client TypeScript SDK is the foundation for all Farseer Apps. It provides type-safe access to the full Farseer API with high-level abstractions for common operations.
Feature | Details |
API Coverage | 37 API modules with 469+ TypeScript models |
Data Processing | Built-in Arquero integration for data transformation |
Authentication | Environment variable auto-config, direct constructor, or custom config object |
Bundled Libraries | Arquero, Axios, ExcelJS, MSSQL driver |
Requirements | Node.js ≥ 18, TypeScript ≥ 5.0 recommended |
For the complete API reference, guides, and code examples, visit the Farseer Client Documentation.
Quick Reference
Getting Started
npm install -g farseer-cli # Install the CLI farseer login # Authenticate via browser farseer checkout my-org my-tenant # Select a tenant farseer install # Install npm dependencies farseer pull # Download files and apps
Daily Development Workflow
farseer pull # Get latest from remote # ... edit scripts in your editor ... farseer status # See what changed farseer run My App # Test locally farseer push # Upload changes to Farseer
All Commands
Category | Commands |
Auth |
|
Tenant |
|
Sync |
|
Apps |
|
Variables |
|
Dimensions |
|
Sheets |
|
Dashboards |
|
Cells |
|
Formula |
|
Model |
|
AI |
|
Troubleshooting
Issue | Solution |
Authentication expired | Run |
App management not working with API key | App management requires browser login (OAuth). Run |
Push rejected | Remote has changes you don't have locally. Run |
| Make sure you're running via |
MCP server not responding | Verify the CLI is installed globally ( |
