recker 1.0.35 → 1.0.36-next.8e08a0c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/core/client.js +11 -1
- package/dist/browser/core/error-handler.d.ts +44 -0
- package/dist/browser/core/error-handler.js +520 -0
- package/dist/browser/core/request-promise.d.ts +4 -0
- package/dist/browser/core/request-promise.js +12 -0
- package/dist/browser/core/response.d.ts +4 -0
- package/dist/browser/core/response.js +10 -0
- package/dist/browser/plugins/csv.d.ts +42 -0
- package/dist/browser/plugins/csv.js +386 -0
- package/dist/browser/plugins/yaml.d.ts +28 -0
- package/dist/browser/plugins/yaml.js +730 -0
- package/dist/cli/helpers.d.ts +54 -0
- package/dist/cli/helpers.js +548 -0
- package/dist/cli/index.js +67 -28
- package/dist/cli/tui/shell.d.ts +1 -0
- package/dist/cli/tui/shell.js +690 -21
- package/dist/core/client.js +11 -1
- package/dist/core/error-handler.d.ts +44 -0
- package/dist/core/error-handler.js +520 -0
- package/dist/core/request-promise.d.ts +4 -0
- package/dist/core/request-promise.js +12 -0
- package/dist/core/response.d.ts +4 -0
- package/dist/core/response.js +10 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/plugins/csv.d.ts +42 -0
- package/dist/plugins/csv.js +386 -0
- package/dist/plugins/yaml.d.ts +28 -0
- package/dist/plugins/yaml.js +730 -0
- package/package.json +1 -1
package/dist/cli/tui/shell.js
CHANGED
|
@@ -17,6 +17,7 @@ import { openSearchPanel } from './search-panel.js';
|
|
|
17
17
|
import { ScrollBuffer, parseScrollKey, parseMouseScroll, disableMouseReporting } from './scroll-buffer.js';
|
|
18
18
|
import { analyzeSeo, SeoSpider } from '../../seo/index.js';
|
|
19
19
|
import { resolvePreset } from '../presets.js';
|
|
20
|
+
import { summarizeErrors, formatErrorSummary } from '../helpers.js';
|
|
20
21
|
let highlight;
|
|
21
22
|
async function initDependencies() {
|
|
22
23
|
if (!highlight) {
|
|
@@ -350,7 +351,12 @@ export class RekShell {
|
|
|
350
351
|
const cmd = parts[0].toLowerCase();
|
|
351
352
|
switch (cmd) {
|
|
352
353
|
case 'help':
|
|
353
|
-
|
|
354
|
+
if (parts[1]) {
|
|
355
|
+
this.printCommandHelp(parts[1]);
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
this.printHelp();
|
|
359
|
+
}
|
|
354
360
|
return;
|
|
355
361
|
case 'clear':
|
|
356
362
|
console.clear();
|
|
@@ -2482,26 +2488,9 @@ ${colors.bold('Network:')}
|
|
|
2482
2488
|
console.log(` ${colors.cyan(page.links.length.toString().padStart(3))} ${title}`);
|
|
2483
2489
|
}
|
|
2484
2490
|
}
|
|
2485
|
-
|
|
2486
|
-
const
|
|
2487
|
-
|
|
2488
|
-
return `HTTP ${statusMatch[1]}`;
|
|
2489
|
-
}
|
|
2490
|
-
return error.length > 50 ? error.slice(0, 47) + '...' : error;
|
|
2491
|
-
};
|
|
2492
|
-
if (result.errors.length > 0 && result.errors.length <= 10) {
|
|
2493
|
-
console.log(colors.bold('\n Errors:'));
|
|
2494
|
-
for (const err of result.errors) {
|
|
2495
|
-
const path = new URL(err.url).pathname;
|
|
2496
|
-
console.log(` ${colors.red('✗')} ${path.padEnd(25)} ${colors.gray('→')} ${formatError(err.error)}`);
|
|
2497
|
-
}
|
|
2498
|
-
}
|
|
2499
|
-
else if (result.errors.length > 10) {
|
|
2500
|
-
console.log(colors.yellow(`\n ${result.errors.length} errors (showing first 10):`));
|
|
2501
|
-
for (const err of result.errors.slice(0, 10)) {
|
|
2502
|
-
const path = new URL(err.url).pathname;
|
|
2503
|
-
console.log(` ${colors.red('✗')} ${path.padEnd(25)} ${colors.gray('→')} ${formatError(err.error)}`);
|
|
2504
|
-
}
|
|
2491
|
+
if (result.errors.length > 0) {
|
|
2492
|
+
const errorSummary = summarizeErrors(result.errors);
|
|
2493
|
+
console.log(formatErrorSummary(errorSummary));
|
|
2505
2494
|
}
|
|
2506
2495
|
if (outputFile) {
|
|
2507
2496
|
const reportData = {
|
|
@@ -4581,6 +4570,686 @@ ${colors.bold('Network:')}
|
|
|
4581
4570
|
› @openai What is the capital of France?
|
|
4582
4571
|
› @anthropic Explain quantum computing
|
|
4583
4572
|
› spider example.com depth=2 limit=50
|
|
4573
|
+
|
|
4574
|
+
${colors.bold('For detailed help on a specific command:')}
|
|
4575
|
+
${colors.green('help <command>')} ${colors.gray('e.g., help spider, help seo, help dns')}
|
|
4584
4576
|
`);
|
|
4585
4577
|
}
|
|
4578
|
+
printCommandHelp(command) {
|
|
4579
|
+
const cmd = command.toLowerCase().replace(/^help\s+/, '');
|
|
4580
|
+
const helpContent = {
|
|
4581
|
+
'get': `
|
|
4582
|
+
${colors.bold(colors.cyan('GET - HTTP GET Request'))}
|
|
4583
|
+
|
|
4584
|
+
${colors.bold('Usage:')}
|
|
4585
|
+
${colors.green('get <path>')} Make a GET request
|
|
4586
|
+
${colors.green('get <url>')} Make a GET request to full URL
|
|
4587
|
+
|
|
4588
|
+
${colors.bold('Examples:')}
|
|
4589
|
+
${colors.gray('# Simple request (requires url to be set first)')}
|
|
4590
|
+
› url api.example.com
|
|
4591
|
+
› get /users
|
|
4592
|
+
|
|
4593
|
+
${colors.gray('# Full URL request')}
|
|
4594
|
+
› get https://api.example.com/users
|
|
4595
|
+
|
|
4596
|
+
${colors.gray('# With headers')}
|
|
4597
|
+
› get /users Authorization:"Bearer token123"
|
|
4598
|
+
|
|
4599
|
+
${colors.gray('# With query params (encoded in URL)')}
|
|
4600
|
+
› get /search?q=test&page=1
|
|
4601
|
+
`,
|
|
4602
|
+
'post': `
|
|
4603
|
+
${colors.bold(colors.cyan('POST - HTTP POST Request'))}
|
|
4604
|
+
|
|
4605
|
+
${colors.bold('Usage:')}
|
|
4606
|
+
${colors.green('post <path> [key=value...]')} Make a POST request with data
|
|
4607
|
+
|
|
4608
|
+
${colors.bold('Parameters:')}
|
|
4609
|
+
${colors.white('key=value')} String value
|
|
4610
|
+
${colors.white('key:=value')} Typed value (number, boolean, null)
|
|
4611
|
+
${colors.white('Key:value')} Header
|
|
4612
|
+
|
|
4613
|
+
${colors.bold('Examples:')}
|
|
4614
|
+
${colors.gray('# Simple POST with string data')}
|
|
4615
|
+
› post /users name="John Doe" email="john@example.com"
|
|
4616
|
+
|
|
4617
|
+
${colors.gray('# POST with typed values')}
|
|
4618
|
+
› post /users name="John" age:=30 active:=true
|
|
4619
|
+
|
|
4620
|
+
${colors.gray('# POST with headers')}
|
|
4621
|
+
› post /login Content-Type:application/json username="admin" password="secret"
|
|
4622
|
+
|
|
4623
|
+
${colors.gray('# POST to full URL')}
|
|
4624
|
+
› post https://api.example.com/users name="Test"
|
|
4625
|
+
`,
|
|
4626
|
+
'spider': `
|
|
4627
|
+
${colors.bold(colors.cyan('SPIDER - Web Crawler'))}
|
|
4628
|
+
|
|
4629
|
+
${colors.bold('Usage:')}
|
|
4630
|
+
${colors.green('spider <url> [options]')}
|
|
4631
|
+
|
|
4632
|
+
${colors.bold('Options:')}
|
|
4633
|
+
${colors.white('depth=N')} Max crawl depth (default: 5)
|
|
4634
|
+
${colors.white('limit=N')} Max pages to crawl (default: 100)
|
|
4635
|
+
${colors.white('concurrency=N')} Parallel requests (default: 5)
|
|
4636
|
+
${colors.white('seo')} Enable SEO analysis mode
|
|
4637
|
+
${colors.white('output=file')} Save JSON report to file
|
|
4638
|
+
|
|
4639
|
+
${colors.bold('Examples:')}
|
|
4640
|
+
${colors.gray('# Basic crawl with defaults')}
|
|
4641
|
+
› spider example.com
|
|
4642
|
+
|
|
4643
|
+
${colors.gray('# Shallow crawl (only 2 levels deep)')}
|
|
4644
|
+
› spider example.com depth=2
|
|
4645
|
+
|
|
4646
|
+
${colors.gray('# Quick audit (limited pages)')}
|
|
4647
|
+
› spider example.com limit=20 depth=3
|
|
4648
|
+
|
|
4649
|
+
${colors.gray('# Full SEO analysis')}
|
|
4650
|
+
› spider example.com seo
|
|
4651
|
+
|
|
4652
|
+
${colors.gray('# SEO with report export')}
|
|
4653
|
+
› spider example.com seo output=seo-report.json
|
|
4654
|
+
|
|
4655
|
+
${colors.gray('# High concurrency for fast crawl')}
|
|
4656
|
+
› spider example.com concurrency=10 limit=500
|
|
4657
|
+
|
|
4658
|
+
${colors.bold('Error Handling:')}
|
|
4659
|
+
${colors.gray('Errors are categorized by type:')}
|
|
4660
|
+
• ${colors.red('HTTP 4xx/5xx')} - Server returned error status
|
|
4661
|
+
• ${colors.red('Timeout')} - Request took too long (default: 10s)
|
|
4662
|
+
• ${colors.red('DNS')} - Could not resolve hostname
|
|
4663
|
+
• ${colors.red('Network')} - Connection refused/reset
|
|
4664
|
+
• ${colors.red('Parse')} - Invalid HTML/content type
|
|
4665
|
+
|
|
4666
|
+
${colors.bold('Tips:')}
|
|
4667
|
+
• Use ${colors.white('seo')} mode for comprehensive website audits
|
|
4668
|
+
• Start with low ${colors.white('limit')} to test, then increase
|
|
4669
|
+
• Results stored in ${colors.white('lastResponse')} for further analysis
|
|
4670
|
+
• Use ${colors.white('output=')} to save large reports
|
|
4671
|
+
`,
|
|
4672
|
+
'seo': `
|
|
4673
|
+
${colors.bold(colors.cyan('SEO - Search Engine Optimization Analysis'))}
|
|
4674
|
+
|
|
4675
|
+
${colors.bold('Usage:')}
|
|
4676
|
+
${colors.green('seo <url> [options]')}
|
|
4677
|
+
|
|
4678
|
+
${colors.bold('Options:')}
|
|
4679
|
+
${colors.white('-a, --all')} Show all checks (including passed)
|
|
4680
|
+
${colors.white('--format json')} Output as JSON (for scripts/tools)
|
|
4681
|
+
|
|
4682
|
+
${colors.bold('What it analyzes:')}
|
|
4683
|
+
• Title tag (length, presence, keywords)
|
|
4684
|
+
• Meta description (length, presence)
|
|
4685
|
+
• Headings (H1 presence, hierarchy)
|
|
4686
|
+
• Images (alt text, optimization)
|
|
4687
|
+
• Links (internal/external balance)
|
|
4688
|
+
• OpenGraph tags (social sharing)
|
|
4689
|
+
• Twitter Card tags
|
|
4690
|
+
• JSON-LD structured data
|
|
4691
|
+
• Technical SEO (canonical, viewport, lang)
|
|
4692
|
+
|
|
4693
|
+
${colors.bold('Examples:')}
|
|
4694
|
+
${colors.gray('# Basic SEO analysis')}
|
|
4695
|
+
› seo example.com
|
|
4696
|
+
|
|
4697
|
+
${colors.gray('# Show all checks including passed')}
|
|
4698
|
+
› seo example.com -a
|
|
4699
|
+
|
|
4700
|
+
${colors.gray('# Export as JSON for CI/CD')}
|
|
4701
|
+
› seo example.com --format json
|
|
4702
|
+
|
|
4703
|
+
${colors.gray('# Using current base URL')}
|
|
4704
|
+
› url example.com
|
|
4705
|
+
› seo
|
|
4706
|
+
|
|
4707
|
+
${colors.bold('Grades:')}
|
|
4708
|
+
${colors.green('A')} = 80-100 Excellent
|
|
4709
|
+
${colors.blue('B')} = 60-79 Good
|
|
4710
|
+
${colors.yellow('C')} = 40-59 Needs work
|
|
4711
|
+
${colors.red('D/F')} = 0-39 Poor
|
|
4712
|
+
|
|
4713
|
+
${colors.bold('Tips:')}
|
|
4714
|
+
• Run ${colors.white('spider example.com seo')} for site-wide analysis
|
|
4715
|
+
• JSON output can be piped to tools like ${colors.white('jq')}
|
|
4716
|
+
• Result stored in ${colors.white('lastResponse')} for inspection
|
|
4717
|
+
`,
|
|
4718
|
+
'dns': `
|
|
4719
|
+
${colors.bold(colors.cyan('DNS - Domain Name System Lookup'))}
|
|
4720
|
+
|
|
4721
|
+
${colors.bold('Usage:')}
|
|
4722
|
+
${colors.green('dns <domain>')}
|
|
4723
|
+
|
|
4724
|
+
${colors.bold('Record types resolved:')}
|
|
4725
|
+
• A, AAAA (IP addresses)
|
|
4726
|
+
• MX (mail servers)
|
|
4727
|
+
• NS (name servers)
|
|
4728
|
+
• TXT (SPF, DMARC, domain verification)
|
|
4729
|
+
• CNAME (aliases)
|
|
4730
|
+
|
|
4731
|
+
${colors.bold('Examples:')}
|
|
4732
|
+
${colors.gray('# Full DNS lookup')}
|
|
4733
|
+
› dns example.com
|
|
4734
|
+
|
|
4735
|
+
${colors.gray('# Using current base URL domain')}
|
|
4736
|
+
› url https://api.example.com
|
|
4737
|
+
› dns
|
|
4738
|
+
|
|
4739
|
+
${colors.bold('Related commands:')}
|
|
4740
|
+
${colors.green('dns:propagate <domain> <type>')} Check DNS propagation worldwide
|
|
4741
|
+
${colors.green('dns:email <domain>')} Email-specific DNS (MX, SPF, DMARC)
|
|
4742
|
+
${colors.green('dns:health <domain>')} Overall DNS health check
|
|
4743
|
+
${colors.green('dns:spf <domain>')} SPF record validation
|
|
4744
|
+
${colors.green('dns:dmarc <domain>')} DMARC record validation
|
|
4745
|
+
${colors.green('dns:dkim <domain> <selector>')} DKIM record lookup
|
|
4746
|
+
${colors.green('dns:dig <domain> [type]')} Raw DNS query (like dig)
|
|
4747
|
+
${colors.green('dns:generate <type> [options]')} Generate DNS records
|
|
4748
|
+
|
|
4749
|
+
${colors.bold('Examples:')}
|
|
4750
|
+
› dns:propagate example.com A
|
|
4751
|
+
› dns:email example.com
|
|
4752
|
+
› dns:dkim example.com google
|
|
4753
|
+
`,
|
|
4754
|
+
'whois': `
|
|
4755
|
+
${colors.bold(colors.cyan('WHOIS - Domain/IP Registration Lookup'))}
|
|
4756
|
+
|
|
4757
|
+
${colors.bold('Usage:')}
|
|
4758
|
+
${colors.green('whois <domain>')} Lookup domain registration
|
|
4759
|
+
${colors.green('whois <ip>')} Lookup IP allocation
|
|
4760
|
+
|
|
4761
|
+
${colors.bold('Information provided:')}
|
|
4762
|
+
• Registrar details
|
|
4763
|
+
• Creation/expiration dates
|
|
4764
|
+
• Name servers
|
|
4765
|
+
• Domain status
|
|
4766
|
+
• Registrant info (if public)
|
|
4767
|
+
|
|
4768
|
+
${colors.bold('Examples:')}
|
|
4769
|
+
${colors.gray('# Domain lookup')}
|
|
4770
|
+
› whois google.com
|
|
4771
|
+
|
|
4772
|
+
${colors.gray('# IP lookup')}
|
|
4773
|
+
› whois 8.8.8.8
|
|
4774
|
+
|
|
4775
|
+
${colors.gray('# Using current base URL')}
|
|
4776
|
+
› url example.com
|
|
4777
|
+
› whois
|
|
4778
|
+
|
|
4779
|
+
${colors.bold('Related commands:')}
|
|
4780
|
+
${colors.green('rdap <domain>')} Modern WHOIS using RDAP protocol
|
|
4781
|
+
`,
|
|
4782
|
+
'tls': `
|
|
4783
|
+
${colors.bold(colors.cyan('TLS/SSL - Certificate Inspection'))}
|
|
4784
|
+
|
|
4785
|
+
${colors.bold('Usage:')}
|
|
4786
|
+
${colors.green('tls <host> [port]')} Inspect TLS certificate (default port: 443)
|
|
4787
|
+
|
|
4788
|
+
${colors.bold('Information provided:')}
|
|
4789
|
+
• Certificate subject/issuer
|
|
4790
|
+
• Validity period (expiration warning)
|
|
4791
|
+
• Protocol version (TLS 1.2/1.3)
|
|
4792
|
+
• Cipher suite
|
|
4793
|
+
• Certificate chain
|
|
4794
|
+
• SAN (Subject Alternative Names)
|
|
4795
|
+
|
|
4796
|
+
${colors.bold('Examples:')}
|
|
4797
|
+
${colors.gray('# Standard HTTPS inspection')}
|
|
4798
|
+
› tls example.com
|
|
4799
|
+
|
|
4800
|
+
${colors.gray('# Custom port (e.g., SMTP with STARTTLS)')}
|
|
4801
|
+
› tls mail.example.com 587
|
|
4802
|
+
|
|
4803
|
+
${colors.gray('# Using current base URL')}
|
|
4804
|
+
› url https://secure.example.com
|
|
4805
|
+
› tls
|
|
4806
|
+
|
|
4807
|
+
${colors.bold('Aliases:')}
|
|
4808
|
+
${colors.green('ssl')} is an alias for ${colors.green('tls')}
|
|
4809
|
+
`,
|
|
4810
|
+
'security': `
|
|
4811
|
+
${colors.bold(colors.cyan('SECURITY - HTTP Security Headers Analysis'))}
|
|
4812
|
+
|
|
4813
|
+
${colors.bold('Usage:')}
|
|
4814
|
+
${colors.green('security <url>')}
|
|
4815
|
+
|
|
4816
|
+
${colors.bold('Headers analyzed:')}
|
|
4817
|
+
• Strict-Transport-Security (HSTS)
|
|
4818
|
+
• Content-Security-Policy (CSP)
|
|
4819
|
+
• X-Frame-Options
|
|
4820
|
+
• X-Content-Type-Options
|
|
4821
|
+
• X-XSS-Protection
|
|
4822
|
+
• Referrer-Policy
|
|
4823
|
+
• Permissions-Policy
|
|
4824
|
+
|
|
4825
|
+
${colors.bold('Examples:')}
|
|
4826
|
+
${colors.gray('# Analyze security headers')}
|
|
4827
|
+
› security example.com
|
|
4828
|
+
|
|
4829
|
+
${colors.gray('# Using current base URL')}
|
|
4830
|
+
› url example.com
|
|
4831
|
+
› security
|
|
4832
|
+
|
|
4833
|
+
${colors.bold('Grades:')}
|
|
4834
|
+
${colors.green('A+')} ${colors.green('A')} = Excellent security posture
|
|
4835
|
+
${colors.blue('B')} = Good, minor improvements possible
|
|
4836
|
+
${colors.yellow('C')} = Acceptable, several headers missing
|
|
4837
|
+
${colors.red('D')} ${colors.red('F')} = Poor, critical headers missing
|
|
4838
|
+
`,
|
|
4839
|
+
'load': `
|
|
4840
|
+
${colors.bold(colors.cyan('LOAD - HTTP Load Testing'))}
|
|
4841
|
+
|
|
4842
|
+
${colors.bold('Usage:')}
|
|
4843
|
+
${colors.green('load <url> [options]')}
|
|
4844
|
+
|
|
4845
|
+
${colors.bold('Options:')}
|
|
4846
|
+
${colors.white('users=N')} Concurrent virtual users (default: 50)
|
|
4847
|
+
${colors.white('duration=N')} Test duration in seconds (default: 300)
|
|
4848
|
+
${colors.white('ramp=N')} Ramp-up time in seconds (default: 5)
|
|
4849
|
+
${colors.white('mode=MODE')} Test mode (see below)
|
|
4850
|
+
${colors.white('http2')} Enable HTTP/2
|
|
4851
|
+
|
|
4852
|
+
${colors.bold('Modes:')}
|
|
4853
|
+
${colors.cyan('realistic')} Simulates real users with think time (default)
|
|
4854
|
+
${colors.cyan('throughput')} Maximum requests per second
|
|
4855
|
+
${colors.cyan('stress')} Find breaking point with increasing load
|
|
4856
|
+
|
|
4857
|
+
${colors.bold('Examples:')}
|
|
4858
|
+
${colors.gray('# Quick load test (50 users, 5 minutes)')}
|
|
4859
|
+
› load https://api.example.com/endpoint
|
|
4860
|
+
|
|
4861
|
+
${colors.gray('# Stress test with 100 users')}
|
|
4862
|
+
› load /api/endpoint users=100 mode=stress
|
|
4863
|
+
|
|
4864
|
+
${colors.gray('# Short throughput test')}
|
|
4865
|
+
› load /api/health users=20 duration=30 mode=throughput
|
|
4866
|
+
|
|
4867
|
+
${colors.gray('# HTTP/2 enabled')}
|
|
4868
|
+
› load /api/endpoint http2 users=50
|
|
4869
|
+
|
|
4870
|
+
${colors.bold('Dashboard:')}
|
|
4871
|
+
• Real-time RPS, latency percentiles
|
|
4872
|
+
• Error rate monitoring
|
|
4873
|
+
• Progress bar and ETA
|
|
4874
|
+
• Press ${colors.white('Ctrl+C')} to stop early
|
|
4875
|
+
|
|
4876
|
+
${colors.bold('Tips:')}
|
|
4877
|
+
• Start with low users and increase gradually
|
|
4878
|
+
• Use ${colors.white('mode=stress')} to find limits
|
|
4879
|
+
• ${colors.white('ramp')} helps avoid thundering herd
|
|
4880
|
+
`,
|
|
4881
|
+
'ws': `
|
|
4882
|
+
${colors.bold(colors.cyan('WS - WebSocket Client'))}
|
|
4883
|
+
|
|
4884
|
+
${colors.bold('Usage:')}
|
|
4885
|
+
${colors.green('ws <url>')} Connect to WebSocket server
|
|
4886
|
+
|
|
4887
|
+
${colors.bold('Interactive mode commands:')}
|
|
4888
|
+
• Type message and press Enter to send
|
|
4889
|
+
• ${colors.white('/close')} - Close connection
|
|
4890
|
+
• ${colors.white('/ping')} - Send ping frame
|
|
4891
|
+
• ${colors.white('Ctrl+C')} - Exit
|
|
4892
|
+
|
|
4893
|
+
${colors.bold('Examples:')}
|
|
4894
|
+
${colors.gray('# Connect to WebSocket server')}
|
|
4895
|
+
› ws wss://echo.websocket.org
|
|
4896
|
+
|
|
4897
|
+
${colors.gray('# Local development server')}
|
|
4898
|
+
› ws ws://localhost:8080/socket
|
|
4899
|
+
|
|
4900
|
+
${colors.bold('Protocol notes:')}
|
|
4901
|
+
• Supports both ${colors.white('ws://')} and ${colors.white('wss://')} (secure)
|
|
4902
|
+
• Automatic reconnection not enabled by default
|
|
4903
|
+
• JSON messages are pretty-printed
|
|
4904
|
+
`,
|
|
4905
|
+
'scrap': `
|
|
4906
|
+
${colors.bold(colors.cyan('SCRAP - Web Scraping'))}
|
|
4907
|
+
|
|
4908
|
+
${colors.bold('Usage:')}
|
|
4909
|
+
${colors.green('scrap <url>')} Fetch and parse HTML document
|
|
4910
|
+
|
|
4911
|
+
${colors.bold('After scraping, use these commands:')}
|
|
4912
|
+
${colors.green('$ <selector>')} Query elements (CSS selector)
|
|
4913
|
+
${colors.green('$text <selector>')} Extract text content
|
|
4914
|
+
${colors.green('$attr <name> <sel>')} Get attribute values
|
|
4915
|
+
${colors.green('$html <selector>')} Get inner HTML
|
|
4916
|
+
${colors.green('$links [selector]')} List all links
|
|
4917
|
+
${colors.green('$images [selector]')} List all images
|
|
4918
|
+
${colors.green('$scripts')} List all scripts
|
|
4919
|
+
${colors.green('$css')} List all stylesheets
|
|
4920
|
+
${colors.green('$table <selector>')} Extract table as JSON
|
|
4921
|
+
|
|
4922
|
+
${colors.bold('Examples:')}
|
|
4923
|
+
${colors.gray('# Scrape a page')}
|
|
4924
|
+
› scrap https://example.com
|
|
4925
|
+
|
|
4926
|
+
${colors.gray('# Get all H1 tags')}
|
|
4927
|
+
› $ h1
|
|
4928
|
+
|
|
4929
|
+
${colors.gray('# Get link hrefs')}
|
|
4930
|
+
› $attr href a
|
|
4931
|
+
|
|
4932
|
+
${colors.gray('# Extract table data')}
|
|
4933
|
+
› $table table.data
|
|
4934
|
+
|
|
4935
|
+
${colors.gray('# Get specific element text')}
|
|
4936
|
+
› $text .product-price
|
|
4937
|
+
|
|
4938
|
+
${colors.bold('Advanced:')}
|
|
4939
|
+
${colors.green('$sourcemaps')} Find sourcemaps
|
|
4940
|
+
${colors.green('$unmap <url>')} Parse sourcemap
|
|
4941
|
+
${colors.green('$beautify <url>')} Beautify minified code
|
|
4942
|
+
`,
|
|
4943
|
+
'graphql': `
|
|
4944
|
+
${colors.bold(colors.cyan('GRAPHQL - GraphQL Client'))}
|
|
4945
|
+
|
|
4946
|
+
${colors.bold('Usage:')}
|
|
4947
|
+
${colors.green('graphql <url> <query>')} Inline query
|
|
4948
|
+
${colors.green('graphql <url> @file.graphql')} Query from file
|
|
4949
|
+
${colors.green('graphql <url> <query> var=value...')} With variables
|
|
4950
|
+
|
|
4951
|
+
${colors.bold('Examples:')}
|
|
4952
|
+
${colors.gray('# Simple query')}
|
|
4953
|
+
› graphql https://api.example.com/graphql "{ users { id name } }"
|
|
4954
|
+
|
|
4955
|
+
${colors.gray('# With variables')}
|
|
4956
|
+
› graphql https://api.example.com/graphql "query($id: ID!) { user(id: $id) { name } }" id=123
|
|
4957
|
+
|
|
4958
|
+
${colors.gray('# From file')}
|
|
4959
|
+
› graphql https://api.example.com/graphql @queries/getUser.graphql id=123
|
|
4960
|
+
|
|
4961
|
+
${colors.bold('Tips:')}
|
|
4962
|
+
• Use ${colors.white('@file.graphql')} for complex queries
|
|
4963
|
+
• Variables are passed as ${colors.white('key=value')} pairs
|
|
4964
|
+
• Response stored in ${colors.white('lastResponse')}
|
|
4965
|
+
`,
|
|
4966
|
+
'ai': `
|
|
4967
|
+
${colors.bold(colors.cyan('AI - AI Chat Interface'))}
|
|
4968
|
+
|
|
4969
|
+
${colors.bold('Usage:')}
|
|
4970
|
+
${colors.green('ai [provider]')} Enter interactive AI mode
|
|
4971
|
+
${colors.green('@<provider> <message>')} Quick one-shot message
|
|
4972
|
+
|
|
4973
|
+
${colors.bold('Providers:')}
|
|
4974
|
+
${colors.cyan('openai')} GPT-4/GPT-3.5 (default)
|
|
4975
|
+
${colors.cyan('anthropic')} Claude
|
|
4976
|
+
${colors.cyan('groq')} Fast inference
|
|
4977
|
+
${colors.cyan('google')} Gemini
|
|
4978
|
+
${colors.cyan('xai')} Grok
|
|
4979
|
+
${colors.cyan('mistral')} Mistral AI
|
|
4980
|
+
${colors.cyan('cohere')} Command
|
|
4981
|
+
${colors.cyan('deepseek')} DeepSeek
|
|
4982
|
+
${colors.cyan('fireworks')} Fireworks AI
|
|
4983
|
+
${colors.cyan('together')} Together AI
|
|
4984
|
+
${colors.cyan('perplexity')} Perplexity
|
|
4985
|
+
|
|
4986
|
+
${colors.bold('Examples:')}
|
|
4987
|
+
${colors.gray('# Enter interactive mode with OpenAI')}
|
|
4988
|
+
› ai
|
|
4989
|
+
› ai openai
|
|
4990
|
+
|
|
4991
|
+
${colors.gray('# Quick message (no mode switch)')}
|
|
4992
|
+
› @openai What is the capital of France?
|
|
4993
|
+
› @anthropic Explain quantum computing
|
|
4994
|
+
|
|
4995
|
+
${colors.gray('# Different providers')}
|
|
4996
|
+
› @groq Summarize this text...
|
|
4997
|
+
› @google Translate to Spanish: Hello
|
|
4998
|
+
|
|
4999
|
+
${colors.bold('Environment variables:')}
|
|
5000
|
+
${colors.white('OPENAI_API_KEY')} OpenAI
|
|
5001
|
+
${colors.white('ANTHROPIC_API_KEY')} Anthropic
|
|
5002
|
+
${colors.white('GROQ_API_KEY')} Groq
|
|
5003
|
+
${colors.white('GOOGLE_API_KEY')} Google
|
|
5004
|
+
${colors.white('XAI_API_KEY')} xAI
|
|
5005
|
+
... (${colors.white('<PROVIDER>_API_KEY')})
|
|
5006
|
+
|
|
5007
|
+
${colors.bold('Memory:')}
|
|
5008
|
+
• Each provider maintains ${colors.white('12 message pairs')} (24 msgs)
|
|
5009
|
+
• Use ${colors.green('ai:clear')} to reset all memories
|
|
5010
|
+
• Use ${colors.green('ai:clear openai')} to reset specific provider
|
|
5011
|
+
`,
|
|
5012
|
+
'ftp': `
|
|
5013
|
+
${colors.bold(colors.cyan('FTP - FTP Client'))}
|
|
5014
|
+
|
|
5015
|
+
${colors.bold('Usage:')}
|
|
5016
|
+
${colors.green('ftp <host> <command> [options]')}
|
|
5017
|
+
|
|
5018
|
+
${colors.bold('Commands:')}
|
|
5019
|
+
${colors.white('ls [path]')} List directory contents
|
|
5020
|
+
${colors.white('get <file>')} Download file
|
|
5021
|
+
${colors.white('put <file>')} Upload file
|
|
5022
|
+
${colors.white('rm <file>')} Delete file
|
|
5023
|
+
${colors.white('mkdir <dir>')} Create directory
|
|
5024
|
+
|
|
5025
|
+
${colors.bold('Options:')}
|
|
5026
|
+
${colors.white('user=username')} FTP username
|
|
5027
|
+
${colors.white('pass=password')} FTP password
|
|
5028
|
+
${colors.white('port=21')} FTP port
|
|
5029
|
+
${colors.white('secure')} Use FTPS (TLS)
|
|
5030
|
+
|
|
5031
|
+
${colors.bold('Examples:')}
|
|
5032
|
+
${colors.gray('# List files')}
|
|
5033
|
+
› ftp ftp.example.com ls /pub
|
|
5034
|
+
|
|
5035
|
+
${colors.gray('# Download with auth')}
|
|
5036
|
+
› ftp ftp.example.com get /file.zip user=admin pass=secret
|
|
5037
|
+
|
|
5038
|
+
${colors.gray('# Upload file')}
|
|
5039
|
+
› ftp ftp.example.com put ./local.txt user=admin pass=secret
|
|
5040
|
+
|
|
5041
|
+
${colors.gray('# Secure FTP')}
|
|
5042
|
+
› ftp ftp.example.com ls secure user=admin pass=secret
|
|
5043
|
+
`,
|
|
5044
|
+
'har': `
|
|
5045
|
+
${colors.bold(colors.cyan('HAR - HTTP Archive Recording/Playback'))}
|
|
5046
|
+
|
|
5047
|
+
${colors.bold('Commands:')}
|
|
5048
|
+
${colors.green('har:record <file>')} Start recording to HAR file
|
|
5049
|
+
${colors.green('har:stop')} Stop recording
|
|
5050
|
+
${colors.green('har:play <file>')} Replay requests from HAR
|
|
5051
|
+
${colors.green('har:info <file>')} Show HAR file information
|
|
5052
|
+
|
|
5053
|
+
${colors.bold('Examples:')}
|
|
5054
|
+
${colors.gray('# Record a session')}
|
|
5055
|
+
› har:record session.har
|
|
5056
|
+
› get /api/users
|
|
5057
|
+
› post /api/users name="Test"
|
|
5058
|
+
› har:stop
|
|
5059
|
+
|
|
5060
|
+
${colors.gray('# Replay the session')}
|
|
5061
|
+
› har:play session.har
|
|
5062
|
+
|
|
5063
|
+
${colors.gray('# Inspect HAR file')}
|
|
5064
|
+
› har:info session.har
|
|
5065
|
+
|
|
5066
|
+
${colors.bold('Use cases:')}
|
|
5067
|
+
• Capture API flows for documentation
|
|
5068
|
+
• Replay for testing/debugging
|
|
5069
|
+
• Share reproducible API interactions
|
|
5070
|
+
• Performance analysis
|
|
5071
|
+
`,
|
|
5072
|
+
'robots': `
|
|
5073
|
+
${colors.bold(colors.cyan('ROBOTS - robots.txt Analysis'))}
|
|
5074
|
+
|
|
5075
|
+
${colors.bold('Usage:')}
|
|
5076
|
+
${colors.green('robots [url]')} Analyze robots.txt (uses base URL if set)
|
|
5077
|
+
|
|
5078
|
+
${colors.bold('What it checks:')}
|
|
5079
|
+
• Syntax validity
|
|
5080
|
+
• User-Agent blocks
|
|
5081
|
+
• Sitemap directives
|
|
5082
|
+
• Crawl-delay settings
|
|
5083
|
+
• AI bot restrictions (GPTBot, ClaudeBot, etc.)
|
|
5084
|
+
|
|
5085
|
+
${colors.bold('Examples:')}
|
|
5086
|
+
› robots example.com
|
|
5087
|
+
› url example.com
|
|
5088
|
+
› robots
|
|
5089
|
+
`,
|
|
5090
|
+
'sitemap': `
|
|
5091
|
+
${colors.bold(colors.cyan('SITEMAP - sitemap.xml Analysis'))}
|
|
5092
|
+
|
|
5093
|
+
${colors.bold('Usage:')}
|
|
5094
|
+
${colors.green('sitemap [url]')} Analyze sitemap.xml (uses base URL if set)
|
|
5095
|
+
|
|
5096
|
+
${colors.bold('What it checks:')}
|
|
5097
|
+
• Valid XML structure
|
|
5098
|
+
• URL count (max 50,000)
|
|
5099
|
+
• File size (max 50MB)
|
|
5100
|
+
• URL validity
|
|
5101
|
+
• lastmod dates
|
|
5102
|
+
• Duplicate detection
|
|
5103
|
+
|
|
5104
|
+
${colors.bold('Examples:')}
|
|
5105
|
+
› sitemap example.com
|
|
5106
|
+
› sitemap example.com/custom-sitemap.xml
|
|
5107
|
+
`,
|
|
5108
|
+
'llms': `
|
|
5109
|
+
${colors.bold(colors.cyan('LLMS - llms.txt Analysis'))}
|
|
5110
|
+
|
|
5111
|
+
${colors.bold('Usage:')}
|
|
5112
|
+
${colors.green('llms [url]')} Analyze llms.txt file
|
|
5113
|
+
|
|
5114
|
+
${colors.bold('About llms.txt:')}
|
|
5115
|
+
A proposed standard for LLM-friendly content.
|
|
5116
|
+
Learn more: https://llmstxt.org
|
|
5117
|
+
|
|
5118
|
+
${colors.bold('What it checks:')}
|
|
5119
|
+
• Valid format
|
|
5120
|
+
• Site name and description
|
|
5121
|
+
• Content sections
|
|
5122
|
+
• Link validity
|
|
5123
|
+
|
|
5124
|
+
${colors.bold('Examples:')}
|
|
5125
|
+
› llms example.com
|
|
5126
|
+
› llms https://example.com/llms.txt
|
|
5127
|
+
`,
|
|
5128
|
+
'url': `
|
|
5129
|
+
${colors.bold(colors.cyan('URL - Set Base URL'))}
|
|
5130
|
+
|
|
5131
|
+
${colors.bold('Usage:')}
|
|
5132
|
+
${colors.green('url <url>')} Set the base URL for subsequent requests
|
|
5133
|
+
|
|
5134
|
+
${colors.bold('Examples:')}
|
|
5135
|
+
${colors.gray('# Set base URL')}
|
|
5136
|
+
› url api.example.com
|
|
5137
|
+
› url https://api.example.com
|
|
5138
|
+
|
|
5139
|
+
${colors.gray('# Then make requests without full URL')}
|
|
5140
|
+
› get /users
|
|
5141
|
+
› post /users name="Test"
|
|
5142
|
+
|
|
5143
|
+
${colors.bold('Benefits:')}
|
|
5144
|
+
• Shorter commands
|
|
5145
|
+
• Enables commands that use domain (whois, dns, tls)
|
|
5146
|
+
• Prompt shows current host
|
|
5147
|
+
`,
|
|
5148
|
+
'set': `
|
|
5149
|
+
${colors.bold(colors.cyan('SET - Session Variables'))}
|
|
5150
|
+
|
|
5151
|
+
${colors.bold('Usage:')}
|
|
5152
|
+
${colors.green('set <key>=<value>')} Set a variable
|
|
5153
|
+
|
|
5154
|
+
${colors.bold('Usage in requests:')}
|
|
5155
|
+
Use ${colors.white('$key')} to reference variable value
|
|
5156
|
+
|
|
5157
|
+
${colors.bold('Examples:')}
|
|
5158
|
+
${colors.gray('# Set variables')}
|
|
5159
|
+
› set token=abc123
|
|
5160
|
+
› set user_id=42
|
|
5161
|
+
|
|
5162
|
+
${colors.gray('# Use in requests')}
|
|
5163
|
+
› get /users/$user_id Authorization:"Bearer $token"
|
|
5164
|
+
|
|
5165
|
+
${colors.bold('Related:')}
|
|
5166
|
+
${colors.green('vars')} List all variables
|
|
5167
|
+
${colors.green('env')} Load from .env file
|
|
5168
|
+
`,
|
|
5169
|
+
'env': `
|
|
5170
|
+
${colors.bold(colors.cyan('ENV - Load Environment Variables'))}
|
|
5171
|
+
|
|
5172
|
+
${colors.bold('Usage:')}
|
|
5173
|
+
${colors.green('env [path]')} Load .env file (default: ./.env)
|
|
5174
|
+
|
|
5175
|
+
${colors.bold('Examples:')}
|
|
5176
|
+
${colors.gray('# Load from current directory')}
|
|
5177
|
+
› env
|
|
5178
|
+
|
|
5179
|
+
${colors.gray('# Load specific file')}
|
|
5180
|
+
› env ./config/.env.local
|
|
5181
|
+
|
|
5182
|
+
${colors.bold('File format:')}
|
|
5183
|
+
${colors.gray('# .env file')}
|
|
5184
|
+
API_KEY=your-key-here
|
|
5185
|
+
BASE_URL=https://api.example.com
|
|
5186
|
+
DEBUG=true
|
|
5187
|
+
|
|
5188
|
+
${colors.bold('Note:')}
|
|
5189
|
+
Variables are available via ${colors.white('$VAR_NAME')} in requests
|
|
5190
|
+
`,
|
|
5191
|
+
'ip': `
|
|
5192
|
+
${colors.bold(colors.cyan('IP - IP Intelligence'))}
|
|
5193
|
+
|
|
5194
|
+
${colors.bold('Usage:')}
|
|
5195
|
+
${colors.green('ip <address>')} Lookup IP information
|
|
5196
|
+
|
|
5197
|
+
${colors.bold('Information provided:')}
|
|
5198
|
+
• Geolocation (city, country)
|
|
5199
|
+
• ASN information
|
|
5200
|
+
• Network details
|
|
5201
|
+
• Hostname (reverse DNS)
|
|
5202
|
+
|
|
5203
|
+
${colors.bold('Examples:')}
|
|
5204
|
+
› ip 8.8.8.8
|
|
5205
|
+
› ip 2001:4860:4860::8888
|
|
5206
|
+
`,
|
|
5207
|
+
'ping': `
|
|
5208
|
+
${colors.bold(colors.cyan('PING - TCP Connectivity Check'))}
|
|
5209
|
+
|
|
5210
|
+
${colors.bold('Usage:')}
|
|
5211
|
+
${colors.green('ping <host>')} Quick TCP ping to host
|
|
5212
|
+
|
|
5213
|
+
${colors.bold('Note:')}
|
|
5214
|
+
This is a TCP connection test, not ICMP ping.
|
|
5215
|
+
It verifies the host is reachable on port 80/443.
|
|
5216
|
+
|
|
5217
|
+
${colors.bold('Examples:')}
|
|
5218
|
+
› ping example.com
|
|
5219
|
+
› ping 192.168.1.1
|
|
5220
|
+
`,
|
|
5221
|
+
'default': `
|
|
5222
|
+
${colors.bold(colors.yellow('Unknown command'))}
|
|
5223
|
+
|
|
5224
|
+
Try one of these:
|
|
5225
|
+
${colors.green('help')} Show all commands
|
|
5226
|
+
${colors.green('help spider')} Spider/crawler help
|
|
5227
|
+
${colors.green('help seo')} SEO analysis help
|
|
5228
|
+
${colors.green('help dns')} DNS lookup help
|
|
5229
|
+
${colors.green('help ai')} AI chat help
|
|
5230
|
+
${colors.green('help load')} Load testing help
|
|
5231
|
+
`,
|
|
5232
|
+
};
|
|
5233
|
+
const aliases = {
|
|
5234
|
+
'ssl': 'tls',
|
|
5235
|
+
'chat': 'ai',
|
|
5236
|
+
'@openai': 'ai',
|
|
5237
|
+
'@anthropic': 'ai',
|
|
5238
|
+
'crawl': 'spider',
|
|
5239
|
+
'crawler': 'spider',
|
|
5240
|
+
'scrape': 'scrap',
|
|
5241
|
+
'websocket': 'ws',
|
|
5242
|
+
'vars': 'set',
|
|
5243
|
+
'dns:propagate': 'dns',
|
|
5244
|
+
'dns:email': 'dns',
|
|
5245
|
+
'dns:health': 'dns',
|
|
5246
|
+
'har:record': 'har',
|
|
5247
|
+
'har:play': 'har',
|
|
5248
|
+
'har:stop': 'har',
|
|
5249
|
+
'har:info': 'har',
|
|
5250
|
+
};
|
|
5251
|
+
const normalizedCmd = aliases[cmd] || cmd;
|
|
5252
|
+
const content = helpContent[normalizedCmd] || helpContent['default'];
|
|
5253
|
+
console.log(content);
|
|
5254
|
+
}
|
|
4586
5255
|
}
|