Configuration

Environment

Environment variables and configuration options.

Overview

Thesis uses environment variables for configuration. Most variables have sensible defaults for local development.

Frontend Variables

Set in apps/frontend/.env.local. All frontend variables must be prefixed with NEXT_PUBLIC_ to be accessible in the browser.

VariableDefaultDescription
NEXT_PUBLIC_JUPYTER_BASE_URLhttp://localhost:8888Jupyter server URL for REST API
NEXT_PUBLIC_JUPYTER_WS_URLws://localhost:8888Jupyter WebSocket URL
NEXT_PUBLIC_AGENT_API_URLhttp://localhost:4242Agent backend URL

Tip

In most cases, you don't need to set these. The frontend automatically uses window.location.origin and auto-detects the WebSocket protocol.

Backend Variables

The backend (apps/thesis) uses these environment variables:

VariableDefaultDescription
PORT4242Server listening port
JUPYTER_BASE_URLhttp://localhost:8888Jupyter kernel server
JUPYTER_TOKEN(empty)Jupyter authentication token
JUPYTER_ROOT_DIR./Root directory for notebooks

CLI Configuration

The CLI stores configuration in your system config directory using the conf package:

  • macOS: ~/Library/Preferences/thesis-nodejs/
  • Linux: ~/.config/thesis-nodejs/
  • Windows: %APPDATA%\thesis-nodejs\

Stored values:

  • openai_api_key - Your OpenAI API key (required)
  • thesis_api_key - Thesis API key (optional)
  • model - Default model preference

Use thesis auth login to configure your API key.

Default Ports

ServicePortNotes
Frontend3000Next.js dev server
Thesis Notebook8888Main application
Jupyter Server8898Backend kernel server
Agent Server4242NestJS backend

The CLI automatically finds available ports if defaults are in use.