Skip to content

Commit f6d9880

Browse files
committed
document the mash scripts that help with pkgx (pkgxdev#1083)
1 parent 0dffb1e commit f6d9880

File tree

4 files changed

+78
-9
lines changed

4 files changed

+78
-9
lines changed

.gitbook.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ redirects:
1414
docker: getting-started.md
1515
ci-cd: getting-started.md
1616
scripts: scripting.md
17-
run/anywhere/terminals: getting-started.md
18-
run/anywhere/docker: getting-started.md
19-
run/anywhere/ci-cd: getting-started.md
20-
run/anywhere/scripts: scripting.md
17+
run-anywhere/terminals: getting-started.md
18+
run-anywhere/docker: getting-started.md
19+
run-anywhere/ci-cd: getting-started.md
20+
run-anywhere/scripts: scripting.md
2121
pantry.md: pkging/pantry.md
2222
pantry-api: pkging/pantry-api.md
2323
pkgx-install: https://github.com/pkgxdev/pkgm

.github/markdownlint.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ MD025: false
1515
MD033: false
1616
# Multiple consecutive blank lines
1717
MD012: false
18+
19+
# Blank line inside blockquote
20+
# gives false positives on code blocks for literal consecutive blockquotes
21+
MD028: false

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
![pkgx.dev](https://pkgx.dev/banner.png)
22

33
`pkgx` is a 4MB, *standalone* binary that can *run anything*.
4-
  [![coverage][]][coveralls] [![teaRank][]](https://tea.xyz)
4+
5+
[![coverage][]][coveralls] [![teaRank][]](https://tea.xyz)
56

67
 
78

@@ -244,6 +245,7 @@ pprint([(k, v["title"]) for k, v in data.items()][:10])
244245
> ecosystem is available to your scripts Check it out [`mash`].
245246
246247
> [!INFO]
248+
>
247249
> Notably, packages used during your script aren’t installed and don’t pollute
248250
> your system and anyone else’s systems either. Don’t be confused— they are
249251
> downloaded to `~/.pkgx` but the wider system is not touched.
@@ -312,8 +314,8 @@ exported.
312314
313315
## `pkgx install`
314316
315-
We now provide [`pkgm`][pkgm] but if you miss the leanness of “stubs” we provide a
316-
[`mash`] script to create stubs in `/usr/local/bin`:
317+
We now provide [`pkgm`][pkgm] but if you miss the leanness of “stubs” we
318+
provide a [`mash`] script to create stubs in `/usr/local/bin`:
317319
318320
```sh
319321
$ pkgx mash pkgx/stub git

docs/pkgx.md

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,73 @@ gum version 0.14.5
119119
For this mode we can also output JSON: `pkgx +gum --json`.
120120

121121

122-
## Silent Mode
122+
## Quietening Output
123123

124124
```sh
125-
pkgx --silent gum format 'no progress information is output'
125+
$ pkgx --quiet gum format 'download progress is still shown'
126+
# ^^ supresses resolving/syncing etc. messages but not download progress info
127+
128+
```sh
129+
pkgx --silent gum format 'no output at all'
130+
# ^^ silences everything, even errors
131+
```
132+
133+
Note that this only effects `pkgx` *not the tools you run with `pkgx`*.
134+
135+
## Other Common Needs
136+
137+
`pkgx` is not a package manager. Thus the command itself doesn’t typically
138+
offer such operations you may expect, however the way `pkgx` works is simple
139+
and standardized so we offer some `mash` scripts to help.
140+
141+
Longer term we will make a tool `pkgq` to help with these operations.
142+
143+
### Upgrading Packages
144+
145+
`pkgx foo` executes the latest version of `foo` that is *downloaded*. To
146+
ensure you have (any) newer versions installed use this command:
147+
148+
```sh
149+
$ pkgx mash pkgx/cache upgrade
150+
updating: /Users/mxcl/.pkgx/python.org/v3.11.11
151+
# snip…
152+
```
153+
154+
### Pruning Older Versions of Packages
155+
156+
The `pkgx` download cache can get large over time. To prune older versions:
157+
158+
```sh
159+
$ pkgx mash pkgx/cache prune
160+
pruning: ~/.pkgx/deno.land/v1.39.4
161+
pruning: ~/.pkgx/deno.land/v1.46.3
162+
# snip…
163+
```
164+
165+
This may delete versions that you use—if so—this is fine. `pkgx` will just
166+
reinstall them next time you need them.
167+
168+
### Listing Available Versions for a Package
169+
170+
ie. what versions *could be* run by `pkgx`:
171+
172+
```sh
173+
$ pkgx mash pkgx/pantry-inventory git
174+
2.38.1
175+
2.39.0
176+
# snip…
177+
```
178+
179+
### Listing What is Downloaded
180+
181+
```sh
182+
$ mash pkgx/cache ls
183+
184+
Parent Directory │Version
185+
────────────────────────────────┼──────────
186+
perl.org │5.40.0
187+
x.org/xcb │1.17.0
188+
# snip…
126189
```
127190

128191
[SemVer]: https://devhints.io/semver

0 commit comments

Comments
 (0)