Skip to content

opk-pm/Cli

Repository files navigation

Opk CLI and GUI

Opk GUI

Opk is a beautiful, unified package management workflow that sits on top of existing ecosystems like npm, Bun, pnpm, Yarn, and Deno. It provides a consistent interface for installing, managing, and orchestrating dependencies across different runtimes and environments.

Rather than replacing existing package managers, Opk acts as a meta-layer that standardizes tooling, simplifies configuration, and enables reproducible, cross-manager workflows. It focuses on developer experience, deterministic installs, and ecosystem interoperability.

Key Goals

  • Unified package management across multiple ecosystems
  • Consistent dependency and script workflows
  • Cross-manager compatibility and migration
    • NEW in 0.5: Keep multiple package managers in sync
  • Type-safe configuration and extensibility
  • Reproducible and deterministic environments
  • Build the best GUI for package management

Opk enables developers to manage their packages at once and run them anywhere.

Installation

Opk CLI is an npm package that should be installed globally.

npm i -g opk-pm

Commands

Opk CLI

Package Management:

  • opk add <pkg...> - Add packages via selected package manager, then sync+generate
  • opk remove <pkg...> - Remove packages via selected package manager, then sync+generate
  • opk install - Install via selected package manager, then sync+generate
  • opk update [pkg...] - Update via selected package manager, then sync+generate
  • opk audit - Audit via selected package manager, then sync+generate

Execution:

  • opk run <script> [args...] - Run scripts via selected package manager
  • opx <cmd> [args...] - Execute binaries via selected package manager

Project Management:

  • opk init - Prompt for project metadata, write package.ts, run ts-pkg sync+generate
  • opk migrate - Migrate from an existing package.json to package.ts, then sync+generate
  • opk generate [configPath] [packageJsonPath] - Generate package.json from ts-pkg config
  • opk sync [configPath] [packageJsonPath] - Sync and regenerate using ts-pkg APIs
  • opk gui [--port <port>] - Serve the built Opk GUI (defaults to port 4173)

Info:

  • opk list - Show dependencies in a native opk UI
  • opk info <pkg> - Show package info in a native opk UI
  • opk outdated [--table|--list] - Show outdated dependencies in a native opk UI

Shared PM flags

These flags are mapped by Opk to the selected package manager's native flag equivalents:

  • --lock-only, --frozen-lockfile (for opk install, opk update)
  • --ignore-scripts, --ignore-engines, --ignore-optional (for opk add|install|update)
  • --ignore-workspace-root-check, --ignore-pnp (for opk add|install|update)
  • --production / --prod, --dev, --peer, --optional (for opk add|install|update)
  • --verbose, --silent (for opk add|remove|install|update|audit)

Examples:

opk add react --dev --ignore-scripts
opk install --frozen-lockfile --silent
opk update --lock-only --verbose

Build

  • bun run build now builds the CLI and the GUI, and stages GUI assets into dist/gui for opk gui.

package.ts

import { definePackage, BunPm } from '@opk/ts-pkg'

export default definePackage({
  pm: BunPm,
  name: 'my-awesome-project',
  description: 'this is an amazing project',
  license: 'MIT',
  type: 'module',
})

About

The CLI for Opk - universal package manager for JS/TS.

Topics

Resources

License

Stars

Watchers

Forks

Contributors