Your privacy, your choice

We use optional analytics and advertising tools (including Meta Pixel and Google Ads on sign-up) only with your consent. Essential language and security functions always remain active. Privacy Policy

moreflow from the command line

@moreflow/cli runs the same operations as the moreflow MCP server from your terminal. Find an operation, read its contract, call it with JSON. Built for scripts, CI jobs, bulk exports and coding agents that work in a shell.

Current version: @moreflow/cli@0.1.0Full developer guide

Install

Run it without installing:

npx @moreflow/cli@0.1.0

Or install it globally:

npm install -g @moreflow/cli@0.1.0

Quickstart

  1. Install the CLI

    This puts the moreflow command on your PATH. Without installing, put npx @moreflow/cli in front of each command instead.

    npm install -g @moreflow/cli@0.1.0
  2. Sign in

    A browser window opens. Sign in to moreflow, choose the workspace and decide which business areas the CLI may use and how much it may change without asking.

    moreflow auth login --oauth
  3. See what's there

    List the modules, such as clients, deals or invoices.

    moreflow modules
  4. Find an operation

    Search in plain words. You only see operations your sign-in allows.

    moreflow find send invoice
  5. Read its contract

    Input schema, example inputs, possible errors and whether a write needs confirmation.

    moreflow describe clients.create
  6. Call it

    Pass the input as JSON. List operations can follow every page for you.

    moreflow call clients.list '{"limit":5}'
    moreflow call clients.list --all --max-items 200

Sign-in options

Use your browser for your own machine and an API token for servers and CI. Saved credentials stay in a file only you can read.

  • Browser login

    Sign in through the browser; the person chooses what the CLI may do.

    moreflow auth login --oauth
  • API token profile

    Save an API token as a profile (asks for it, or reads stdin).

    moreflow auth login
  • API token in the environment

    Use a token for one shell without saving it.

    MOREFLOW_API_TOKEN
  • Profile selection

    Pick a saved profile per command; moreflow auth use sets the active one.

    --profile <name>

When several are set, a command uses them in this order:

  1. --profile
  2. MOREFLOW_API_TOKEN
  3. MOREFLOW_PROFILE
  4. the active profile

Environment variables

MOREFLOW_API_TOKEN
An API token for this shell.
MOREFLOW_PROFILE
The saved profile to use.
MOREFLOW_API_BASE_URL
Selects another environment (default https://api.moreflow.io).

CLI or MCP?

Both run the same moreflow operations with the same permissions. Pick by where the work happens.

CLIMCP server
Best forScripts, CI jobs, bulk exports, coding agents with a shellChat assistants such as Claude and ChatGPT
OutputJSON on stdout, ready for pipes, files and jqAnswers inside the chat
Large readsFollows every page of a list into a fileOne page per tool call
Sign-inBrowser login or a saved API tokenOAuth connector or API token
ErrorsStable exit codes for scriptsError messages for the assistant
Connect an AI assistant over MCP →

Command reference

Generated from the same spec as moreflow --help.

moreflow modules

List the operation modules.

Usage

moreflow modules

Prints { modules: [...] }: every module id. Pass one to moreflow find --module.

Examples

moreflow modules

moreflow find

Search operations.

Usage

moreflow find [query] [--module <id>] [--limit <n>]

Searches the operations this credential can see, best match first. Without a query it lists them by id. Prints { items, nextCursor }; each item has the id, name, summary, kind and effect.

Options

--module <id>
Only operations of this module.
--limit <n>
Page size (1 to 100).

Examples

moreflow find send invoice
moreflow find --module clients --limit 100

moreflow describe

Input, examples, errors and safety of one operation.

Usage

moreflow describe <operationId> [--related] [--full]

Prints the live contract of one operation: description, effect and whether it needs confirmation, the input JSON Schema, example inputs and declared errors with their recovery.

Options

--related
Adds relatedOperations and nextOperations.
--full
The complete discovery document, including the output schema.

Examples

moreflow describe clients.create
moreflow describe clients.create --related

moreflow call

Run an operation.

Usage

moreflow call <operationId> [input] [options]

Runs one operation. input is a JSON object: inline, @file, or - for stdin. Omit it for an operation without required input.

Options

--all
Read every page of a list. For a list operation: follow nextCursor and print every item on its own line.
--max-items <n>
With --all: stop after n items.
--idempotency-key <key>
The key of this write. The key of this write. The CLI generates one per call; pass the key a failure reported to repeat that call without running the write twice.
--confirm
Approve a write that requires confirmation. Approves a write that requires confirmation. Pass it only after the person you act for approved this exact change.
--approval-token <token>
Retry an approved agent action. The token a CONFIRMATION_REQUIRED failure returned, once that approval was granted in moreflow.

Examples

moreflow call clients.list '{"limit":5}'
moreflow call clients.list --all --max-items 200
moreflow call clients.create '{"firstName":"Ada","lastName":"Lovelace"}'

moreflow whoami

The account and grant the credential acts as.

Usage

moreflow whoami

Asks the API which account and grant the current credential acts as, and prints { profile, tokenSource, baseUrl, caller }. Run it before a write when more than one token is in play.

Examples

moreflow whoami

moreflow auth

Manage saved credential profiles.

Usage

moreflow auth login [--oauth [--no-browser]] [--profile <name>] [--base-url <url>]
moreflow auth status
moreflow auth use <profile>
moreflow auth logout [--profile <name>]

Saved credential profiles, kept in a file only you can read.

Options

--oauth
Sign in through the browser instead of saving an API token.
--no-browser
With --oauth: print the URL instead of opening it.

Subcommands

moreflow auth login --oauth
Signs in through the browser. The person signs in to moreflow, picks the account and business areas, and how much the CLI may do without asking; writes beyond that wait for their approval. The login refreshes itself. --no-browser only prints the URL (on stderr), for a machine without a browser: the redirect still returns to this machine.
moreflow auth login
Without --oauth: saves an API token. Reads it from the terminal without echoing it, or from stdin: printf %s "$TOKEN" | moreflow auth login. Every credential is checked against the API before it is saved, and its profile (default: default) becomes the active one.
moreflow auth status
Lists the profiles and the active one. Never prints a token.
moreflow auth use
Makes a saved profile the active one.
moreflow auth logout
Forgets a saved credential. A browser login is also ended on the server; revoke an API token in moreflow to end it.

A command uses, in this order: --profile, MOREFLOW_API_TOKEN, MOREFLOW_PROFILE, the active profile.

Examples

moreflow auth login --oauth
moreflow auth login --oauth --profile dev --base-url https://dev-api.moreflow.io
moreflow auth status
moreflow auth use dev
moreflow auth logout --profile dev

Global options

--profile <name>
The saved profile to use; overrides MOREFLOW_API_TOKEN.
--base-url <url>
Overrides MOREFLOW_API_BASE_URL and the profile's URL.
--timeout-ms <n>
Time limit per request (default 60000).
--max-retries <n>
Retries after a 429, a 5xx or a network failure (default 2).
--help
Print the overview, or one command’s reference.
--version
Print the CLI version.

Exit codes

Scripts can branch on the exit code instead of parsing error text.

CodeCategoryMeaning
0OKSuccess
1INTERNALInternal error
2USAGEWrong command line; nothing was sent
3UNAUTHENTICATEDUnauthenticated
4PERMISSION_DENIEDPermission denied (scope, plan or policy)
5NOT_FOUNDNot found
6INVALID_ARGUMENTInvalid argument
7FAILED_PRECONDITIONFailed precondition, including a required confirmation
8CONFLICTConflict
9RESOURCE_EXHAUSTEDRate or quota limit
10UNAVAILABLEUnavailable (network, timeout or server failure)

Questions

What is the moreflow CLI?

@moreflow/cli is moreflow's official command-line tool. It calls the moreflow operations API from a shell: the same operations an AI assistant uses over MCP, with JSON in and JSON out.

Do I need the CLI if I already use the MCP server?

Not for chatting. The MCP server is the better fit for Claude, ChatGPT and other chat assistants. The CLI is for work a chat can't do well: exporting thousands of records into a file, scheduled scripts, CI jobs, and coding agents that already work in a terminal.

Is it safe to let an agent run it?

Yes, within the limits you set. At sign-in you choose the business areas and how much the CLI may change without asking. A write that needs confirmation stops with exit code 7 until you approve it, and every write carries an idempotency key, so you can repeat a failed write without running it twice.

Does the CLI cost extra?

No. API, MCP and CLI access are included in every moreflow plan, including the 14-day free trial.

What do I need to run it?

Node.js with npm. Run it with npx, or install it globally with npm, then sign in with your browser or an API token.

No moreflow account yet?

Start a 14-day free trial. API, MCP and CLI access are included in every plan.