CLI Documentation

Xây dựng nhanh hơn với Source Parts CLI

Cài đặt, xác thực và tự động hóa toàn bộ quy trình mua hàng của bạn với bộ công cụ dòng lệnh tập trung vào linh kiện của chúng tôi.

Cài đặt CLI cho môi trường của bạn

Sử dụng một lệnh để cài đặt trên macOS, Linux hoặc Windows và xác thực với Source Parts.

Copy a command to get started
Choose your operating system
Run the command in your terminal and follow the prompts to authenticate with Source Parts.
curl -fsSL https://source.parts/cli/install.sh | bash

Need a different platform? Visit the GitHub repository for container images and build instructions.

Xác thực trong vài phút

Thực thi các tiêu chuẩn bảo mật giống như được sử dụng trên toàn bộ nền tảng Source Parts.

Tạo khóa API có phạm vi
Phát hành khóa cho mỗi môi trường với quyền dựa trên vai trò và hết hạn tự động.
Gán phạm vi đặc quyền tối thiểu
Ánh xạ hồ sơ CLI với vai trò Source Parts để kiểm soát quyền đọc, ghi và phê duyệt.
Tự động hóa xoay vòng khóa
Xoay vòng thông tin xác thực theo lịch trình bằng cách sử dụng lệnh gia hạn tích hợp và nhắc nhở chính sách.

Tham chiếu lệnh

Khám phá các họ lệnh cốt lõi hỗ trợ quy trình mua hàng, báo giá và thực hiện.

Tìm kiếm và thông minh
Truy vấn hàng triệu linh kiện, phân tích rủi ro vòng đời và xuất ảnh chụp nhanh giá cả.
CLI

components search

Search the Source Parts catalog with filters for stock, manufacturer, compliance, and lifecycle status.

parts components search --query "stm32f4" --in-stock

components lifecycle

Inspect lifecycle events, alternates, and risk signals for critical components.

parts components lifecycle --mpn ESP32-C3

inventory availability

Return regional inventory, lead times, and allocation windows in real time.

parts inventory availability --sku 100-443-ESP32 --region us
Báo giá và thương mại
Tự động hóa báo giá, tải lên BOM và quy trình đơn đặt hàng.
CLI

quotes create

Upload BOM files, apply pricing tiers, and generate shareable quotes.

parts quotes create --file ./bom.csv --customer-id 98213

orders submit

Convert approved quotes to orders with payment terms and shipment preferences.

parts orders submit --quote Q-14233 --method net-30

fulfillment track

Monitor fulfillment milestones, logistics updates, and delivery ETA.

parts fulfillment track --order SO-55821
Tự động hóa và tích hợp
Kết nối CLI với đường ống CI, bộ lập lịch và hệ thống hạ lưu.
CLI

automation workflows run

Execute saved workflows that bundle multiple commands with approvals and notifications.

parts automation workflows run nightly-replenishment

integrations sync

Synchronize Source Parts data with ERP, PLM, or data warehouses.

parts integrations sync --target erp

audit log export

Export command history with user, timestamp, and result metadata for compliance review.

parts audit log export --since 7d --format csv

Công thức tự động hóa

Bắt đầu quy trình làm việc của bạn với các ví dụ sẵn sàng chạy mà bạn có thể điều chỉnh theo môi trường của mình.

Monitor lifecycle risk
Schedule a job that flags lifecycle changes and sends alerts to Slack.
parts components lifecycle --mpn $1 --json | jq '.alerts[]' | slackctl send --channel sourcing-alerts
Sync BOM alternates
Update engineering alternates nightly and persist results to your PLM.
parts quotes bom-sync --project ${PROJECT_ID} | plmctl import --workspace hardware
Gate releases in CI
Fail builds when BOM risk exceeds tolerance before merging to main.
parts automation evaluate --workflow ci-bom-check || exit 1

Cấu hình một lần, sử dụng lại mọi nơi

Hồ sơ cho phép các nhóm chia sẻ kết nối trong khi giữ bí mật an toàn.

Key configuration fields
Define defaults in ~/.sourceparts/config.json or set environment overrides for CI.
Profiles

profile

Named profile used to scope credentials and default workspace settings.

{"default": "production"}

workspaceId

Source Parts workspace identifier used to fetch quotes, orders, and analytics.

{"workspaceId": "org-sp-enterprise"}

output.format

Control the default response format across commands (json, table, csv).

{"output": { "format": "table" }}
Reference the REST API
Pair CLI automation with direct API calls for custom integrations.
Explore full examples
See how teams embed Source Parts into dashboards, pipelines, and ERP systems.

Câu hỏi thường gặp

Câu trả lời cho triển khai, bảo mật và hoạt động hàng ngày.

Xuất sắc vận hành từ dòng lệnh

Triển khai tự động hóa mua hàng trong vài ngày, không phải quý, với Source Parts CLI.

Tài liệu CLI - Giao diện Dòng lệnh Source Parts | Source Parts