bitwarden-estensione-browser/apps/cli/README.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

121 lines
4.4 KiB
Markdown
Raw Normal View History

2022-04-22 14:38:13 +02:00
> **Repository Reorganization in Progress**
>
> We are currently migrating some projects over to a mono repository. For existing PR's we will be providing documentation on how to move/migrate them. To minimize the overhead we are actively reviewing open PRs. If possible please ensure any pending comments are resolved as soon as possible.
>
> New pull requests created during this transition period may not get addressed —if needed, please create a new PR after the reorganization is complete.
[![Github Workflow build on master](https://github.com/bitwarden/cli/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/bitwarden/cli/actions/workflows/build.yml?query=branch:master)
2018-05-15 14:00:27 +02:00
[![Join the chat at https://gitter.im/bitwarden/Lobby](https://badges.gitter.im/bitwarden/Lobby.svg)](https://gitter.im/bitwarden/Lobby)
# Bitwarden Command-line Interface
2018-05-25 22:15:29 +02:00
[![Platforms](https://imgur.com/AnTLX0S.png "Platforms")](https://help.bitwarden.com/article/cli/#download--install)
2018-05-15 14:00:27 +02:00
2018-05-18 17:49:28 +02:00
The Bitwarden CLI is a powerful, full-featured command-line interface (CLI) tool to access and manage a Bitwarden vault. The CLI is written with TypeScript and Node.js and can be run on Windows, macOS, and Linux distributions.
2018-05-15 14:08:31 +02:00
2018-07-19 16:50:35 +02:00
![CLI](https://raw.githubusercontent.com/bitwarden/brand/master/screenshots/cli-macos.png "CLI")
2018-05-18 18:06:59 +02:00
2018-05-24 13:58:58 +02:00
## Download/Install
2018-05-15 14:08:31 +02:00
2018-05-18 17:49:28 +02:00
You can install the Bitwarden CLI multiple different ways:
2018-05-15 14:08:31 +02:00
2018-05-18 17:49:28 +02:00
**NPM**
If you already have the Node.js runtime installed on your system, you can install the CLI using NPM. NPM makes it easy to keep your installation updated and should be the preferred installation method if you are already using Node.js.
```bash
npm install -g @bitwarden/cli
```
**Native Executable**
2018-05-24 13:57:44 +02:00
We provide natively packaged versions of the CLI for each platform which have no requirements on installing the Node.js runtime. You can obtain these from the [downloads section](https://help.bitwarden.com/article/cli/#download--install) in the documentation.
2018-05-23 22:45:11 +02:00
**Other Package Managers**
- [Chocolatey](https://chocolatey.org/packages/bitwarden-cli)
2018-05-25 22:16:14 +02:00
```powershell
2018-05-23 22:45:11 +02:00
choco install bitwarden-cli
```
2018-05-28 14:56:25 +02:00
- [Homebrew](https://formulae.brew.sh/formula/bitwarden-cli)
2018-05-23 22:45:11 +02:00
```bash
2018-05-28 14:56:25 +02:00
brew install bitwarden-cli
2018-05-23 22:45:11 +02:00
```
2018-05-25 22:16:14 +02:00
- [Snap](https://snapcraft.io/bw)
```bash
sudo snap install bw
```
2018-05-18 17:49:28 +02:00
2018-05-24 13:58:58 +02:00
## Documentation
2018-05-18 17:49:28 +02:00
The Bitwarden CLI is self-documented with `--help` content and examples for every command. You should start exploring the CLI by using the global `--help` option:
```bash
bw --help
```
This option will list all available commands that you can use with the CLI.
2018-05-18 18:13:49 +02:00
Additionally, you can run the `--help` option on a specific command to learn more about it:
2018-05-18 17:49:28 +02:00
```bash
bw list --help
bw create --help
```
2018-05-15 14:00:27 +02:00
2018-05-18 17:51:48 +02:00
**Detailed Documentation**
We provide detailed documentation and examples for using the CLI in our help center at https://help.bitwarden.com/article/cli/.
2018-05-24 13:58:58 +02:00
## Build/Run
2018-05-15 14:00:27 +02:00
**Requirements**
- [Node.js](https://nodejs.org) v16.13.1.
- Testing is done against Node 16, other versions may work, but are not guaranteed.
- NPM v8
2018-05-15 14:00:27 +02:00
**Run the app**
```bash
npm install
2019-03-21 13:29:28 +01:00
npm run sub:init # initialize the git submodule for jslib
2018-05-15 14:00:27 +02:00
npm run build:watch
```
You can then run commands from the `./build` folder:
```bash
node ./build/bw.js login
```
## We're Hiring!
Interested in contributing in a big way? Consider joining our team! We're hiring for many positions. Please take a look at our [Careers page](https://bitwarden.com/careers/) to see what opportunities are currently open as well as what it's like to work at Bitwarden.
2018-05-24 13:58:58 +02:00
## Contribute
2018-05-15 14:00:27 +02:00
Code contributions are welcome! Please commit any pull requests against the `master` branch. Learn more about how to contribute by reading the [`CONTRIBUTING.md`](CONTRIBUTING.md) file.
Security audits and feedback are welcome. Please open an issue or email us privately if the report is sensitive in nature. You can read our security policy in the [`SECURITY.md`](SECURITY.md) file.
2021-12-20 18:15:11 +01:00
## Prettier
We recently migrated to using Prettier as code formatter. All previous branches will need to updated to avoid large merge conflicts using the following steps:
1. Check out your local Branch
2. Run `git merge ec53a16c005e0dd9aef6845c18811e8b14067168`
3. Resolve any merge conflicts, commit.
4. Run `npm run prettier`
5. Commit
6. Run `git merge -Xours 910b4a24e649f21acbf4da5b2d422b121d514bd5`
7. Push
### Git blame
We also recommend that you configure git to ignore the prettier revision using:
```bash
git config blame.ignoreRevsFile .git-blame-ignore-revs
```