Traffic4SEO CLI Usage Guide

Traffic4SEO CLI is a powerful command-line tool that allows you to execute automated SEO workflows on servers or personal computers without a graphical interface.



Quick Installation

Linux

curl -fsSL https://traffic4seo.com/install-cli | bash

{warning} Linux Prerequisites:

  1. You must have unzip installed to extract the browser.
  2. On a headless Linux Server (VPS), you must install Chromium system dependencies to avoid browser crash on startup:
    • Ubuntu / Debian:
        sudo apt-get update && sudo apt-get install -y unzip libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2 libpango-1.0-0 libcairo2 libx11-xcb1 libxcb-dri3-0 libxshmfence1
    • CentOS / RHEL / Rocky Linux:
        sudo dnf install -y unzip nss nspr atk at-spi2-atk cups-libs libdrm libxkbcommon libXcomposite libXdamage libXfixes libXrandr mesa-libgbm alsa-lib pango cairo libX11-xcb libxcb libxshmfence

Windows (PowerShell)

irm https://traffic4seo.com/install-cli.ps1 | iex

Basic Usage

After installation, simply type a single command to start:

t4s-cli

1. Login (First-time use)

If this is your first time running the CLI, the system will prompt you for an Access Token.

  1. Visit the Traffic4SEO dashboard to obtain your Token.
  2. Paste the Token into the terminal when prompted.
  3. The system will remember your login for 30 days.

2. Automatic Browser Installation

During the first run, if a suitable browser is not found, the CLI will ask: "Do you want to download the Bundled Chromium? (y/n)" Simply type y and the system will automatically download and configure everything.


Advanced Options

The CLI supports several parameters to customize your session:

Option Alias Default Description
--token -t Provide a Token directly (overwrites stored token)
--tabs 30 Number of concurrent browser tabs (max 30)
--headless true Set to false to show browser windows (GUI only)
--no-monitor Disable the TUI monitor interface for plain logs
--proxy -p Proxy Connection URI string (http://user:pass@host:port) (recommended)
--proxy-host -ph Proxy server Hostname or IP (legacy)
--proxy-port -pp Proxy server Port (legacy)
--proxy-type -pt http Proxy type (http, https, socks5) (legacy)
--memory 80 Target RAM percentage limit (1-99)
--only-warmup Initialize browser and cookies then exit
--force -f Force re-installation of bundled Chromium
--restart Restart CLI after specified minutes (must be a positive integer)

Advanced Configuration Example

Run CLI with 10 tabs and using a SOCKS5 Proxy via Proxy Connection URI:

t4s-cli --tabs=10 --proxy="socks5://user:[email protected]:1080"

Running in Background (Linux)

To keep the CLI running after closing the terminal (on a VPS), it is recommended to use Screen:

  1. Create a new session: screen -S t4s
  2. Run the command: t4s-cli
  3. Press Ctrl + A then D to detach.
  4. Re-attach at any time: screen -r t4s

Uninstallation

Remove the installation and configuration directories:

rm -rf ~/.t4s-cli
rm -rf ~/.config/t4s-cli

Troubleshooting

Update Lock Conflict (Stuck Update)

If you see the following warning during startup:

[AutoUpdater] ERROR: Update process seems to be stuck or failed!
Timeout waiting for lock directory: versions/vX.Y.Z.lock

This happens when a previous update process crashed or was terminated before it could finish and clean up its file locks.

Solution:

Ensure no other t4s-cli instances are currently running, then manually delete the lock directory:

Linux:

rm -rf ~/.t4s-cli/versions/*.lock

Windows (PowerShell):

Remove-Item -Path "$HOME\.t4s-cli\versions\*.lock" -Recurse -Force

Windows (CMD):

rmdir /s /q "%USERPROFILE%\.t4s-cli\versions\vX.Y.Z.lock"

Proxy Connection Retry & Exit Code 43

When operating under a Proxy network connection, initial API requests (Token verification, Instance initialization, and Instance start) may encounter transient connection issues. The CLI automatically retries every 5 seconds up to 3 times.

If connection failures persist after 3 retries:

  • The CLI logs the fatal network error and exits with exit code 43.
  • Exit code 43 signals process wrappers (PM2, systemd scripts, supervisor) to restart the CLI process and repeat the connection cycle.