ɳSelfɳSELFDOCS

Service Management Commands

Updated for ɳSelf v0.4.8

The nself service command provides unified management for all optional services in nself. It consolidates individual service commands into a single coherent interface for email, search, functions, MLflow, storage, cache, and metrics.

Service Management Features

  • - 7 Optional Services: Email, Search, Functions, MLflow, Storage, Cache, Metrics
  • - Unified Interface: Consistent commands across all services
  • - Multiple Providers: Each service supports multiple backends

Optional Services Overview

ServiceDescriptionEnable Variable
nself-adminWeb management UINSELF_ADMIN_ENABLED=true
MinIOS3-compatible storageMINIO_ENABLED=true
RedisCache and sessionsREDIS_ENABLED=true
FunctionsServerless runtimeFUNCTIONS_ENABLED=true
MLflowML experiment trackingMLFLOW_ENABLED=true
MailPitDevelopment emailMAILPIT_ENABLED=true
MeiliSearchFull-text searchMEILISEARCH_ENABLED=true

General Operations

nself service list

List all available services and their status:

nself service list

# Output:
# Optional Services
# =================
# SERVICE         STATUS      PORT      URL
# nself-admin     enabled     3001      admin.local.nself.org
# minio           enabled     9000      minio.local.nself.org
# redis           enabled     6379      -
# functions       enabled     5555      functions.local.nself.org
# mlflow          disabled    -         -
# mailpit         enabled     8025      mail.local.nself.org
# meilisearch     enabled     7700      search.local.nself.org

nself service status

Check detailed service status:

nself service status [service]

# All services
nself service status

# Specific service
nself service status redis

# Example output:
# Redis Status
# ============
# Status: Running
# Container: myapp_redis
# Port: 6379
# Memory Usage: 45MB / 256MB
# Connected Clients: 3
# Keys: 1,247
# Uptime: 2d 4h 32m

nself service enable / disable

Enable or disable a service:

# Enable a service
nself service enable <service>
nself service enable mlflow

# Output:
# Enabling MLflow...
#   Adding MLFLOW_ENABLED=true to .env
#   Rebuilding configuration...
#   Starting MLflow container...
# MLflow enabled and running at: http://mlflow.local.nself.org

# Disable a service
nself service disable <service>
nself service disable mlflow

# Note: Rebuild after changes
nself build
nself restart

nself service restart

Restart a specific service:

nself service restart <service>

# Example
nself service restart redis

nself service logs

View service logs:

nself service logs <service>

# Example
nself service logs meilisearch

Email Service

Configure email delivery with development (MailPit) and production providers.

nself service email config

Show email configuration:

nself service email config

# Output:
# Email Configuration
# ===================
# Provider: mailpit (development)
# SMTP Host: mailpit
# SMTP Port: 1025
# Web Interface: http://mail.local.nself.org
#
# Production providers available:
#   - sendgrid
#   - mailgun
#   - ses
#   - smtp

nself service email test

Send a test email:

nself service email test

# Output:
# Sending test email...
# To: test@example.com
# From: noreply@local.nself.org
# Subject: ɳSelf Test Email
#
# Email sent successfully!
# View in MailPit: http://mail.local.nself.org

nself service email inbox

Open MailPit inbox in browser:

nself service email inbox
# Opening MailPit inbox in browser...

Search Service

Configure full-text search with MeiliSearch.

nself service search index

Reindex data:

# Reindex all data
nself service search index

# Output:
# Indexing data to MeiliSearch...
#   users: 1,247 documents indexed
#   products: 5,892 documents indexed
#   posts: 3,421 documents indexed
# Indexing complete!

# Index specific table
nself service search index --table products

nself service search query

Run a search query:

nself service search query <term>

# Example
nself service search query "ergonomic keyboard"

# Output:
# Search Results (23 matches)
# ===========================
# 1. Ergonomic Mechanical Keyboard Pro (score: 0.95)
# 2. Split Ergonomic Keyboard (score: 0.89)
# 3. Wireless Ergonomic Keyboard Set (score: 0.84)

nself service search stats

Show index statistics:

nself service search stats

# Output:
# MeiliSearch Statistics
# ======================
# Indexes: 3
# Total Documents: 10,560
# Database Size: 45MB
# Last Update: 2 minutes ago
#
# INDEX          DOCUMENTS   SIZE
# users          1,247       5MB
# products       5,892       28MB
# posts          3,421       12MB

Serverless Functions

Deploy and manage serverless functions with multiple runtimes.

nself service functions deploy

Deploy functions:

nself service functions deploy

# Output:
# Deploying functions...
#   ✓ sendWelcomeEmail
#   ✓ processPayment
#   ✓ generateReport
#   ✓ resizeImage
#
# 4 functions deployed successfully

nself service functions invoke

Invoke a function:

nself service functions invoke <name> [--data <json>]

# Example
nself service functions invoke sendWelcomeEmail --data '{"userId": 123}'

# Output:
# Function: sendWelcomeEmail
# Status: Success
# Duration: 245ms
# Response:
# {
#   "sent": true,
#   "messageId": "msg_abc123"
# }

nself service functions list

List deployed functions:

nself service functions list

# Output:
# NAME      RUNTIME    TRIGGER    STATUS
# my-api    ts         http       running
# worker    python     queue      running
# cron-job  ts         scheduled  running

nself service functions logs

View function logs:

nself service functions logs <name> [-f]

# Follow logs
nself service functions logs sendWelcomeEmail -f

# Output:
# [2026-01-23 10:30:15] INFO: Function invoked
# [2026-01-23 10:30:15] INFO: Fetching user 123
# [2026-01-23 10:30:16] INFO: Sending email to user@example.com
# [2026-01-23 10:30:16] INFO: Email sent: msg_abc123

ML Tracking (MLflow)

Machine learning experiment tracking with MLflow.

nself service mlflow ui

Open MLflow UI in browser:

nself service mlflow ui
# Opening MLflow UI in browser...
# URL: http://mlflow.local.nself.org

nself service mlflow experiments

List experiments:

nself service mlflow experiments

# Output:
# MLflow Experiments
# ==================
# ID   NAME                    RUNS   LAST RUN
# 1    Default                 12     2026-01-22
# 2    image-classification    45     2026-01-23
# 3    price-prediction        28     2026-01-21

nself service mlflow runs

List runs for an experiment:

nself service mlflow runs [--experiment <name>]

# Example
nself service mlflow runs --experiment image-classification

# Output:
# Recent Runs
# ===========
# RUN ID          STATUS      ACCURACY    LOSS      DURATION
# abc123          FINISHED    0.945       0.124     5m 32s
# def456          FINISHED    0.932       0.156     4m 18s
# ghi789          FAILED      -           -         2m 05s

nself service mlflow artifacts

Browse artifacts:

nself service mlflow artifacts

Object Storage (MinIO)

S3-compatible object storage management.

nself service storage buckets

Manage buckets:

# List buckets
nself service storage buckets

# Output:
# MinIO Buckets
# =============
# BUCKET          OBJECTS     SIZE        CREATED
# uploads         1,247       2.3GB       2026-01-15
# backups         45          15.6GB      2026-01-10
# public          892         456MB       2026-01-18

nself service storage upload

Upload a file:

nself service storage upload <file> --bucket <bucket>

# Example
nself service storage upload ./image.jpg --bucket uploads

# Output:
# Uploading image.jpg to uploads...
#   Size: 2.4MB
#   Progress: 100%
# Uploaded: uploads/image.jpg
# URL: http://minio.local.nself.org/uploads/image.jpg

nself service storage download

Download a file:

nself service storage download <bucket>/<path> <local>

# Example
nself service storage download uploads/image.jpg ./image.jpg

nself service storage presign

Generate a presigned URL:

nself service storage presign <bucket>/<path> [--expires <duration>]

# Example
nself service storage presign uploads/report.pdf --expires 1h

# Output:
# Presigned URL (valid for 1 hour):
# https://minio.local.nself.org/uploads/report.pdf?X-Amz-...

Cache (Redis)

Redis cache and session management.

nself service cache stats

Show Redis statistics:

nself service cache stats

# Output:
# Redis Statistics
# ================
# Version: 7.2.4
# Uptime: 2d 4h 32m
# Memory Used: 45MB / 256MB
# Connected Clients: 3
# Total Keys: 1,247
# Ops/sec: 156
# Hit Rate: 94.2%

nself service cache flush

Flush the cache:

nself service cache flush [--confirm]

# Output:
# WARNING: This will delete all cached data.
# Continue? [y/N]: y
# Flushing Redis cache...
# Cache flushed successfully

# Flush specific pattern
nself service cache flush "session:*"

nself service cache keys

List cache keys:

nself service cache keys [pattern]

# Examples
nself service cache keys           # All keys
nself service cache keys "user:*"  # User keys only

# Output:
# Keys matching 'user:*'
# ======================
# user:123:session
# user:123:preferences
# user:456:session
# user:789:cart
# ...
# (showing 10 of 1,247 keys)

Metrics Service

Monitoring and observability stack management.

nself service metrics enable

Enable a monitoring profile:

nself service metrics enable <profile>

# Profiles:
# minimal  - 4 services (~500MB): Prometheus, Grafana, Node Exporter, cAdvisor
# standard - 7 services (~1GB): + Loki, Promtail, Alertmanager
# full     - 10 services (~2GB): + Tempo, Postgres Exporter, Redis Exporter
# auto     - Auto-detect based on ENV

# Examples
nself service metrics enable minimal
nself service metrics enable standard
nself service metrics enable full

nself service metrics status

Show metrics status:

nself service metrics status

# Output:
# Profile: standard
# Services: 7/7 running
# Memory: ~850MB
# Scrape Targets: 12 healthy

Environment Variables

Each service can be configured via environment variables:

# Email
EMAIL_PROVIDER=sendgrid
SENDGRID_API_KEY=SG.xxx

# Search
SEARCH_PROVIDER=meilisearch
MEILISEARCH_API_KEY=xxx

# Functions
FUNCTIONS_RUNTIME=nodejs20

# MLflow
MLFLOW_TRACKING_URI=http://mlflow:5000

# Storage
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=minioadmin

# Cache
REDIS_URL=redis://redis:6379

Example Workflows

Development Setup

# Enable development services
nself service enable mailpit
nself service enable meilisearch
nself service enable redis

# Check status
nself service list

# Test email
nself service email test

Production Setup

# Configure production email
nself service email config --provider sendgrid

# Enable production services
nself service enable redis
nself service enable meilisearch
nself service enable functions

# Deploy functions
nself service functions deploy

Next Steps

  • Core Commands - Basic CLI operations
  • Database Commands - Database management
  • Deployment Commands - Deployment workflows