Skip to content

CLI

@theneuralledger/cli provides the tnl command: read intelligence from a terminal, run the MCP server, or run a foreground sync daemon.

bash
npm install -g @theneuralledger/cli
export TNL_API_KEY=your_api_key

Or without installing:

bash
npx @theneuralledger/cli latest --limit 5

Environment

VariablePurpose
TNL_API_KEYAPI key. Required.
TNL_BASE_URLOverride the API base URL. Rarely needed.
TNL_STATE_DIRWhere serve keeps sync state.

Reading

bash
# Newest stories
tnl latest
tnl latest --limit 20

# Full text search
tnl search "tariff"
tnl search "central bank" --limit 50

# Stories touching an asset
tnl asset KRW
tnl asset BRENT --limit 10

Every read command takes --json, which is what makes the CLI useful in pipelines:

bash
# Headlines only
tnl latest --limit 50 --json | jq -r '.data[].title'

# Stories mentioning an impact path, as CSV
tnl search "oil" --limit 100 --json \
  | jq -r '.data[] | select(.impactPaths | length > 0) | [.publishedAt, .title] | @csv'

Without --json the output is formatted for reading and is not a stable interface — always use --json when scripting.

Account status

bash
tnl status
tnl status --json | jq '.data.plan, .data.usage'

Shows your plan, quota, and usage — the quickest way to check whether a failing integration has simply run out of quota.

MCP server

bash
tnl mcp

Runs the read-only MCP server over stdio, for AI clients that launch a subprocess. Configuration for specific clients is in MCP connecting.

Sync daemon

bash
tnl serve --interval 300 --state-dir ./tnl-state

Polls for new stories on an interval and keeps a local state directory so a restart resumes where it stopped rather than refetching everything.

bash
tnl serve --host 127.0.0.1 --port 8787 --interval 300

Options:

OptionMeaning
--interval <seconds>Poll interval
--state-dir <dir>Where sync state is kept
--host, --portBind address for the local HTTP surface
--onceRun a single sync and exit — good for cron
bash
# Cron-style single run
tnl serve --once --state-dir /var/lib/tnl

Prefer webhooks for freshness

serve polls. If you need stories within seconds and can expose an HTTPS endpoint, webhooks are faster and cheaper in quota. Use serve when you cannot accept inbound connections.

Docker

bash
docker run --rm -e TNL_API_KEY=$TNL_API_KEY \
  ghcr.io/bekirdag/tnl-intelligence tnl latest --limit 5

Useful in CI, where installing Node globally is not worth it.

The Neural Ledger API