Skip to content

Commit

Permalink
Display CLI usage in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Feb 10, 2025
1 parent 9755e02 commit 14b93e2
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/bundler/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1629,3 +1629,5 @@ declare class ResolveMessage {
toString(): string;
}
```

{% bunCLIUsage command="build" /%}
2 changes: 2 additions & 0 deletions docs/cli/add.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,5 @@ This will add the following line to your `package.json`:
}
}
```

{% bunCLIUsage command="add" /%}
2 changes: 2 additions & 0 deletions docs/cli/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ If you pass `-y` or `--yes`, it will assume you want to continue without asking
At the end, it runs `bun install` to install `@types/bun`.

{% /details %}

{% bunCLIUsage command="init" /%}
2 changes: 2 additions & 0 deletions docs/cli/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,5 @@ jobs:
- name: Build app
run: bun run build
```

{% bunCLIUsage command="install" /%}
2 changes: 2 additions & 0 deletions docs/cli/link.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ In addition, the `--save` flag can be used to add `cool-pkg` to the `dependencie
}
}
```

{% bunCLIUsage command="link" /%}
2 changes: 2 additions & 0 deletions docs/cli/outdated.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ You can pass multiple `--filter` flags to check multiple workspaces:
You can also pass glob patterns to filter by workspace names:

{% bunOutdatedTerminal glob="{e,t}*" displayGlob="--filter='@monorepo/{types,cli}'" /%}

{% bunCLIUsage command="outdated" /%}
2 changes: 2 additions & 0 deletions docs/cli/patch-commit.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ To get started with patch, first prepare the package for patching with [`bun pat
By default, `bun patch-commit` will use the `patches` directory in the temporary directory.

You can specify a different directory with the `--patches-dir` flag.

{% bunCLIUsage command="patch-commit" /%}
1 change: 1 addition & 0 deletions docs/cli/publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,4 @@ $ bun publish --otp 123456
### `--gzip-level`

Specify the level of gzip compression to use when packing the package. Only applies to `bun publish` without a tarball path argument. Values range from `0` to `9` (default is `9`).
{% bunCLIUsage command="publish" /%}
2 changes: 2 additions & 0 deletions docs/cli/remove.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ To remove a dependency:
```bash
$ bun remove ts-node
```

{% bunCLIUsage command="remove" /%}
2 changes: 2 additions & 0 deletions docs/cli/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,5 @@ When there is a package.json script and a file with the same name, `bun run` pri
2. Source files, eg `bun run src/main.js`
3. Binaries from project packages, eg `bun add eslint && bun run eslint`
4. (`bun run` only) System commands, eg `bun run ls`

{% bunCLIUsage command="run" /%}
2 changes: 2 additions & 0 deletions docs/cli/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,5 @@ $ bun test foo
```

Any test file in the directory with an _absolute path_ that contains one of the targets will run. Glob patterns are not yet supported. -->

{% bunCLIUsage command="test" /%}
2 changes: 2 additions & 0 deletions docs/cli/unlink.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ $ cd /path/to/cool-pkg
$ bun unlink
bun unlink v1.x (7416672e)
```

{% bunCLIUsage command="unlink" /%}
2 changes: 2 additions & 0 deletions docs/cli/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ For example, with the following `package.json`:

- `bun update` would update to a version that matches `17.x`.
- `bun update --latest` would update to a version that matches `18.x` or later.

{% bunCLIUsage command="update" /%}
2 changes: 2 additions & 0 deletions docs/install/patch.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,5 @@ $ bun patch --commit react --patches-dir=mypatches
# `patch-commit` is available for compatibility with pnpm
$ bun patch-commit react
```

{% bunCLIUsage command="patch" /%}

0 comments on commit 14b93e2

Please sign in to comment.