@9apes/cli
v0.1.1
Published
Connects your production builds to the 9apes error tracking pipeline
Downloads
35
Readme
@9apes/cli
Sourcemap tooling by 9Apes
Inject debug IDs into your JavaScript bundles and upload source maps to the 9Apes platform -- as a CLI or a Vite plugin.
Overview
@9apes/cli connects your production builds to the 9Apes error tracking pipeline. It generates unique debug IDs, injects them into compiled JavaScript files and their source maps, then uploads everything to your 9Apes project so stack traces can be un-minified in the dashboard.
A valid 9Apes API key is required. Get yours at 9apes.com.
Two ways to use it
| Method | Best for |
| --- | --- |
| Vite plugin (@9apes/cli/vite) | Vite-based apps -- runs automatically at the end of vite build |
| CLI (apesdev-cli / apeslocal-cli) | Any build tool -- run as a post-build step |
Installation
pnpm add -D @9apes/cliVite Plugin
Add withNineapesSourcemaps to your Vite config and remove any manual post-build CLI step -- the plugin handles injection and upload automatically when vite build finishes.
// vite.config.ts
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import { withNineapesSourcemaps } from '@9apes/cli/vite';
export default defineConfig({
plugins: [
vue(),
withNineapesSourcemaps({
projectId: 'my-project',
apiKey: 'YOUR_API_KEY',
}),
],
build: {
sourcemap: true,
},
});Options
| Option | Type | Required | Description |
| --- | --- | --- | --- |
| projectId | string | Yes | Project identifier in your 9Apes dashboard |
| apiKey | string | Yes | 9Apes API key |
| baseUrl | string | No | API base URL (defaults to https://dev.nineapes.com/api/v1) |
| releaseVersion | string | No | Tag uploads with a release version |
Make sure
build.sourcemapistruein your Vite config -- the plugin needs.js.mapfiles to work.
CLI Usage
Two binaries are provided for different environments:
| Binary | API endpoint | Config file |
| --- | --- | --- |
| apesdev-cli | https://dev.nineapes.com/api/v1 | config-dev.json |
| apeslocal-cli | http://127.0.0.1:8000/api/v1 | config-local.json |
Both CLIs share the same command structure.
config set [apikey]
Save an API key for subsequent commands.
apesdev-cli config set # interactive prompt
apesdev-cli config set YOUR_KEY # inlineconfig show
Display the currently saved API key.
apesdev-cli config showsourcemaps inject <path>
Inject debug IDs and upload source maps from a build output directory.
apesdev-cli sourcemaps inject ./dist --projectid my-project
apesdev-cli sourcemaps inject ./dist --projectid my-project --release-version 1.2.0
apesdev-cli sourcemaps inject ./dist --projectid my-project --apikey YOUR_KEY| Argument / Option | Required | Description |
| --- | --- | --- |
| <path> | Yes | Directory containing .js and .js.map files |
| --projectid <id> | Yes | Project identifier |
| --release-version <version> | No | Release version tag |
| --apikey <key> | No | API key (overrides saved config) |
How It Works
- Scans the output directory for
.jsand.js.mapfile pairs - Generates a unique UUID (debug ID) per file pair
- Injects a small runtime snippet into each
.jsfile that maps stack traces to its debug ID - Adds a
debug_idfield to each.js.mapfile - Uploads both files to 9Apes with project ID, release version, and git commit hash
- The 9Apes dashboard uses these debug IDs to match production errors to their original source maps
License
This software is proprietary and provided under a commercial license by 9Apes Technologies. Unauthorized copying, modification, distribution, or use of this software outside the terms of your subscription agreement is strictly prohibited.
Refer to your service agreement or contact [email protected] for licensing details.
Support
| Channel | Details | | --- | --- | | Documentation | docs.9apes.com | | Email | [email protected] | | Dashboard | app.9apes.com |
For enterprise support plans and SLAs, contact your account manager.
