We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
transformCommandToApi
// build.ts export default defineCommand({ meta: { name: 'build', description: 'build command', }, args: { minify: { type: 'boolean', description: 'minify file size', }, mode: { type: 'string', description: 'environment variable' } } })
// api/index.ts import build from './build' import { transformCommandToApi } from 'citty' export const apiBuild = transformCommandToApi(build)
// test.ts import { apiBuild } from './api' apiBuild({ // directly invoke with api minify: true, mode: false })
Because defineCommand already defines all the information related to a command, it is very easy to convert it into a direct call to API.
defineCommand
The text was updated successfully, but these errors were encountered:
This function looks similar to the creadeMain function, but it will be much more convenient to use. If this idea is agreed, I will start a PR. 👀 @pi0
creadeMain
Sorry, something went wrong.
createMain(command)
run
No branches or pull requests
Describe the feature
Reason
Because
defineCommand
already defines all the information related to a command, it is very easy to convert it into a direct call to API.Additional information
The text was updated successfully, but these errors were encountered: