Skip to content

Commit

Permalink
move cli to apps/ from live-common (LedgerHQ#61)
Browse files Browse the repository at this point in the history
* move cli to apps/ from live-common

* add documentation on CLI, closes LedgerHQ#177

* add changeset
  • Loading branch information
valpinkman authored Jun 6, 2022
1 parent 71091b5 commit 77aa0a5
Show file tree
Hide file tree
Showing 79 changed files with 164 additions and 239 deletions.
5 changes: 5 additions & 0 deletions .changeset/early-bikes-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ledgerhq/live-cli": major
---

extracted live-cli to it's own module
3 changes: 3 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ tools:
automation:
- .github/**/*

cli:
- apps/cli/**/*

translations:
- apps/ledger-live-desktop/static/i18n/**/*
- apps/ledger-live-mobile/src/locales/**/*
Expand Down
File renamed without changes.
File renamed without changes.
62 changes: 60 additions & 2 deletions libs/ledger-live-common/cli/README.md → apps/cli/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,68 @@
## ledger-live CLI tools
# ledger-live CLI

> Please be advised this software is experimental and shall not create any obligation for Ledger to continue to develop, offer, support or repair any of its features. The software is provided “as is.” Ledger shall not be liable for any damages whatsoever including loss of profits or data, business interruption arising from using the software.
This package wraps functionality from `@ledgerhq/live-common` into a suite of tools that can be used directly from the terminal

# Usage

## Install the CLI

```bash
npm i --global @ledgerhq/live-cli
```

## Run commands

Jump to the [documentation](#Documentation) for more informations on the available commands

```bash
ledger-live <commands>
```
Ledger Live @ https://github.com/LedgerHQ/ledger-live-common

# Development

## Setup

### Requirements

- [NodeJS](https://nodejs.org) `lts/fermium` (v14.x)
- [PnPm](https://pnpm.io) (v7.x)
- [Python](https://www.python.org/) (v3.5+)
- On Linux: `sudo apt-get update && sudo apt-get install libudev-dev libusb-1.0-0-dev`

## Install

> Reminder: all commands should be run at the root of the monorepository
```bash
# install dependencies
pnpm i
```

## Dev
```bash
# launch a watch mode on the source files and recompiles on the fly
pnpm dev:cli
```

## Run

```bash
# run a command of the cli
pnpm run:cli <command>
```

## Build

```bash
# build the cli for publishing
pnpm build:cli
```

# Documentation

```
Usage: ledger-live <command> ...
Usage: ledger-live cosmosValidators
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"@ledgerhq/cryptoassets": "workspace:^",
"@ledgerhq/errors": "workspace:^",
"@ledgerhq/hw-app-btc": "workspace:^",
"@ledgerhq/hw-transport": "workspace:^",
"@ledgerhq/hw-transport-http": "workspace:^",
"@ledgerhq/hw-transport-mocker": "workspace:^",
"@ledgerhq/hw-transport-node-hid": "workspace:^",
Expand All @@ -44,6 +45,7 @@
"command-line-args": "^5.2.1",
"cors": "^2.8.5",
"express": "^4.17.2",
"invariant": "^2.2.4",
"lodash": "^4.17.21",
"lodash.product": "^18.9.19",
"qrcode-terminal": "^0.12.0",
Expand All @@ -52,7 +54,8 @@
"react-dom": "^17.0.2",
"react-redux": "^7.2.6",
"rxjs": "^6.6.7",
"winston": "^3.5.1"
"winston": "^3.5.1",
"ws": "^8.6.0"
},
"devDependencies": {
"@types/command-line-args": "^5.2.0",
Expand All @@ -61,4 +64,4 @@
"ts-node": "^10.4.0",
"typescript": "^4.5.5"
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
157 changes: 0 additions & 157 deletions libs/ledger-live-common/.circleci.disabled/config.yml

This file was deleted.

Empty file.
Empty file.
Empty file.
1 change: 0 additions & 1 deletion libs/ledger-live-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"test": "pnpm ci-test-common",
"ci-lint": "pnpm lint",
"ci-test-common": "env-cmd -f ./.ci.env pnpm jest --ci --updateSnapshot && git diff --exit-code src",
"ci-test-cli": "cd cli && pnpm test",
"ci-test-bot": "env-cmd -f ./.ci.env pnpm jest --testMatch '**/*.bot.ts'"
},
"files": [
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"license": "MIT",
"private": true,
"packageManager": "pnpm@7.0.0",
"packageManager": "pnpm@7.1.0",
"scripts": {
"clean": "git clean -fdX",
"changelog": "changeset add",
Expand All @@ -24,15 +24,15 @@
"clean:ljs": "pnpm turbo run clean --filter='./libs/ledgerjs/**'",
"doc:ljs": "pnpm turbo run doc --filter='./libs/ledgerjs/**'",
"watch:ljs": "pnpm turbo run watch --filter='./libs/ledgerjs/**'",
"dev:cli": "pnpm turbo run start --filter=live-cli",
"dev:cli": "pnpm turbo run watch --filter=live-cli",
"dev:lld": "pnpm turbo run start --filter=ledger-live-desktop",
"dev:llm": "pnpm turbo run start --filter=live-mobile",
"release:lld": "pnpm turbo run release --filter=ledger-live-desktop",
"pre:lld": "pnpm turbo run pre-build --filter=ledger-live-desktop",
"nightly": "pnpm turbo run nightly --include-dependencies --no-deps",
"nightly:lld": "pnpm turbo run nightly --filter=ledger-live-desktop",
"test": "pnpm turbo run test --concurrency=100%",
"run:cli": "./libs/ledger-live-common/cli/bin/index.js",
"run:cli": "./apps/cli/bin/index.js",
"lint": "pnpm turbo run lint",
"lint:fix": "pnpm turbo run lint:fix",
"typecheck": "pnpm turbo run typecheck",
Expand Down
Loading

0 comments on commit 77aa0a5

Please sign in to comment.