Terminal Client

Last updated: 2026-02-08

Terminal Client

This page documents the interactive terminal client for stopcyberviolences-chatbot.

Location

  • CLI entrypoint: cli/cli_chat.py
  • Client wrapper: cli/chat_client.py

Prerequisites

  • A running backend API (the CLI talks to the backend over HTTP).
  • Python deps installed for this repo.

Run

--base-url is required.

# From the repo root
python cli/cli_chat.py --base-url http://localhost:8000

Authentication

You can pass a bearer token either via flag or environment variable:

# Option A: flag
python cli/cli_chat.py --base-url http://localhost:8000 --token "$STOPCHAT_TOKEN"

# Option B: env var
export STOPCHAT_TOKEN="..."
python cli/cli_chat.py --base-url http://localhost:8000

Common options

python cli/cli_chat.py \
  --base-url http://localhost:8000 \
  --monster betty \
  --language en

Defaults: --monster betty and --language en.

Using the REPL

When you start the CLI, it opens an interactive prompt.

  • Type /help to see all commands.
  • Type /reset to create a new UUID4 user id and start a new session.
  • Type /init <user_id> <monster> <language> to initialize explicitly.
  • Type /send <message> to send a message (requires an active session).
  • Type /end (or press Ctrl+C) to quit.

Command reference (from /help)

  • /reset [user_id] [monster] [language] — reset session; generates UUID4 if not provided.
  • /init [user_id] [monster] [language] — initialize a session (defaults: new UUID4, monster=betty, language=en).
  • /send <message> — send a message.
  • /emotion <emotion> — submit emotion selection.
  • /dropdown <selection> — submit dropdown selection.
  • /upload <file1> [file2 ...] — upload files.
  • /transcribe <audio_file> — transcribe audio.
  • /delete-summary <user_id> — delete user summary.
  • /getfile <filename> [dest_path] — download uploaded file.
  • /help — show help.
  • /end — quit.

Troubleshooting

  • Import errors when running: run the command from the repository root (python cli/cli_chat.py ...).
  • 401/403 errors: pass --token or set STOPCHAT_TOKEN.
  • “No active session”: run /reset or /init before sending messages.