altium-cli 0.1.5

CLI tool for inspecting and manipulating Altium Designer files
altium-cli-0.1.5 is not a library.

altium-cli

CLI tool for inspecting and manipulating Altium Designer files.

Installation

cargo install altium-cli

Usage

Inspect File Structure

View component information in a library or document:

# Replace with your actual file paths
altium-cli inspect path/to/components.SchLib
altium-cli inspect path/to/footprints.PcbLib

Query Records

Find components, nets, and pins using selector syntax:

# Find all resistors (replace design.SchDoc with your file)
altium-cli query path/to/design.SchDoc "R*"

# Find components by part number
altium-cli query path/to/components.SchLib "$LM358"

# Find nets by name
altium-cli query path/to/design.SchDoc "~VCC"

# CSS-like queries
altium-cli query path/to/components.SchLib "component[part*=7805]"

Edit Schematic

Modify schematic documents:

# Move component to new position (coordinates in mils)
altium-cli edit path/to/design.SchDoc -c "move U1 1000 2000" -o output.SchDoc

# Delete component
altium-cli edit path/to/design.SchDoc -c "delete R3" -o output.SchDoc

Create Files

# Create a blank schematic document
altium-cli schdoc create path/to/new.SchDoc

# Create a SchDoc from a template
altium-cli schdoc create path/to/new.SchDoc --template path/to/template.SchDoc

# Create a blank schematic library
altium-cli schlib create path/to/new.SchLib

# Create a blank PCB footprint library
altium-cli pcblib create path/to/new.PcbLib

Output Formats

# Replace file.SchLib with your actual file path
altium-cli inspect path/to/file.SchLib --json        # Compact JSON
altium-cli inspect path/to/file.SchLib --pretty      # Pretty JSON

Shell Completions

altium-cli completions bash > altium-cli.bash
source altium-cli.bash

Library Usage

For library usage, see altium-format.