Skip to content

Package Manager ​

YaoXiang has a built-in package manager that provides project initialization, dependency management, version locking, and workspace support.

See the Package Management System Guide for the complete end-user workflow (including copy-pasteable repository setup steps). This page is a reference index.

Design Principles ​

  • Declarative dependencies: declare required dependencies in yaoxiang.toml
  • Deterministic builds: lock versions through yaoxiang.lock to ensure reproducible builds
  • Local cache: dependencies are downloaded to .yaoxiang/vendor/, supporting offline reuse

Current Dependency Sources ​

SourceManifest syntaxStatus
Workspace member{ workspace = "key" }✅ Available
Git repository{ git = "<url>" }✅ Available
Official registryname = "1.0.0"⛔ Not yet implemented (RFC-014a postponed indefinitely)
Local path{ path = "../lib" }⚠️ Known issues, see the guide

yx add without --git / --path falls through to the not-yet-implemented registry source, and yx install subsequently fails.

Project Structure ​

The actual output of yx init:

my-project/
├── yaoxiang.toml            # Project manifest
├── yaoxiang.lock            # Dependency lock file
├── .gitignore               # Already includes .yaoxiang/
├── tests/                   # Test directory
├── src/
│   └── main.yx              # Entry file (lib.yx with --lib)
└── .yaoxiang/
    └── vendor/
        ├── std/              # Standard library interface files
        └── <package>-<version>/    # Third-party dependencies

Command Overview ​

yx provides 21 subcommands, 11 of which are related to package management:

CommandDescription
yx initInitialize project, supports --lib
yx addAdd dependency
yx installInstall dependencies
yx updateUpdate dependencies
yx listList dependencies and sources
yx rmRemove dependency
yx outdatedCheck upgradable dependencies
yx cleanClean build artifacts and redundant vendor packages
yx cache cleanClear global cache
yx workspaceManage workspace members
yx publishPackage and publish

The remaining subcommands (run, check, test, build, format, lsp, repl, eval, explain, dump) are unrelated to package management.

Documentation Index ​