Commands¶
Available Commands¶
new¶
Create a new React Native app using the app template.
Arguments:
- app-name: Name of the app to create
Example:
generate¶
Generate components, services, or pages using predefined templates.
Arguments:
- type: Type of item to generate (component, service, page)
- name: Name of the item to generate
Examples:
# Generate a component
ok-cli generate component Button
# Generate a service
ok-cli generate service ApiService
# Generate a page
ok-cli generate page HomePage
Global Options¶
--help¶
Show help information for any command.
--version¶
Show the version of OK CLI.
Exit Codes¶
0: Success1: Error occurred
Error Handling¶
The CLI provides clear error messages for common issues:
- Invalid template type
- Template not found
- File system permissions
- Missing dependencies
Template System¶
OK CLI uses Copier for template processing, which supports:
- Variable substitution (
{{variable}}) - Conditional blocks
- File and directory templating
- Custom hooks and filters