Skip to main content

Terminal interface for Laurelin nuclear fusion chat platform

Project description

Laurelin CLI

PyPI version Python 3.8+ License: MIT

Access Laurelin's AI-powered nuclear fusion research assistant directly from your terminal.

Laurelin CLI is a command-line interface for the Laurelin nuclear fusion chat platform. Chat with specialized AI models trained on plasma physics, fusion engineering, and nuclear science research - all from the comfort of your terminal.


Features

  • AI-Powered Fusion Research - Access Laurelin's specialized AI models for nuclear fusion research
  • Interactive Chat Mode - Natural conversation flow with context-aware responses
  • Session Management - Continue previous conversations seamlessly across sessions
  • Secure Token Authentication - CLI token-based authentication with automatic refresh
  • Progress Indicators - Real-time visual feedback for API requests
  • Color-Coded Terminal Output - Easy-to-read, syntax-highlighted interface
  • Production & Development Modes - Switch between production and local development APIs
  • ITAR/EAR Compliant - US location verification for controlled technology access

Installation

From PyPI (Recommended)

pip install laurelin-cli

From Source

git clone https://github.com/laurelin-inc/laurelin-cli.git
cd laurelin-cli
pip install -e .

Requirements

  • Python 3.8 or higher
  • Active internet connection
  • Laurelin account with CLI access enabled

Quick Start

1. Get Your CLI Tokens

Visit the Laurelin API Access page to generate your CLI tokens:

https://chat.laurelin-inc.com/api-access

Access Requirements:

  • Active paid subscription (Basic or Enterprise tier)
  • US location verification (ITAR/EAR compliance)
  • Admin users have unrestricted access

2. Login

Authenticate with your CLI tokens:

laurelin login

You'll be prompted to enter your access token and refresh token. These are stored securely in ~/.laurelin/credentials.json with user-only permissions (chmod 600).

3. Start Chatting

Ask questions about nuclear fusion research:

# Single question
laurelin chat "What is the plasma density in a tokamak reactor?"

# Interactive mode
laurelin chat --interactive

# Continue a previous session
laurelin chat -s abc123 "What about magnetic field strength?"

Usage

Authentication Commands

laurelin login

Authenticate with your CLI access tokens.

Options:

  • --production - Use production API endpoint (default)
  • --dev - Use development API endpoint (localhost:8080)

Example:

# Production login
laurelin login --production

# Development login (for local testing)
laurelin login --dev

laurelin logout

Clear stored authentication tokens and log out.

laurelin logout

laurelin status

Display current authentication status and configuration.

laurelin status

Output:

Laurelin CLI Status
==================================================
Authentication: ✅ Logged in
Credentials: /Users/joe/.laurelin/credentials.json

API Endpoint: https://api.laurelin-inc.com
Production Mode: True

Connection Test: ✅ Connected

Chat Commands

laurelin chat <message>

Send a message to Laurelin AI.

Arguments:

  • message - Your question or message (optional in interactive mode)

Options:

  • --interactive, -i - Start interactive chat session
  • --session SESSION_ID, -s SESSION_ID - Continue an existing conversation

Examples:

Single Question:

laurelin chat "Explain magnetic confinement fusion"

Interactive Mode:

laurelin chat --interactive
You> What is plasma confinement time?
Laurelin (gemini-pro): Plasma confinement time (τE) is a measure of how well
a fusion device retains energy in the plasma...

You> How does it relate to the Lawson criterion?
Laurelin (gemini-pro): The Lawson criterion establishes the minimum conditions...

Continue Previous Session:

laurelin chat -s abc12345 "What about inertial confinement?"

Exit Interactive Mode: Type exit, quit, or q to end the session.


Session Management

laurelin sessions

List your recent chat sessions with session IDs.

laurelin sessions

Output:

Your Chat Sessions
======================================================================

[abc12345] Tokamak plasma physics discussion
  Created: 2025-01-15

[def67890] ITER magnetic field configuration
  Created: 2025-01-14

Use session IDs to continue previous conversations:

laurelin chat -s abc12345 "Follow-up question"

Token Management

laurelin tokens

List all your active CLI tokens with usage information.

laurelin tokens

Output:

Active CLI Tokens
======================================================================

● My MacBook CLI Token
  ID: cli_a1b2c3d4...
  Created: 2025-01-10
  Last used: 2025-01-15

● Work Desktop Token
  ID: cli_e5f6g7h8...
  Created: 2025-01-12
  Last used: 2025-01-14

Configuration

Configuration Files

All configuration files are stored in ~/.laurelin/:

~/.laurelin/credentials.json

  • Stores access and refresh tokens
  • Permissions: 600 (user read/write only)
  • Automatically created on first login

~/.laurelin/config.json

  • CLI configuration settings
  • API endpoint preferences
  • Automatically managed by CLI

Environment Variables

LAURELIN_API_URL

  • Override the default API endpoint
  • Useful for testing or enterprise deployments
export LAURELIN_API_URL=https://custom-api.example.com
laurelin status

API Endpoints

Production (Default):

https://api.laurelin-inc.com

Development:

http://localhost:8080

Switch between environments using login flags:

# Production
laurelin login --production

# Development
laurelin login --dev

Security

Laurelin CLI implements multiple security measures:

  • Secure Token Storage - Credentials stored with 600 permissions (user-only access)
  • Automatic Token Refresh - Access tokens expire after 1 hour; refresh tokens automatically renew them
  • HTTPS Encryption - All production API communication uses HTTPS
  • Location Verification - US-only access enforcement for ITAR/EAR compliance
  • No Password Storage - Only tokens are stored locally; passwords never saved

Security Best Practices:

  • Never share your CLI tokens
  • Generate separate tokens for each device
  • Revoke unused tokens from the web interface
  • Use laurelin logout on shared machines

Admin Access

Admin users (Laurelin team members) have unrestricted CLI access:

Admin Privileges:

  • Bypass subscription requirements
  • Unrestricted token generation
  • Access to all CLI features
  • Development environment access

Current Admin Team:


Development

Local Development Setup

Install in development mode for testing:

# Clone repository
git clone https://github.com/laurelin-inc/laurelin-cli.git
cd laurelin-cli

# Install in editable mode
pip install -e .

# Login with development endpoint
laurelin login --dev

Testing Connection

Verify your setup:

# Check authentication status
laurelin status

# Test with a simple query
laurelin chat "Hello, Laurelin!"

# List your tokens
laurelin tokens

Running Local Backend

If developing against a local backend:

# Start local backend on port 8080
cd laurelin-chat-backend
python app/main.py

# In another terminal, use dev mode
laurelin login --dev
laurelin chat "Test message"

Troubleshooting

Common Issues

"Not authenticated" error:

# Solution: Login first
laurelin login

"Cannot connect to API" warning:

# Check your internet connection
# Verify API endpoint
laurelin status

# Try logging in again
laurelin logout
laurelin login --production

Token expired errors:

  • The CLI automatically refreshes tokens
  • If issues persist, login again: laurelin login

Permission denied on credentials file:

# Fix file permissions
chmod 600 ~/.laurelin/credentials.json

Examples

Research Workflow

# Start research session
laurelin chat -i

You> What is the Lawson criterion for fusion?
Laurelin: The Lawson criterion defines the minimum conditions...

You> Calculate it for deuterium-tritium fusion
Laurelin: For D-T fusion at 15 keV temperature...

You> exit

Quick Facts

# Single-shot questions
laurelin chat "What is ITER's planned Q value?"
laurelin chat "Explain the tokamak magnetic field configuration"
laurelin chat "What are the main challenges in fusion energy?"

Session Continuation

# Start new discussion
laurelin chat "Explain plasma instabilities"

# Later, continue the conversation
laurelin sessions  # Find session ID
laurelin chat -s abc123 "What about ELMs specifically?"
laurelin chat -s abc123 "How does ITER plan to handle them?"

Resources

Documentation

Support

Community

  • Join discussions about fusion research
  • Share your CLI workflows
  • Contribute to the project

License

MIT License

Copyright (c) 2025 Laurelin Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


About Laurelin

Laurelin is building the next generation of nuclear fusion research tools powered by artificial intelligence. Our platform helps researchers analyze plasma physics, design fusion experiments, and accelerate the path to commercial fusion energy.

Mission: Accelerate the development of fusion energy through AI-powered research tools.

Vision: Make fusion energy research more accessible, efficient, and collaborative.


Built with dedication by the Laurelin team

Advancing fusion energy, one conversation at a time.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

laurelin_cli-1.1.0.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

laurelin_cli-1.1.0-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file laurelin_cli-1.1.0.tar.gz.

File metadata

  • Download URL: laurelin_cli-1.1.0.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for laurelin_cli-1.1.0.tar.gz
Algorithm Hash digest
SHA256 f63156fe5f7b6fb8917bdf5148db45643e91d5db5a54afedd63919350e4dadfc
MD5 98fea9321eba07ba3ea6b1f54c09a8b3
BLAKE2b-256 49f7116d182f6600d4a95bbb5f0ca15c3fe512d44bfc0bef193648b7dae63916

See more details on using hashes here.

File details

Details for the file laurelin_cli-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: laurelin_cli-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for laurelin_cli-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f8a30a83ff5e460939ceb3ac57adf9dfb2fde95a8ebe96c547f8ca00eae61f39
MD5 dc61d918a43472a623a9800e66dd9ca0
BLAKE2b-256 07299f76bd27d1ca779f540c78cdb055d5b6e71aeb9e340a25d851354809509b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page