Skip to content

Commit 6f954f5

Browse files
authored
document the mash scripts that help with pkgx (#1083)
1 parent 0dffb1e commit 6f954f5

File tree

3 files changed

+67
-4
lines changed

3 files changed

+67
-4
lines changed

.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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ pprint([(k, v["title"]) for k, v in data.items()][:10])
244244
> ecosystem is available to your scripts Check it out [`mash`].
245245
246246
> [!INFO]
247+
>
247248
> Notably, packages used during your script aren’t installed and don’t pollute
248249
> your system and anyone else’s systems either. Don’t be confused— they are
249250
> downloaded to `~/.pkgx` but the wider system is not touched.
@@ -312,8 +313,8 @@ exported.
312313
313314
## `pkgx install`
314315
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`:
316+
We now provide [`pkgm`][pkgm] but if you miss the leanness of “stubs” we
317+
provide a [`mash`] script to create stubs in `/usr/local/bin`:
317318
318319
```sh
319320
$ pkgx mash pkgx/stub git

docs/pkgx.md

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,68 @@ 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 so the command itself doesn’t typically offer
138+
such operations you may expect, however the way `pkgx` works is simple and
139+
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+
### Updating Downloaded Packages
144+
145+
```sh
146+
$ pkgx mash pkgx/cache upgrade
147+
updating: /Users/mxcl/.pkgx/python.org/v3.11.11
148+
# snip…
149+
```
150+
151+
### Pruning Older Versions of Packages
152+
153+
The `pkgx` download cache can get large over time. To prune older versions:
154+
155+
```sh
156+
$ pkgx mash pkgx/cache prune
157+
pruning: ~/.pkgx/deno.land/v1.39.4
158+
pruning: ~/.pkgx/deno.land/v1.46.3
159+
# snip…
160+
```
161+
162+
This may delete versions that you use—if so—this is fine. `pkgx` will just
163+
reinstall them next time you need them.
164+
165+
### Listing Available Versions for a Package
166+
167+
```sh
168+
$ pkgx mash pkgx/pantry-inventory git
169+
2.38.1
170+
2.39.0
171+
# snip…
172+
```
173+
174+
### Listing What is Downloaded
175+
176+
```sh
177+
$ mash pkgx/cache ls
178+
179+
Parent Directory │Version
180+
────────────────────────────────┼──────────
181+
perl.org │5.40.0
182+
x.org/xcb │1.17.0
183+
# snip…
126184
```
127185

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

0 commit comments

Comments
 (0)