-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
docs(cli): update latest cli documentation #4856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(cli): update latest cli documentation #4856
Conversation
✅ Deploy Preview for asyncapi-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughThis PR updates AsyncAPI CLI documentation across multiple files. It restructures the architecture documentation to reflect a service-oriented design, adds new contribution guidelines and comprehensive debugging/testing guides, and updates usage documentation to reflect CLI version 5.0.1 with new commands and flags. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4856 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 798 798
Branches 146 146
=========================================
Hits 798 798 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-4856--asyncapi-website.netlify.app/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
markdown/docs/tools/cli/usage.md (1)
842-894: Add language identifiers to code blocks instart previewandstart studiosections.Lines 846 and 876: Fenced code blocks should specify a language identifier (e.g.,
sh-session, consistent with other command blocks in this file).🔎 Proposed fixes
starts a new local instance of Studio in minimal state bundling all the refs of the schema file and with no editing allowed. -``` +```sh-session USAGE $ asyncapi start preview SPEC-FILE [-h] [-p <value>] [-b <value>] [-d <value>] [-x] [-l] [-B]and
starts a new local instance of Studio -``` +```sh-session USAGE $ asyncapi start studio [SPEC-FILE] [-h] [-f <value>] [-p <value>] [--no-interactive] [-B]
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
markdown/docs/tools/cli/architecture.mdmarkdown/docs/tools/cli/contributing-prs.mdmarkdown/docs/tools/cli/debugging-testing.mdmarkdown/docs/tools/cli/usage.md
🧰 Additional context used
🧠 Learnings (7)
📚 Learning: 2025-01-19T04:51:41.255Z
Learnt from: anshgoyalevil
Repo: asyncapi/website PR: 3557
File: tests/fixtures/markdown/check-edit-links-data.js:3-11
Timestamp: 2025-01-19T04:51:41.255Z
Learning: In the AsyncAPI website repository, the test data in `tests/fixtures/markdown/check-edit-links-data.js` intentionally includes inconsistent paths (with and without 'docs' prefix) to verify the script's ability to normalize and handle ambiguous path structures.
Applied to files:
markdown/docs/tools/cli/debugging-testing.md
📚 Learning: 2025-06-19T13:51:27.459Z
Learnt from: sagarkori143
Repo: asyncapi/website PR: 4192
File: npm/runners/build-pages-runner.ts:7-14
Timestamp: 2025-06-19T13:51:27.459Z
Learning: In the AsyncAPI website build system, individual runner functions use try-catch blocks that rethrow errors to maintain consistent error boundaries, while the top-level orchestrator in npm/index.ts provides meaningful error logging with task-specific context using logger.error(`Error building ${taskName}:`, error). This separation of concerns allows for clean error handling at different architectural layers.
Applied to files:
markdown/docs/tools/cli/debugging-testing.md
📚 Learning: 2025-01-18T08:44:43.614Z
Learnt from: akshatnema
Repo: asyncapi/website PR: 3423
File: tests/index.test.js:2-7
Timestamp: 2025-01-18T08:44:43.614Z
Learning: In the AsyncAPI website project, JavaScript test files must include the .ts extension when importing TypeScript files (e.g., `require('../scripts/build-rss.ts')`). This is a project-specific requirement enforced by the linting rules and build setup, even though it differs from typical Node.js behavior.
Applied to files:
markdown/docs/tools/cli/debugging-testing.mdmarkdown/docs/tools/cli/usage.md
📚 Learning: 2024-11-25T18:34:51.303Z
Learnt from: akshatnema
Repo: asyncapi/website PR: 3378
File: scripts/markdown/check-markdown.js:1-1
Timestamp: 2024-11-25T18:34:51.303Z
Learning: When reviewing `scripts/markdown/check-markdown.js`, optimizations should be addressed in separate issues and not included in the current pull request.
Applied to files:
markdown/docs/tools/cli/contributing-prs.md
📚 Learning: 2025-02-18T12:07:42.211Z
Learnt from: asyncapi-bot
Repo: asyncapi/website PR: 0
File: :0-0
Timestamp: 2025-02-18T12:07:42.211Z
Learning: The following PR commands are supported in the asyncapi/website repository:
- `/please-take-a-look` or `/ptal`: Requests attention from reviewers who haven't reviewed the PR
- `/ready-to-merge` or `/rtm`: Triggers automerge when all conditions are met
- `/do-not-merge` or `/dnm`: Blocks automerge even if all conditions are met
- `/autoupdate` or `/au`: Adds autoupdate label to keep PR in sync with target branch
- `/update` or `/u`: One-time update of PR with latest changes from target branch
Applied to files:
markdown/docs/tools/cli/contributing-prs.md
📚 Learning: 2025-06-19T13:49:29.796Z
Learnt from: sagarkori143
Repo: asyncapi/website PR: 4192
File: npm/runners/build-newsroom-videos-runner.ts:8-15
Timestamp: 2025-06-19T13:49:29.796Z
Learning: In the AsyncAPI website modularization project, error handling is centralized in the top-level orchestrator function (npm/index.ts) with comprehensive logging and context. Individual runner functions in npm/runners/ are kept simple and let errors propagate naturally to the centralized handler, avoiding redundant try-catch blocks that only rethrow errors.
Applied to files:
markdown/docs/tools/cli/architecture.md
📚 Learning: 2025-05-09T17:35:57.171Z
Learnt from: TRohit20
Repo: asyncapi/website PR: 4107
File: markdown/docs/tools/studio/architecture.md:23-23
Timestamp: 2025-05-09T17:35:57.171Z
Learning: In the AsyncAPI Studio architecture documentation, "Layer Breakdown" is intentionally structured as an H3 heading (subsection) because it provides additional detail about the layered architecture pattern introduced earlier, rather than being a standalone main section.
Applied to files:
markdown/docs/tools/cli/architecture.md
🪛 markdownlint-cli2 (0.18.1)
markdown/docs/tools/cli/usage.md
478-478: Bare URL used
(MD034, no-bare-urls)
480-480: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
826-826: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
846-846: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
876-876: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: Automerge PR autoapproved by a bot
- GitHub Check: Redirect rules - asyncapi-website
- GitHub Check: Header rules - asyncapi-website
- GitHub Check: Pages changed - asyncapi-website
- GitHub Check: Test NodeJS PR - windows-latest
- GitHub Check: Lighthouse CI
- GitHub Check: cypress-run
🔇 Additional comments (12)
markdown/docs/tools/cli/debugging-testing.md (6)
237-253: This is a documentation example without corresponding implementation in this repository.The code at lines 237-253 illustrates hypothetical usage of a
ConversionServicethat does not exist in the asyncapi/website codebase. Since this is documentation showing example patterns rather than actual implementation, the imports (@services/convert.service,@models/SpecificationFile) and method signatures cannot be verified against real code in this repository.If this example is meant to document an external package or service, clarify the source. If it's meant to be a real example, provide the actual implementation reference or remove fictional imports.
Likely an incorrect or invalid review comment.
362-393: Remove or replace API controller test example - it does not match this repository's structure.The example code at lines 362-393 shows Express.js API controller testing with supertest, but the asyncapi/website repository has no API backend structure, controllers, or supertest dependency. The actual test suite contains build utilities (build-docs, build-meetings, build-pages, etc.) for website content, not API endpoint tests. Either replace this example with website-relevant testing patterns (Jest for Next.js components/utilities) or clarify if this documentation is intended for a different project (AsyncAPI CLI).
Likely an incorrect or invalid review comment.
318-356: Clarify that the documented @oclif/test example does not match the project's actual testing setup.The code example at lines 318-356 uses the
@oclif/testAPI andtest/integration/file structure, but the project actually uses Jest for testing and organizes tests in thetests/directory. The@oclif/testpackage is not in project dependencies.This example appears to be generic CLI testing guidance rather than code specific to the AsyncAPI website project. Either update the example to match the project's actual Jest setup, clarify it as a generic external reference, or indicate this is for a different context (e.g., testing external oclif-based CLI tools).
114-152: This is documentation for the AsyncAPI CLI repository, not the website repository.The VS Code launch.json configuration shown (with paths like
${workspaceFolder}/bin/run,${workspaceFolder}/lib/**/*.js, andts-node/register) is correct for developers working with the asyncapi/cli repository. The documentation in this file correctly describes how to debug the CLI application and uses paths appropriate to that project's structure.These paths cannot be verified in the asyncapi/website repository because this file serves as documentation guidance for CLI developers working in a different repository.
75-85: Verify that TEST, CUSTOM_CONTEXT_FILENAME, and CUSTOM_CONTEXT_FILE_LOCATION are actual CLI environment variables.Of the four variables shown (lines 75-85), only NODE_ENV is documented in architecture.md as a standard CLI environment variable (
development|production|test). The other three—TEST, CUSTOM_CONTEXT_FILENAME, and CUSTOM_CONTEXT_FILE_LOCATION—appear only in this debugging guide and are not documented in the CLI's official environment variables list. Additionally, CUSTOM_CONTEXT_FILE_LOCATION is set to an empty string, which requires clarification on whether this is the correct default or if a value should be specified.
1-152: Verification of npm scripts, test frameworks, and implementation details requires access to the asyncapi/cli repository.The npm scripts (api:dev, cli:test, unit:test, test:one), test frameworks (mocha, chai, @oclif/test, supertest), and service implementations documented cannot be verified from the website repository context alone, as this is documentation for the external AsyncAPI CLI project. To confirm the guide's accuracy, verify the referenced items against the actual CLI repository at https://github.com/asyncapi/cli.
markdown/docs/tools/cli/contributing-prs.md (2)
42-52: Fix broken npm script references in the checklist.The checklist references
cli:testandunit:testwhich do not exist in package.json. Available test scripts aretest(jest),test:e2e(cypress),test:md, andtest:netlify. Update the checklist to use the correct script names for the project.⛔ Skipped due to learnings
Learnt from: anshgoyalevil Repo: asyncapi/website PR: 3557 File: tests/fixtures/markdown/check-edit-links-data.js:3-11 Timestamp: 2025-01-19T04:51:41.255Z Learning: In the AsyncAPI website repository, the test data in `tests/fixtures/markdown/check-edit-links-data.js` intentionally includes inconsistent paths (with and without 'docs' prefix) to verify the script's ability to normalize and handle ambiguous path structures.Learnt from: anshgoyalevil Repo: asyncapi/website PR: 3301 File: scripts/markdown/check-markdown.js:0-0 Timestamp: 2024-10-18T17:24:45.053Z Learning: In `scripts/markdown/check-markdown.js`, the script is not run in an asynchronous environment, so refactoring it to use `async/await` is unnecessary.Learnt from: akshatnema Repo: asyncapi/website PR: 3378 File: scripts/markdown/check-markdown.js:1-1 Timestamp: 2024-11-25T18:34:51.303Z Learning: When reviewing `scripts/markdown/check-markdown.js`, optimizations should be addressed in separate issues and not included in the current pull request.
11-11: Fix broken link to non-existent DEVELOPMENT.md file.Line 11 references
../DEVELOPMENT.md, but this file does not exist in the repository. Replace the link withdebugging-testing.md(in the same directory) or update the guidance to point to the actual setup documentation atmarkdown/docs/community/010-contribution-guidelines/tools-and-setup.md. Either way, ensure new contributors have a valid, accessible reference for setting up the development environment.⛔ Skipped due to learnings
Learnt from: anshgoyalevil Repo: asyncapi/website PR: 3557 File: tests/fixtures/markdown/check-edit-links-data.js:3-11 Timestamp: 2025-01-19T04:51:41.255Z Learning: In the AsyncAPI website repository, the test data in `tests/fixtures/markdown/check-edit-links-data.js` intentionally includes inconsistent paths (with and without 'docs' prefix) to verify the script's ability to normalize and handle ambiguous path structures.Learnt from: akshatnema Repo: asyncapi/website PR: 3378 File: scripts/markdown/check-markdown.js:1-1 Timestamp: 2024-11-25T18:34:51.303Z Learning: When reviewing `scripts/markdown/check-markdown.js`, optimizations should be addressed in separate issues and not included in the current pull request.markdown/docs/tools/cli/architecture.md (1)
1-152: Rewrite this document to reflect the actual asyncapi/cli repository structure.The documented architecture contains significant inaccuracies that do not align with the actual AsyncAPI CLI repository:
- Directory structure mismatch: The document describes
src/apps/,src/domains/,src/errors/,src/interfaces/organization. The actual repository uses a simpler structure withsrc/commands/for oclif commands and supporting utilities.- Express API server: The document extensively describes REST endpoints (
/v1/validate,/v1/parse,/v1/generate, etc.) with Express, Helmet, and CORS. The asyncapi/cli repository does not include a built-in Express API server—it is primarily a command-line tool.- Domain services architecture: The document describes
ValidationService,GeneratorService,ConvertService,ConfigService, andArchiverServiceextendingBaseServicewithServiceResult<T>returns. This layered architecture is not present in the actual CLI codebase.Accurate elements:
- Commands listed (validate, convert, format, optimize, bundle, generate, etc.) do exist in the CLI.
- The technology stack (oclif, TypeScript, @asyncapi/parser, generator, converter, bundler) is correct.
- The general purpose and entry points (bin/run) are accurate.
Update the document to describe the actual repository structure, remove references to the non-existent API server and domain service layers, and focus on the real command-based architecture of the CLI.
markdown/docs/tools/cli/usage.md (3)
30-30: ✓ Version and command list updates look good.Version correctly bumped to 5.0.1 and new commands properly added to the command index with consistent formatting.
Also applies to: 59-59, 68-68
102-102: ✓ GitHub source links consistently updated to v5.0.1.All "See code" references now properly point to v5.0.1 branches, maintaining consistency with the documented CLI version.
Also applies to: 139-139, 153-153, 173-173, 210-210, 231-231, 248-248, 269-269, 292-292, 309-309, 329-329, 349-349, 366-366, 396-396, 437-437, 460-460, 474-474, 520-520, 566-566, 643-643, 657-657, 715-715, 737-737, 781-781, 806-806, 820-820, 840-840, 870-870, 894-894, 930-930
417-417: ✓ Flag naming convention changes are semantically clear.The distinction between
-o/--output(directory) and-s/--save-output(file name) is now consistently applied and well-documented across affected commands (diff,generate models,validate). This improves CLI clarity.Also applies to: 590-592, 911-911
| | Area | Guideline | | ||
| |------|-----------| | ||
| | **TypeScript** | Explicit types, interfaces for objects, prefer `const` | | ||
| | **Organization** | Follow existing structure, use path aliases (`@/`, `@cli/`, `@domains/`) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify TypeScript path alias configuration and actual directory structure
echo "=== Checking for tsconfig.json ==="
if [ -f "tsconfig.json" ]; then
echo "Found tsconfig.json"
echo ""
echo "=== TypeScript paths configuration ==="
jq '.compilerOptions.paths' tsconfig.json 2>/dev/null || cat tsconfig.json | grep -A 50 '"paths"'
else
echo "tsconfig.json not found in root"
# Search for tsconfig files in the repository
find . -name "tsconfig*.json" -type f | head -20
fi
echo ""
echo "=== Checking directory structure for potential path mappings ==="
if [ -d "src" ]; then
echo "Found src directory:"
ls -la src/ | head -20
fi
if [ -d "src/apps/cli" ]; then
echo "Found src/apps/cli directory"
fiRepository: asyncapi/website
Length of output: 249
🏁 Script executed:
#!/bin/bash
# Check the actual documented content and search for alias usage
echo "=== Checking line 62 of contributing-prs.md ==="
if [ -f "markdown/docs/tools/cli/contributing-prs.md" ]; then
sed -n '60,65p' markdown/docs/tools/cli/contributing-prs.md
else
echo "File not found, searching for it..."
find . -name "contributing-prs.md" -type f
fi
echo ""
echo "=== Searching for @cli/ usage in codebase ==="
rg "@cli/" --type-list 2>/dev/null | head -5 || rg "@cli/" | head -20
echo ""
echo "=== Searching for @domains/ usage in codebase ==="
rg "@domains/" | head -20
echo ""
echo "=== Checking for additional tsconfig files ==="
find . -name "tsconfig*.json" -type f
echo ""
echo "=== Full tsconfig.json content ==="
cat tsconfig.jsonRepository: asyncapi/website
Length of output: 1423
Remove or configure the documented path aliases (@cli/, @domains/).
The tsconfig.json only defines a single path alias: @/* -> ./*. The documentation on line 62 lists @/, @cli/, and @domains/, but @cli/ and @domains/ do not exist in the TypeScript configuration and have no usage in the codebase. Either remove the non-existent aliases from the documentation or add them to tsconfig.json if they're intended for future use.
🤖 Prompt for AI Agents
In markdown/docs/tools/cli/contributing-prs.md around line 62, the docs list
path aliases @/, @cli/, and @domains/ but tsconfig.json only defines @/* -> ./*;
remove the non-existent @cli/ and @domains/ entries from the documentation OR
add corresponding path mappings to tsconfig.json (e.g., map @cli/* and
@domains/* to the actual source folders) and ensure the mapped folders exist and
are used; update either the docs or tsconfig so they stay consistent.
| ```typescript | ||
| // Test the service directly | ||
| import { ValidationService } from '@services/validation.service'; | ||
| import { load } from '@models/SpecificationFile'; | ||
|
|
||
| async function debugValidation() { | ||
| const service = new ValidationService(); | ||
| const specFile = await load('./path/to/spec.yml'); | ||
|
|
||
| const result = await service.validateDocument(specFile, { | ||
| 'fail-severity': 'error', | ||
| 'log-diagnostics': true, | ||
| }); | ||
|
|
||
| console.log('Validation Result:', JSON.stringify(result, null, 2)); | ||
| } | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Verify ValidationService implementation
echo "=== Searching for ValidationService ==="
find src -name "*validation*service*" -type f 2>/dev/null
echo ""
echo "=== Checking ValidationService class definition ==="
rg -A 15 "class ValidationService" src/ 2>/dev/null | head -50
echo ""
echo "=== Searching for validateDocument method ==="
rg -B 2 -A 8 "validateDocument" src/ 2>/dev/null | head -50
echo ""
echo "=== Checking @services/validation.service import path ==="
find src -path "*/services/*" -name "*validation*" 2>/dev/nullRepository: asyncapi/website
Length of output: 258
🏁 Script executed:
#!/bin/bash
# Explore actual services structure
echo "=== Directory structure of src/ ==="
ls -la src/ 2>/dev/null | head -20
echo ""
echo "=== Looking for services directory ==="
find . -type d -name "services" 2>/dev/null | head -10
echo ""
echo "=== Contents of services directory (if exists) ==="
find . -path "*/services/*" -type f 2>/dev/null | head -20
echo ""
echo "=== Searching for any validation-related files ==="
find . -name "*validation*" -type f 2>/dev/null | grep -v node_modules | head -20
echo ""
echo "=== Checking for models/SpecificationFile ==="
find . -name "*SpecificationFile*" -type f 2>/dev/null | head -10Repository: asyncapi/website
Length of output: 484
🏁 Script executed:
#!/bin/bash
echo "=== Repository root files ==="
ls -la | head -20
echo ""
echo "=== Repository type check ==="
cat package.json 2>/dev/null | head -30
echo ""
echo "=== File structure overview ==="
git ls-files | head -30Repository: asyncapi/website
Length of output: 3908
Remove or replace the invalid code example with actual working code.
The code example at lines 219-232 references ValidationService from @services/validation.service and load from @models/SpecificationFile. These imports and classes do not exist in the codebase. This is a documentation website repository (Next.js/markdown-based), not a services codebase. The example code cannot work as written and should be replaced with an actual functional example or removed entirely if it does not correspond to real AsyncAPI tooling APIs.
🤖 Prompt for AI Agents
In markdown/docs/tools/cli/debugging-testing.md around lines 217 to 233, the
TypeScript snippet references non-existent internal services and must be removed
or replaced; replace the broken code block with a real, working CLI example (not
project-internal imports) such as a shell invocation that uses the official
AsyncAPI CLI (e.g., npx @asyncapi/cli validate ./path/to/spec.yml with
appropriate flags for severity/diagnostics) or simply delete the snippet and add
a short paragraph explaining how to run the official validator/CLI and where to
find its options in upstream docs.
| ## Quick Reference | ||
|
|
||
| | Task | Command | | ||
| |------|---------| | ||
| | Build project | `npm run build` | | ||
| | Run all tests | `npm test` | | ||
| | Run CLI tests | `npm run cli:test` | | ||
| | Run unit tests | `npm run unit:test` | | ||
| | Run single test | `npm run test:one -- <path>` | | ||
| | Lint code | `npm run lint` | | ||
| | Fix lint issues | `npm run lint:fix` | | ||
| | Start API dev server | `npm run api:dev` | | ||
| | Debug CLI command | `./bin/run <command> <args>` | | ||
| | Debug with inspector | `node --inspect-brk ./bin/run <command>` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# First, let's find and read the package.json file
echo "=== Locating package.json ==="
if [ -f "package.json" ]; then
echo "Found package.json at root"
echo ""
echo "=== Checking npm scripts ==="
jq '.scripts' package.json 2>/dev/null || cat package.json | head -100
fiRepository: asyncapi/website
Length of output: 1302
The Quick Reference table lists npm scripts that do not exist in package.json and will fail if executed.
The table includes npm run cli:test, npm run unit:test, npm run test:one, and npm run api:dev, but none of these scripts are defined in package.json. Only these scripts exist: build, test, lint, lint:fix, dev, and others like test:e2e, test:netlify, test:md, etc.
Either remove the non-existent scripts from the table or add them to package.json if they are intended to be available.
🤖 Prompt for AI Agents
In markdown/docs/tools/cli/debugging-testing.md around lines 610 to 623, the
Quick Reference table lists npm scripts that don't exist in package.json
(cli:test, unit:test, test:one, api:dev); either remove those rows from the
table or add matching script entries to package.json. If you choose to remove,
update the table to only include existing scripts (build, test, lint, lint:fix,
dev, test:e2e, test:netlify, test:md, etc.). If you choose to add, add the
corresponding npm scripts to package.json with the correct commands and run npm
run to verify they execute as documented. Ensure the table and package.json
remain consistent.
| ## `asyncapi generate client LANGUAGE [ASYNCAPI]` | ||
|
|
||
| Generates clients baked-in AsyncAPI Generator. Available for: dart, java, javascript, python. If some language is not supported or you want to improve existing client, join us at https://github.com/asyncapi/generator | ||
|
|
||
| ``` | ||
| USAGE | ||
| $ asyncapi generate client LANGUAGE [ASYNCAPI] [-h] [-d <value>...] [--no-interactive] [-i] [--debug] [-n | ||
| <value>...] [-o <value>] [--force-write] [-w] [-p <value>...] [--map-base-url <value>] [--registry-url <value>] | ||
| [--registry-auth <value>] [--registry-token <value>] [--proxyHost <value>] [--proxyPort <value>] | ||
|
|
||
| ARGUMENTS | ||
| LANGUAGE The language you want the client generated for. Available target languages: dart, java, javascript, python | ||
| [ASYNCAPI] - Local path, url or context-name pointing to AsyncAPI file | ||
|
|
||
| FLAGS | ||
| -d, --disable-hook=<value>... Disable a specific hook type or hooks from a given hook type | ||
| -h, --help Show CLI help. | ||
| -i, --install Installs the template and its dependencies (defaults to false) | ||
| -n, --no-overwrite=<value>... Glob or path of the file(s) to skip when regenerating | ||
| -o, --output=<value> Directory where to put the generated files (defaults to current directory) | ||
| -p, --param=<value>... Additional param to pass to templates | ||
| -w, --watch Watches the template directory and the AsyncAPI document, and re-generate the files | ||
| when changes occur. Ignores the output directory. | ||
| --debug Enable more specific errors in the console | ||
| --force-write Force writing of the generated files to given directory even if it is a git repo with | ||
| unstaged files or not empty dir (defaults to false) | ||
| --map-base-url=<value> Maps all schema references from base url to local folder | ||
| --no-interactive Disable interactive mode and run with the provided flags. | ||
| --proxyHost=<value> Name of the ProxyHost | ||
| --proxyPort=<value> Port number number for the proxyHost. | ||
| --registry-auth=<value> The registry username and password encoded with base64, formatted as username:password | ||
| --registry-token=<value> The npm registry authentication token, that can be passed instead of base64 encoded | ||
| username and password | ||
| --registry-url=<value> [default: https://registry.npmjs.org] Specifies the URL of the private registry for | ||
| fetching templates and dependencies | ||
|
|
||
| DESCRIPTION | ||
| Generates clients baked-in AsyncAPI Generator. Available for: dart, java, javascript, python. If some language is not | ||
| supported or you want to improve existing client, join us at https://github.com/asyncapi/generator | ||
|
|
||
| EXAMPLES | ||
| $ asyncapi generate client javascript asyncapi.yaml --param version=1.0.0 singleFile=true --output ./docs --force-write | ||
| ``` | ||
|
|
||
| _See code: [src/commands/generate/client.ts](https://github.com/asyncapi/cli/blob/v5.0.1/src/commands/generate/client.ts)_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address markdown linting issues in the new generate client command section.
Two markdown quality concerns:
- Line 478: Bare URL should be wrapped in markdown link syntax or inline code.
- Line 480: Code block should specify a language identifier (e.g.,
sh-session, matching other command blocks in this file).
🔎 Proposed fixes
Generates clients baked-in AsyncAPI Generator. Available for: dart, java, javascript, python. If some language is not
-supported or you want to improve existing client, join us at https://github.com/asyncapi/generator
+supported or you want to improve existing client, join us at [https://github.com/asyncapi/generator](https://github.com/asyncapi/generator)
-```
+```sh-session
USAGE🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
478-478: Bare URL used
(MD034, no-bare-urls)
480-480: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
In markdown/docs/tools/cli/usage.md around lines 476-520, fix two lint issues:
replace the bare URL on line 478 with a proper markdown link or inline code
(e.g., convert "https://github.com/asyncapi/generator" to a markdown link
[https://github.com/asyncapi/generator](https://github.com/asyncapi/generator)
or wrap it in backticks), and update the code fence starting at line 480 to
include the language identifier used elsewhere (change ``` to ```sh-session) so
the command block matches the repository's style.
| ## `asyncapi start api` | ||
|
|
||
| starts the AsyncAPI server API. | ||
|
|
||
| ``` | ||
| USAGE | ||
| $ asyncapi start api [-h] [-m development|production|test] [-p <value>] | ||
|
|
||
| FLAGS | ||
| -h, --help Show CLI help. | ||
| -m, --mode=<option> [default: production] mode in which to start the API | ||
| <options: development|production|test> | ||
| -p, --port=<value> port in which to start the API | ||
|
|
||
| DESCRIPTION | ||
| starts the AsyncAPI server API. | ||
| ``` | ||
|
|
||
| _See code: [src/commands/start/api.ts](https://github.com/asyncapi/cli/blob/v5.0.1/src/commands/start/api.ts)_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add language identifier to code block in start api command section.
Line 826: Fenced code block should specify a language identifier (e.g., sh-session, consistent with other command blocks in this file).
🔎 Proposed fix
starts the AsyncAPI server API.
-```
+```sh-session
USAGE📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ## `asyncapi start api` | |
| starts the AsyncAPI server API. | |
| ``` | |
| USAGE | |
| $ asyncapi start api [-h] [-m development|production|test] [-p <value>] | |
| FLAGS | |
| -h, --help Show CLI help. | |
| -m, --mode=<option> [default: production] mode in which to start the API | |
| <options: development|production|test> | |
| -p, --port=<value> port in which to start the API | |
| DESCRIPTION | |
| starts the AsyncAPI server API. | |
| ``` | |
| _See code: [src/commands/start/api.ts](https://github.com/asyncapi/cli/blob/v5.0.1/src/commands/start/api.ts)_ | |
| ## `asyncapi start api` | |
| starts the AsyncAPI server API. | |
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
826-826: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
In markdown/docs/tools/cli/usage.md around lines 822 to 840, the fenced code
block for the "asyncapi start api" command lacks a language identifier; update
the opening fence to include the same language token used elsewhere (e.g.,
sh-session) so it reads "```sh-session" instead of just "```", ensuring
consistency with other command blocks and proper syntax highlighting.
Updated cli documentation is available and this PR introduces update to cli folder on the website
Summary by CodeRabbit
New Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.