Package Exports
- @stacksleuth/cli
- @stacksleuth/cli/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@stacksleuth/cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@stacksleuth/cli
Command-line interface for StackSleuth performance profiling tool.
Installation
npm install -g @stacksleuth/cliUsage
Initialize StackSleuth in your project
sleuth initInteractive setup wizard that will:
- Generate configuration files
- Create example integration code
- Set up framework-specific templates
Start real-time profiling
sleuth watchOptions:
--port <port>- Dashboard port (default: 3001)--sampling <rate>- Sampling rate 0.0-1.0 (default: 1.0)--no-dashboard- Disable dashboard UI
Generate performance reports
sleuth report --format json --output report.jsonOptions:
--format <format>- Output format: json or csv (default: json)--output <file>- Output file path--last <duration>- Include traces from last duration (e.g., "5m", "1h")
Show statistics
sleuth statsDashboard Features
When you run sleuth watch, a real-time dashboard will be available at http://localhost:3001 featuring:
- Live trace visualization
- Performance metrics (P50, P95, P99)
- Error tracking
- Performance issue detection with suggestions
- WebSocket real-time updates
Configuration
The CLI reads configuration from:
stacksleuth.config.jsorstacksleuth.config.ts.stacksleuthrc(JSON format)
Example configuration:
export default {
enabled: process.env.NODE_ENV !== 'production',
sampling: { rate: 0.1 },
filters: {
excludeUrls: [/\/health$/, /\.(js|css|png|jpg)$/],
minDuration: 10
},
output: {
console: true,
dashboard: { enabled: true, port: 3001 }
}
};