Skip to main content

Command-line interface for NVIDIA Jetson setup and configuration

Project description

jetson-cli

A comprehensive Python CLI tool for setting up NVIDIA Jetson devices and building containerized AI/ML applications.

Overview

jetson-cli provides a streamlined, pure-Python interface for:

  • Analyzing and configuring Jetson hardware
  • Setting up development environments
  • Managing Docker, storage, power, and GUI configurations
  • Building and running containerized AI/ML applications

Features

Pure Python Implementation: No shell script dependencies
Comprehensive System Analysis: Hardware detection and configuration validation
Modular Architecture: Separate managers for different system components
Rich CLI Interface: Beautiful terminal output with progress indicators
Multiple Output Formats: Table, JSON, and YAML support
Interactive & Non-Interactive Modes: Flexible operation modes
Extensive Testing: Unit tests for all major functionality

Task list

  • Best practices compliation for jetson for humans and AI
    • tools
    • commands
    • configurations
  • docker images backup and restore scripts
  • GenAI integration on device, local or remote
  • Model inference setup recommendations
  • jetson-containers Package suite recommendations

Installation

From PyPI (Recommended)

pip install jetson-cli

From Source

git clone https://github.com/orinachum/jetson-cli.git
cd jetson-cli
pip install -e .

Quick Start

  1. Analyze your system:

    jetson-cli probe
    
  2. Initialize environment:

    jetson-cli init
    
  3. Complete setup:

    jetson-cli setup
    

Commands

System Analysis

jetson-cli probe                        # Show system configuration
jetson-cli probe --output json          # Output as JSON
jetson-cli probe --save config.yaml     # Save to file
jetson-cli probe --tests docker,swap    # Run specific tests only

Environment Setup

jetson-cli init                         # Create environment profile
jetson-cli init --profile-name dev      # Custom profile name
jetson-cli init --force                 # Overwrite existing profile

System Configuration

jetson-cli setup                        # Complete system setup
jetson-cli setup --skip-docker          # Skip Docker configuration
jetson-cli setup --interactive          # Interactive mode
jetson-cli setup --non-interactive      # Automated mode

Component Management

jetson-cli configure docker             # Configure Docker daemon
jetson-cli configure swap               # Setup swap file
jetson-cli configure ssd                # Configure SSD storage
jetson-cli configure power              # Power management settings
jetson-cli configure gui                # GUI environment setup

Status Monitoring

jetson-cli status                       # Show system status table
jetson-cli status --format json         # JSON output format

Configuration Components

Docker Management

  • Automatic Docker installation with NVIDIA runtime
  • Data directory migration to NVMe storage
  • User group configuration
  • Runtime optimization

Storage Management

  • NVMe SSD partitioning, formatting, and mounting
  • Swap file creation and configuration
  • zRAM management
  • Automatic size detection and validation

Power Management

  • Jetson power mode configuration
  • Thermal monitoring
  • Power consumption analysis
  • Interactive mode selection

GUI Management

  • Desktop environment enable/disable
  • Display configuration detection
  • Session management
  • Boot configuration

Python SDK

The CLI is built on a modular SDK that can be used programmatically:

from jetson_cli.sdk import SystemManager, DockerManager, StorageManager

# System analysis
system_manager = SystemManager()
results = system_manager.probe_system()
print(f"Platform: {results['platform']['machine']}")

# Docker configuration
docker_manager = DockerManager()
if not docker_manager.is_docker_installed():
    docker_manager.install_docker()

# Storage management
storage_manager = StorageManager()
storage_info = storage_manager.get_storage_info()

Examples

Complete Jetson Setup Workflow

# 1. Analyze hardware and software configuration
jetson-cli probe --save system-info.json

# 2. Create development environment profile
jetson-cli init --profile-name ml-dev

# 3. Configure the system for AI/ML development
jetson-cli setup

# 4. Verify everything is working
jetson-cli status

# 5. Configure specific components as needed
jetson-cli configure power  # Set optimal power mode
jetson-cli configure ssd    # Setup external storage

Selective Component Configuration

# Configure only Docker (skip other components)
jetson-cli configure docker

# Setup additional swap space
jetson-cli configure swap

# Configure external SSD storage
jetson-cli configure ssd --interactive

# Set power mode for maximum performance
jetson-cli configure power

System Analysis and Monitoring

# Comprehensive system probe
jetson-cli probe --output json --save analysis.json

# Monitor specific components
jetson-cli probe --tests docker_installed,nvme_mount,power_mode

# Check system status
jetson-cli status --format table

Architecture

jetson-cli/
├── jetson_cli/
│   ├── cli.py              # Click-based CLI interface
│   ├── utils.py            # Utility functions
│   └── sdk/                # Python SDK modules
│       ├── system.py       # System management
│       ├── docker.py       # Docker configuration
│       ├── storage.py      # Storage management
│       ├── power.py        # Power management
│       └── gui.py          # GUI configuration
├── tests/                  # Unit tests
└── docs/                   # Documentation

Key Components

  • CLI Interface: Rich terminal interface with progress indicators
  • SDK Modules: Modular Python classes for system management
  • Configuration Management: Environment-based configuration
  • Error Handling: Comprehensive error reporting and recovery
  • Testing Framework: Unit tests for all major functionality

Requirements

  • NVIDIA Jetson device (Nano, Xavier, Orin series)
  • JetPack 4.6+ or L4T R32.7+
  • Python 3.8+
  • Root privileges for system configuration

Development

Running Tests

# Run all tests
python -m unittest tests.test_sdk -v

# Run specific test
python -m unittest tests.test_sdk.TestSystemManager -v

Adding New Features

  1. Implement functionality in appropriate SDK module
  2. Add CLI command in cli.py
  3. Write unit tests in tests/
  4. Update documentation

Migrated from Shell Scripts

This version represents a complete migration from shell scripts to pure Python:

  • probe-system.shSystemManager.probe_system()
  • configure-docker.shDockerManager.setup_docker()
  • configure-swap.shStorageManager.setup_swap_file()
  • configure-ssd.shStorageManager.configure_nvme_ssd()
  • configure-power-mode.shPowerManager.set_power_mode()
  • configure-system-gui.shGUIManager.configure_gui()
  • create-env-profile.shSystemManager.create_env_profile()

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

jetson_cli-0.7.0.tar.gz (58.8 kB view details)

Uploaded Source

Built Distribution

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

jetson_cli-0.7.0-py3-none-any.whl (32.8 kB view details)

Uploaded Python 3

File details

Details for the file jetson_cli-0.7.0.tar.gz.

File metadata

  • Download URL: jetson_cli-0.7.0.tar.gz
  • Upload date:
  • Size: 58.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for jetson_cli-0.7.0.tar.gz
Algorithm Hash digest
SHA256 4cb4206d6acd5468b2cb6d03b33cb6d92a6df816add6dfd6ca4b6ceb66d53f0b
MD5 5fbdc314902cd92c171e2184ecf6db21
BLAKE2b-256 8b47514537598e0b19250c01499abfb6858c7ee90a4e3d6171a4ee2147297a0b

See more details on using hashes here.

File details

Details for the file jetson_cli-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: jetson_cli-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 32.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for jetson_cli-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5fb5cdfb803a983b8c776b05e94749a9db939bdf5d327d98abac4779bac07f79
MD5 b3d271a2ab798ff23fcc14321d1d0e56
BLAKE2b-256 f039d9cb8d6891423e9081bea8ec75aa0a9729f3136bee23deeab247026b54f2

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