https://github.com/typst-community/utpm
A package manager for local and remote Typst packages.
https://github.com/typst-community/utpm
package-manager typst utpm
Last synced: about 1 month ago
JSON representation
A package manager for local and remote Typst packages.
- Host: GitHub
- URL: https://github.com/typst-community/utpm
- Owner: typst-community
- License: mit
- Created: 2023-06-18T11:53:56.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-08-15T15:51:57.000Z (5 months ago)
- Last Synced: 2025-08-15T17:44:23.644Z (5 months ago)
- Topics: package-manager, typst, utpm
- Language: Rust
- Homepage:
- Size: 2.8 MB
- Stars: 80
- Watchers: 1
- Forks: 7
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-typst - utpm - _Package manager_ for **[local](https://github.com/typst/packages#local-packages)** and **[remote](https://github.com/typst/packages)** Typst packages. (Integrations & Tools / CLI Tools)
README

> _Unofficial Typst Package Manager_
**UTPM** is a powerful command-line package manager for [Typst](https://typst.app/). Create, manage, and share Typst packages with ease โ whether for local development or publishing to **Typst Universe**.
[](https://github.com/typst-community/utpm "Go to GitHub repo")
[](https://github.com/typst-community/utpm)
[](https://github.com/typst-community/utpm)
[](https://github.com/typst-community/utpm/releases/)
[](#license)
[](https://github.com/typst-community/utpm/issues)
---
## โจ Quick Start
```bash
# Install UTPM (see [Installation](#-installation) for all options)
cargo install utpm
# Create a new package
utpm prj init
# Link it for local development
utpm prj link
# Use it in Typst!
# #import "@local/my-package:0.1.0": *
```
> [!NOTE]
> **UTPM** is actively developed and growing! Some features are still in progress. \
> Contributions are welcome โ check out our [contributing guide](docs/CONTRIBUTING.md)!
## ๐ฅ Why UTPM?
- **๐ Rapid Development** - Create and link packages instantly for local testing
- **๐ฆ Smart File Management** - Respects `.gitignore`, `.typstignore`, and custom exclude patterns
- **๐ Dependency Management** - Sync dependencies and bump versions with ease
- **๐ Metadata Extraction** - Extract package info for scripts and CI/CD pipelines
- **๐จ Flexible Output** - JSON, HJSON, YAML, TOML, or human-readable text
- **๐ก๏ธ Try Features without Risk** - Dry-run mode for all destructive operations
- **โก Fast & Lightweight** - Written in Rust for speed and reliability
## ๐ฏ Features
### Package Development
- โจ **Initialize** packages with interactive prompts (`utpm prj init`)
- ๐ **Link** packages for local development (`utpm prj link`)
- โฌ๏ธ **Bump** versions with semantic versioning (`utpm prj bump`)
- ๐ **Extract metadata** for automation (`utpm prj metadata`)
### Dependency Management
- ๐ฅ **Clone** packages from Typst Universe (`utpm prj clone`)
- ๐ **Sync** dependencies to latest versions (`utpm prj sync`)
- ๐ฆ **Install** from git repositories (`utpm pkg install`)
### Package Discovery
- ๐๏ธ **List** local packages with tree view (`utpm pkg list --tree`)
- โน๏ธ **Get** package info from remote (`utpm pkg get`)
- ๐ **Check** for updates without applying (`utpm prj sync -c`)
### Coming Soon
- ๐ **Publish** directly to Typst Universe (in development)
---
## ๐ฆ Installation
### Quick Install
#### Cargo (Cross-platform)
```bash
# Using cargo-binstall (fastest)
cargo binstall utpm
# Or build from source
cargo install utpm
```
#### Arch Linux
```bash
# Using an AUR helper (yay, paru, etc.)
yay -S utpm-bin # Pre-built binaries
# or
yay -S utpm-git # Build from latest git
```
#### Homebrew (macOS/Linux)
```bash
# Coming soon - waiting for tap approval
brew install typst-community/utpm/utpm
```
#### Nix
๐ฆ Nix Installation Options
##### With Flakes
Temporary shell:
```bash
nix shell github:typst-community/utpm
```
Permanent installation in `flake.nix`:
```nix
{
inputs.utpm.url = "github:typst-community/utpm";
outputs = { self, nixpkgs, ... }@inputs: {
nixosConfigurations.yourhostname = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [{
environment.systemPackages = [
inputs.utpm.packages.${system}.default
];
}];
};
};
}
```
##### Without Flakes
```bash
git clone https://github.com/typst-community/utpm.git
cd utpm
nix-build
./result/bin/utpm
```
### More Package Managers
UTPM is being packaged for multiple package managers:
- ๐ฆ **Snap** - `sudo snap install utpm` (automated publishing)
- ๐ฆ **Flatpak** - Available on Flathub (semi-automated)
- ๐ฆ **Debian/Ubuntu** - `.deb` packages (manual, see [docs/PUBLISHING.md](docs/PUBLISHING.md))
- ๐ฆ **Fedora/RHEL** - RPM packages (manual, see [docs/PUBLISHING.md](docs/PUBLISHING.md))
**For maintainers:** See [docs/PACKAGING.md](docs/PACKAGING.md) for technical details and [docs/SECRETS.md](docs/SECRETS.md) for automation setup.
**Note:** Windows builds are generated here but scoop is managed by an another user. See [Scoop bucket for typst](https://github.com/typst-community/scoop-bucket) for more infos.
### From Source
```bash
git clone https://github.com/typst-community/utpm.git
cd utpm
cargo install --path .
```
---
## ๐ Usage
### GitHub Actions
Use UTPM in your CI/CD workflows:
```yaml
- name: Setup UTPM
uses: Thumuss/setup-utpm@v1
```
See the [setup-utpm repository](https://github.com/Thumuss/setup-utpm) for complete documentation and examples.
### Basic Commands
```bash
# Create a new package
utpm prj init
# Link for local development
utpm prj link
# Clone from Typst Universe
utpm prj clone @preview/example:1.0.0
# Bump version
utpm prj bump 1.2.0
# List installed packages
utpm pkg list --tree
# Get metadata for scripts
VERSION=$(utpm prj metadata -f version)
```
### Command Overview
#### Project Management (`utpm prj`)
| Command | Alias | Description |
|---------|-------|-------------|
| `init` | `n` | Create a new `typst.toml` manifest interactively |
| `link` | `l` | Link package for local development (respects ignore files) |
| `clone` | `c` | Clone a package from Typst Universe |
| `bump` | `b` | Bump package version (supports semantic versioning) |
| `sync` | `s` | Sync dependencies to latest versions |
| `metadata` | `m` | Extract metadata for scripts and automation |
| `publish` | `p` | ๐ง Publish to Typst Universe _(coming soon)_ |
#### Package Management (`utpm pkg`)
| Command | Alias | Description |
|---------|-------|-------------|
| `list` | `l` | List installed packages (supports tree view) |
| `path` | `p` | Show package directory path |
| `unlink` | `u` | Remove a linked package |
| `get` | `g` | Get package info from remote |
| `install` | `i` | Install package from git repository |
#### Other Commands
- `utpm generate` (`g`) - Generate shell completion scripts
### Global Options
```bash
utpm [OPTIONS]
Options:
-v, --verbose Logging level (trace, debug, info, warn, error)
-o, --output Output format (text, json, yaml, toml, hjson)
-D, --dry-run Preview changes without writing to disk
-h, --help Show help information
-V, --version Show version
```
> ๐ก **Tip**: Use `utpm --help` for detailed command-specific help
---
## โ๏ธ Configuration
UTPM extends the standard `typst.toml` with a `[tool.utpm]` section for package-specific settings.
### Excluding Files
Control which files are included when linking or publishing:
```toml
[package]
name = "my-package"
version = "0.1.0"
# ... other standard fields
[tool.utpm]
exclude = [
".git",
".github",
"*.md", # Exclude all Markdown files
"tests/", # Exclude tests directory
"examples/", # Exclude examples
"**/*.bak", # Exclude backup files recursively
]
```
**Pattern Syntax:**
- `*` - Match files in current directory (e.g., `*.md`)
- `**` - Match recursively (e.g., `**/*.tmp`)
- `!pattern` - Negate/include pattern
- Patterns ending with `/` match directories only
**Ignore Files Respected:**
- `.gitignore` (default: enabled)
- `.typstignore` (default: enabled)
- `.ignore` (optional, enable with `--ignore`)
- Custom patterns in `[tool.utpm]`
### Metadata Extraction
Extract package metadata for scripts and CI/CD:
```bash
# Get specific field (outputs plain text)
VERSION=$(utpm prj metadata -f version)
NAME=$(utpm prj metadata -f name)
# Use in automation
echo "Building $NAME version $VERSION"
git tag "v$VERSION"
# Get all metadata as JSON
utpm -o json prj metadata | jq '.authors'
```
**Available fields:** `name`, `version`, `entrypoint`, `authors`, `license`, `description`, `repository`, `homepage`, `keywords`, `categories`, `disciplines`, `compiler`, `exclude`
๐ **Example**: See [`assets/typst.toml.example`](assets/typst.toml.example) for a complete configuration reference.
---
## ๐ Documentation
| Document | Description |
|----------|-------------|
| **[๐ Complete Guide](docs/GUIDE.md)** | Comprehensive guide for users, package authors, and contributors |
| **[๐ค Contributing](docs/CONTRIBUTING.md)** | Code standards, testing, and contribution process |
| **[๐ ๏ธ Development](docs/DEVELOPMENT.md)** | Development setup, workflow, and tools |
| **[๐งช Testing](docs/TESTING.md)** | Testing guide, running tests, and writing new tests |
---
## ๐ค Contributing
We welcome contributions of all kinds! Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated.
### Quick Start for Contributors
```bash
# 1. Install development tools
cargo install just
# 2. Setup git hooks (optional but recommended)
just setup-hooks
# 3. Before committing
just fix # Auto-format and fix linting issues
just ci # Run all checks (format, lint, test)
```
### What You Can Do
- ๐ **Report bugs** - Open an issue with details
- ๐ก **Suggest features** - Share your ideas in discussions
- ๐ **Improve docs** - Help make documentation clearer
- ๐ง **Fix issues** - Pick up a "good first issue"
- โจ **Add features** - Implement new functionality
See [CONTRIBUTING.md](docs/CONTRIBUTING.md) for detailed guidelines on code standards, testing, and the PR process.
---
## ๐ License
MIT License - see [LICENSE](LICENSE) for details.
---
## ๐ Acknowledgments
Built with โค๏ธ by the [Typst Community](https://github.com/typst-community)
**Key Dependencies:**
- [Typst](https://typst.app/) - The amazing typesetting system
- [Rust](https://www.rust-lang.org/) - Systems programming language
- [Clap](https://github.com/clap-rs/clap) - Command-line argument parsing
---
**[โฌ Back to Top](#)**
Made with โค๏ธ for the Typst community