cli_core 0.0.2-dev.1
cli_core: ^0.0.2-dev.1 copied to clipboard
A shared utility package for CLI operations in Flutter Forge packages, providing utilities for CLI commands, Flutter project management, Melos workspace management, and file operations.
CLI Core #
A shared utility package for CLI operations in Flutter Forge packages.
Installation 💻 #
Add this to your package's pubspec.yaml
file:
dependencies:
cli_core: ^0.0.2-dev.1
copied to clipboard
Features ✨ #
- 🚀 Base CLI command infrastructure with progress tracking
- 📱 Flutter project creation and management utilities
- 📦 Melos workspace management utilities
- 🔧 File system utilities for common operations
Usage 📖 #
Command Infrastructure #
import 'package:cli_core/cli_core.dart';
// Using Flutter commands
class MyFlutterCommand extends BaseFlutterCommand {
Future<void> execute(HookContext context) async {
await createFlutterProject(
context: context,
name: 'my_app',
description: 'My Flutter application',
outputPath: 'path/to/output',
);
}
}
copied to clipboard
Melos Commands #
// Using Melos commands
class MyMelosCommand extends BaseMelosCommand {
Future<void> execute(HookContext context) async {
await bootstrap(
context: context,
workspacePath: 'path/to/workspace',
);
}
}
copied to clipboard
File Operations #
// Using file utilities
Future<void> fileOperations() async {
// Create directories
await FileUtils.ensureDirectory('path/to/dir');
// Write YAML files
await FileUtils.writeYamlFile('config.yaml', 'content: value');
// Read YAML files
final content = await FileUtils.readYamlFile('config.yaml');
// Copy files
await FileUtils.copyFile('source.txt', 'dest.txt');
// Check for mono-repo
final isMonoRepo = await FileUtils.isMonoRepo();
}
copied to clipboard
Contributing 🤝 #
We welcome contributions! Here's how you can help:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
License ⚖️ #
This project is licensed under the MIT License - see the LICENSE file for details.
Related Packages 📦 #
- nonstop_cli - CLI tool for Flutter project generation and management
- connectivity_wrapper - A Flutter package for handling connectivity states