Tea

“run anything” from the creator of `brew`

README

pkgx.dev

pkgx is a single, standalone binary that can run anything.
  [![coverage][]][coveralls]

 


Quickstart


  1. ```sh
  2. brew install pkgxdev/made/pkgx
  3. ```

[docs.pkgx.sh/installing-w/out-brew]


 


Run Anything


  1. ```sh
  2. $ deno
  3. command not found: deno

  4. $ pkgx deno
  5. Deno 1.36.3
  6. > ^D

  7. $ deno
  8. command not found: deno
  9. # ^^ nothing was installed; your system remains untouched
  10. ```


Run Any Version of Anything


  1. ```sh
  2. $ pkgx node@14 --version
  3. Node.js v14.21.3

  4. $ pkgx python@2 --version
  5. Python 2.7.18
  6. ```


Run Anywhere


*
macOS

  macOS >= 11
  x86-64 & Apple Silicon

*
Linux

  glibc >=2.28 repology
  x86_64 & arm64

*
Windows

  WSL2; x86-64. Native windows is planned.

*
Docker

  sh
  $ pkgx docker run -it pkgxdev/pkgx

  (docker) $ pkgx node@16
  Welcome to Node.js v16.20.1.
  Type ".help" for more information.
  >
  

  Or in a Dockerfile:

  Dockerfile
  FROM pkgxdev/pkgx
  RUN pkgx deno@1.35 task start
  

  Or in any image:

  Dockerfile
  FROM ubuntu
  RUN curl https://pkgx.sh | sh
  RUN pkgx python@3.10 -m http.server 8000
  

  > [docs.pkgx.sh/docker]

*
CI/CD

  yaml
  - uses: pkgxdev/setup@v1
  - run: pkgx shellcheck
  

  Or in other CI/CD providers:

  sh
  $ curl https://pkgx.sh | sh
  $ pkgx shellcheck
  

  > [docs.pkgx.sh/ci-cd]

*
Shebangs

  sh
  #!/usr/bin/env -S pkgx python@3.10
  

  > [docs.pkgx.sh/scripts]

*
Editors

  sh
  $ cd myproj

  myproj $ env +cargo
  (+cargo) myproj $ code .
  

  Or use [dev][dev]; a separate tool that uses the pkgx primitives to
  automatically determine and utilize your dependencies based on your
  project’s keyfiles.

  sh
  $ cd myproj

  myproj $ dev
  env +cargo +rust

  (+cargo+rust) my-rust-project $ code .
  

  > [docs.pkgx.sh/editors]


 


Shell Integration


pkgx puts the whole open source ecosystem at your fingertips and its
optional shell integration makes workflows with that open source
even more seamless.

  1. ```sh
  2. $ env +go@1.16
  3. added ~/.pkgx/go.dev/v1.16 to environment

  4. (+go) $ go
  5. Go is a tool for managing Go source code.
  6. #

  7. (+go) $ env | grep go
  8. PATH=~/.pkgx/go.dev/v1.16.15/bin:$PATH
  9. LIBRARY_PATH=~/.pkgx/go.dev/v1.16.15/lib

  10. (+go) $ env -go
  11. removed ~/.pkgx/go.dev/v1.16 from environment

  12. $ go
  13. command not found: go
  14. ```

Tools are available for the duration of your terminal session.
If you need them for longer, pkgx install.

[docs.pkgx.sh/shell-integration] \

[docs.pkgx.sh/pkgx-install]


dev


dev is a separate tool that leverages pkgx's core
features to auto-detect and install project dependencies, seamlessly
integrating them into your shell and editor.

  1. ```sh
  2. my-rust-proj $ dev
  3. dev: found Cargo.toml; env +cargo +rust

  4. (+cargo+rust) my-rust-proj $ cargo build
  5. Compiling my-rust-proj v0.1.0
  6. #
  7. ```

The dev tool requires our shell integration to work.

[docs.pkgx.sh/dev][dev]


 



Getting Started


  1. ```sh
  2. brew install pkgxdev/made/pkgx
  3. ```

no brew? [docs.pkgx.sh/installing-w/out-brew]


Integrating with your Shell


  1. ```sh
  2. pkgx integrate --dry-run   # docs.pkgx.sh/shell-integration
  3. ```

Further Reading


[docs.pkgx.sh][docs] is a comprehensive manual and user guide for pkgx.

 



Contributing


To add packages see the [pantry README]
To hack on pkgx itself; clone it and then pkgx deno task to list
  entrypoints for hackers

If you have questions or feedback:

[github.com/orgs/pkgxdev/discussions][discussions]
x.com/pkgxdev (DMs are open)


[docs]: https://docs.pkgx.sh
[pantry README]: ../../../pantry#contributing
[discussions]: ../../discussions
[docs.pkgx.sh/pkgx-install]: https://docs.pkgx.sh/pkgx-install
[docs.pkgx.sh/ci-cd]: https://docs.pkgx.sh/ci-cd
[docs.pkgx.sh/scripts]: https://docs.pkgx.sh/scripts
[docs.pkgx.sh/editors]: https://docs.pkgx.sh/editors
[docs.pkgx.sh/docker]: https://docs.pkgx.sh/docker
[docs.pkgx.sh/installing-w/out-brew]: https://docs.pkgx.sh/installing-w/out-brew
[docs.pkgx.sh/shell-integration]: https://docs.pkgx.sh/shell-integration
[dev]: https://docs.pkgx.sh/dev

[coverage]: https://coveralls.io/repos/github/pkgxdev/pkgx/badge.svg?branch=main
[coveralls]: https://coveralls.io/github/pkgxdev/pkgx?branch=main