Command-line tool for raygun.com.
You can install this tool in different ways.
Install binary
Pre-compiled binaries for Linux, MacOS and Windows are avaible for download in the releases section.
Installing through system package managers will be available in the future!
Install from pub.dev
To install from pub.dev, Dart SDK setup is necessary.
You can get the Dart SDK here: https://dart.dev/get-dart or as part of your Flutter SDK installation.
Note: $HOME/.pub-cache/bin must be in your path.
dart pub global activate raygun_cli
Install from sources
Compile and install this tool with the following command:
dart pub get --enforce-lockfile
dart pub global activate -s path .
The committed pubspec.lock is part of the source build contract. It pins the
exact dependency graph and package content hashes used by CI and release builds,
so keep it committed and use dart pub get --enforce-lockfile when building
from a checkout.
This repository is a CLI application that produces release binaries, so
pubspec.lock is intentionally tracked. Dependency updates should be isolated
to dependency-specific PRs, usually from Dependabot, and the matching
pubspec.lock changes should be reviewed alongside any pubspec.yaml changes.
CI and release builds install dependencies with:
dart pub get --enforce-lockfile
This fails the build if the lockfile is missing, out of sync with
pubspec.yaml, or if resolved package content does not match the hashes in the
lockfile.
Release archives include the platform binary, pubspec.lock, a build manifest,
and SHA256SUMS. To rebuild a released binary from source, check out the
release tag and run:
dart pub get --enforce-lockfile
dart compile exe bin/raygun_cli.dart -o raygun-cli
When installing raygun_cli as a dependency or global package from pub.dev,
Dart resolves dependencies in the consuming environment. The lockfile policy
above applies to this repository's development, CI, and release artifacts.
Call to raygun-cli with a command and arguments.
raygun-cli <command> <arguments>
Or use directly from sources:
dart bin/raygun_cli.dart <command> <arguments>
Using the --help argument will usually output a list of command-specifc arguments and their meanings.
Example:
raygun-cli deployments --help
All raygun-cli commands share the same configuration parameters.
- App ID: The Application ID in Raygun.com.
- Token: An access token from https://app.raygun.com/user/tokens.
- API key: The API key of your application in Raygun.com
You can provide these parameters via three sources, listed below in order of priority (highest first):
- CLI argument — e.g.
--app-id=<id> - Environment variable — e.g.
RAYGUN_APP_ID=<id> .envconfig file — see Config file below
| Parameter | Argument | Environment Variable / .env key |
|---|---|---|
| App ID | app-id |
RAYGUN_APP_ID |
| Token | token |
RAYGUN_TOKEN |
| API key | api-key |
RAYGUN_API_KEY |
raygun-cli can read its configuration from a standard .env file. By
default, it looks for a .env in the current working directory and, if not
found, walks up parent directories until it finds one — stopping at your home
directory ($HOME / %USERPROFILE%). If neither is set (e.g. in some
sandboxed CI runners or minimal containers), discovery is restricted to the
current directory only; pass --config-file=<path> for an explicit override
in those environments.
⚠️ A.envtypically contains secrets — make sure to add it to your.gitignoreto avoid committing tokens to source control.
Empty (RAYGUN_TOKEN=) and whitespace-only (RAYGUN_TOKEN=" ") values are
treated as unset at every tier (CLI argument, environment variable, and
.env file) and fall through to the next source. This way, copying
example/.env.example and forgetting to fill in a
value — or fat-fingering an env var to whitespace — surfaces a friendly
Error: Missing "..." instead of an opaque HTTP error from the Raygun API.
Run with -v / --verbose to see exactly which source supplied each value.
Example .env:
# Raygun CLI configuration
RAYGUN_APP_ID=your-app-id
RAYGUN_TOKEN=your-personal-access-token
RAYGUN_API_KEY=your-application-api-keyA sample is provided at example/.env.example.
Upload sourcemaps to raygun.com.
raygun-cli sourcemap <arguments>
Where the arguments are:
uriis the full URI where your project will be installed to.input-mapis the map file to upload.
raygun-cli sourcemap --input-map=path/to/map/index.js.map --uri=https://example.com/index.js --app-id=APP_ID --token=TOKEN
The command can be used to upload any single sourcemap.
To upload Flutter web sourcemaps to raygun.com, navigate to your project root and run the sourcemap command and set the platform argument (or -p) to flutter.
The input-map argument is optional for Flutter web projects.
raygun-cli will try to find the main.dart.js.map file in build/web/main.dart.js.map automatically.
raygun-cli sourcemap -p flutter --uri=https://example.com/main.dart.js --app-id=APP_ID --token=TOKEN
Not available yet!
Upload Proguard and R8 mapping files for Android to raygun.com.
raygun-cli proguard <arguments>
Minimal required arguments are:
raygun-cli proguard --app-id=APP_ID --version=<app version> --path=<Path to mapping.txt file> --external-access-token=<EAT from your Raygun user account settings> --overwrite
Example outputs:
Success:
Uploading: <somewhere>/mapping.txt
Success uploading Proguard/R8 mapping file: 200
Result: true
Mapping file for version already exists:
Uploading: <somewhere>/mapping.txt
Error uploading Proguard/R8 mapping file: 400
Response: File 1.2.3.5 already exists. Please set overwrite=true if you really want to overwrite it.
Wrong External Access Token:
Uploading: <somewhere>/mapping.txt
Error uploading Proguard/R8 mapping file: 302
Response:
Upload dSYM files for iOS to raygun.com.
raygun-cli dsym <arguments>
Minimal required arguments are:
raygun-cli dsym --app-id=APP_ID --path=<Path to dSYM zip file> --external-access-token=<EAT from your Raygun user account settings>
Example outputs:
Success:
Uploading: <somewhere>/app.dSYM.zip
Success uploading dSYM file: 200
Result: {"Status":"Success","Message":"dSYM files uploaded"}
Wrong External Access Token:
Uploading: <somewhere>/app.dSYM.zip
Error uploading dSYM file: 302
Response:
Invalid dSYM file:
Uploading: <somewhere>/invalid.zip
Success uploading dSYM file: 200
Result: {"Status":"Failure","Message":"No dSYM file found"}
Manages obfuscation symbols to raygun.com.
raygun-cli symbols <subcommand> <arguments>
Subcommands
upload: Upload a symbols file.list: List uploaded symbols files.delete: Delete an uploaded symbols file.
Upload subcommand
Upload a symbols file.
Provide the path to the symbols file (e.g. app.android-arm64.symbols), as well as the application version (e.g. 1.0.0).
raygun-cli symbols upload --path=<path to symbols file> --version=<app version> --app-id=APP_ID --token=TOKEN
List subcommand
List the uploaded symbols file.
raygun-cli symbols list --app-id=APP_ID --token=TOKEN
Example output:
List of symbols:
Symbols File: app.android-arm64.symbols
Identifier: 2c7a3u3
App Version: 0.0.1
Symbols File: app.android-x64.symbols
Identifier: 2c7a3u4
App Version: 0.0.1
Symbols File: app.android-arm.symbols
Identifier: 2c7a7k6
App Version: 0.0.1
Delete subcommand
Delete an uploaded symbols file.
Provide the identifier (id) of the symbols file (e.g. --id=2c7a3u3). You can obtain the identifier with the list subcommand.
raygun-cli symbols delete --id=<id> --app-id=APP_ID --token=TOKEN
Send deployment tracking notifications to raygun.com.
Minimal required arguments are:
raygun-cli depoyments --token=TOKEN --version=<app version> --api-key=API_KEY
Example outputs:
Success:
Success creating deployment: 201
Deployment identifier: 2cewu0m
Deployment created successfully
Missing Access Token:
Error creating deployment: 401
Response: {"type":"https://tools.ietf.org/html/rfc9110#section-15.5.2","title":"Unauthorized","status":401,"traceId":"00-b9f01ba3ff4a938501c760e6924acc81-53e9411804aa9f2f-00"}
Failed to create deployment
Access Token misses access to application:
Error creating deployment: 404
Response: {"type":"https://tools.ietf.org/html/rfc9110#section-15.5.5","title":"Not Found","status":404,"traceId":"00-5c3a2423f922d787e20d01456b6c1836-b88c29232af94db8-00"}
Failed to create deployment
Compile a self-contained exec:
dart compile exe bin/raygun_cli.dart -o raygun-cli
Note: The binary is compiled for the architecture and host system. To compile for macOS and Windows we must setup CI VMs. See: https://dart.dev/tools/dart-compile#known-limitations