Skip to content

Commit

Permalink
Merge pull request #472 from immobiliare/feat/cli
Browse files Browse the repository at this point in the history
Feat: CLI and binary build
  • Loading branch information
simonecorsi authored Jan 30, 2023
2 parents 1604704 + eeb6fec commit b4b228d
Show file tree
Hide file tree
Showing 8 changed files with 2,113 additions and 337 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: npm i

- name: Build
run: npm run build
run: npm run compile

- name: Semantic release
uses: codfish/semantic-release-action@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.out
# Logs
logs
*.log
Expand Down
17 changes: 16 additions & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,22 @@
"assets": ["CHANGELOG.md", "package.json", "package-lock.json"]
}
],
"@semantic-release/github",
[
"@semantic-release/github",
{
"assets": [
{
"path": ".out/dats-cli-linux",
"label": "Linux distribution"
},
{
"path": ".out/dats-cli-macos",
"label": "Macos distribution"
},
{ "path": ".out/dats-cli-win", "label": "Win distribution" }
]
}
],
[
"@saithodev/semantic-release-backmerge",
{
Expand Down
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Supports Node.js `>=14.0.0`, if you are a Node.js `v12` user refer to `[email protected].
- [`Client.gauge(string, value)`](#clientgaugestring-value)
- [`Client.set(string, value)`](#clientsetstring-value)
- [Dats Mock](#dats-mock)
- [CLI Interface](#cli-interface)
- [CLI Usage](#cli-usage)
- [Benchmarks](#benchmarks)
- [Powered Apps](#powered-apps)
- [Support & Contribute](#support--contribute)
Expand Down Expand Up @@ -240,6 +242,31 @@ console.log(client.metrics);
*/
```

## CLI Interface

dats is also exposed as a CLI that can both be installed as a npm global package or a precompiled binary.

The precompile binary can be found in the [release section](https://github.com/immobiliare/dats/releases) for linux, macos or window.

### CLI Usage

```sh
$ npm i -g @immobiliarelabs/dats
dats --help
# ℹ️ The following are required input flags:
#
# --host {string} []
# --port {string} []
# --type {string} [Metric type can be one of: counter, timing, gauge, set]
# --prefix {string} [Metric prefix]
# --namespace {string} [Metric full namespace, use dots `.` to separate metrics]
# --value {string} [Metric value]
# --quiet {boolean} [Suppress all console output]
# --dryRun {boolean} [Metric wont be sent, use for debug]
#
# If unsure of output run the command prepended with `DRY_RUN=1`
```

## Benchmarks

The automatic benchmarking for every commit can be found at the following links: [next](https://immobiliare.github.io/dats/next/bench/index.html) and
Expand Down
Loading

0 comments on commit b4b228d

Please sign in to comment.