CLI Commands Reference
Complete reference for all OptixLog CLI commands.
optixlog init
Initialize OptixLog configuration.
optixlog init [options]Options
| Option | Description |
|---|---|
-p, --project <name> | Project name |
-k, --api-key <key> | API key |
--api-url <url> | API URL (default: https://backend.optixlog.com ) |
-l, --local | Save config locally (current directory) instead of home directory |
Examples
Basic initialization:
optixlog initWith project and API key:
optixlog init --project "MyProject" --api-key "proj_YOUR_KEY"Local config (for version control):
optixlog init --project "TeamProject" --localCustom API URL:
optixlog init --api-url "https://custom-backend.com"What It Does
- Checks if SDK is installed (offers to install if missing)
- Creates
.optixlog.jsonconfiguration file - Saves API key, project name, and API URL
- Shows next steps
Config File Location
- Local:
.optixlog.jsonin current directory (if--localflag used) - Global:
~/.optixlog.jsonin home directory (default)
optixlog config
Manage OptixLog configuration.
optixlog config [action] [key] [value]Actions
| Action | Description |
|---|---|
list (default) | List all configuration |
get <key> | Get specific config value |
set <key> <value> | Set config value |
Examples
List all config:
optixlog config
# or
optixlog config listGet specific value:
optixlog config get project
optixlog config get api_keySet values:
optixlog config set project "NewProject"
optixlog config set api_key "proj_NEW_KEY"
optixlog config set api_url "https://backend.optixlog.com"Output
List:
📋 OptixLog Configuration
api_url: https://backend.optixlog.com
api_key: ***abc12345
project: MyProject
Config file: /Users/username/.optixlog.jsonoptixlog add-logging
Auto-instrument Python code with OptixLog.
optixlog add-logging <file> [options]Arguments
| Argument | Description |
|---|---|
<file> | Path to .py or .ipynb file |
Options
| Option | Description |
|---|---|
--no-backup | Do not create backup file |
--smart | Use smart code generation with SDK helpers (local, no backend) |
Examples
Basic instrumentation:
optixlog add-logging script.pySmart mode (recommended):
optixlog add-logging script.py --smartNo backup:
optixlog add-logging script.py --no-backupJupyter notebook:
optixlog add-logging notebook.ipynbWhat Gets Added
Basic mode (backend transformation):
- Imports:
import optixlog,import os - Initialization code with
optixlog.run()oroptixlog.init() - Logging statements for metrics and plots
Smart mode (local transformation):
- Same as basic, plus:
- Uses SDK helper methods (
log_matplotlib(),log_plot(), etc.) - Wraps main code in context manager
- Adds helpful comments and suggestions
- Detects matplotlib usage and suggests helpers
Backup Files
By default, creates backup: script_backup.py or notebook_backup.ipynb
optixlog runs
List recent runs.
optixlog runs [options]Options
| Option | Description |
|---|---|
-p, --project <name> | Filter by project name |
-l, --limit <number> | Number of runs to show (default: 10) |
Examples
List last 10 runs:
optixlog runsList last 20 runs:
optixlog runs --limit 20Filter by project:
optixlog runs --project "MyProject"Combined:
optixlog runs --project "MyProject" --limit 5Output
🔍 Fetching runs...
Found 3 runs:
✓ experiment_1
ID: run_abc123
Project: MyProject
Created: 2025-11-24T10:30:00Z
✓ experiment_2
ID: run_def456
Project: MyProject
Created: 2025-11-24T11:45:00ZRequirements
- API key must be configured (via
optixlog initoroptixlog config set api_key)
optixlog check-sdk
Check if OptixLog SDK is installed in Python environment.
optixlog check-sdkExamples
optixlog check-sdkOutput
If installed:
🔍 Checking SDK installation...
✓ OptixLog SDK is installed
Version: 0.0.4If not installed:
🔍 Checking SDK installation...
⚠ OptixLog SDK is not installed
Install with:
optixlog install-sdk
or manually:
pip install http://optixlog.com/optixlog-0.0.4-py3-none-any.whloptixlog install-sdk
Install or upgrade OptixLog SDK.
optixlog install-sdkExamples
optixlog install-sdkWhat It Does
- Checks for local SDK path (for development)
- If found, installs from local:
pip install -e /path/to/sdk - Otherwise, installs from URL:
pip install http://optixlog.com/optixlog-0.0.4-py3-none-any.whl - Verifies installation with version check
Output
⚙ Installing OptixLog SDK...
This may take a moment...
Installing from local: /path/to/sdk
✓ SDK installed successfully!
Version: 0.0.4optixlog —version
Show CLI version.
optixlog --versionOutput:
0.2.0optixlog —help
Show help message.
optixlog --help
# or
optixlog help [command]Command Workflow Examples
Complete Setup Workflow
# 1. Initialize
optixlog init --project "MyProject" --api-key "proj_xxx"
# 2. Verify SDK
optixlog check-sdk
# If not installed:
optixlog install-sdk
# 3. Instrument code
optixlog add-logging script.py --smart
# 4. Run code
python script.py
# 5. View runs
optixlog runsTeam Collaboration Workflow
# Team member 1: Create shared config
optixlog init --project "TeamProject" --local
# Commit .optixlog.json (without API key)
# Team member 2: Set their API key
optixlog config set api_key "proj_their_key"
# Both: Instrument and run
optixlog add-logging shared_code.py
python shared_code.pyBatch Processing Workflow
# Instrument multiple files
for file in *.py; do
optixlog add-logging "$file" --smart
done
# Run all
for file in *.py; do
python "$file"
done
# View all runs
optixlog runs --limit 50Next Steps
- Examples - See transformation examples
- Advanced Usage - CI/CD, batch processing
- Troubleshooting - Common issues