katana_cli library
Command line tool for Masamune/Katana Framework. It initializes the project and initializes the services.
To use, import package:katana_cli/katana_cli.dart.
Classes
- AnalysisOptionsCliCode
- Contents of katana.yaml.
- AndroidNativeEnvironmentSynchronizer
-
Configures Android Gradle to read Katana's native build environment from
Flutter's
DART_DEFINESproject property. - AndroidSigningEnvironment
-
Configures Android Gradle signing to prefer keystore values supplied by
environment variables, falling back to
android/key.properties. - Api
- Provides static methods for making HTTP requests.
- ApiMultipartFile
- A file to be uploaded as part of a ApiMultipartFile.
- AppGradle
-
Class for retrieving and saving files in
android/build.gradle. - AppleFirebaseEnvironmentSynchronizer
-
Configures an Apple Runner target to select Firebase plist by
FLAVOR. - AppLocalizeYamlCliCode
- Contents of localize.app.yaml.
- BootstrapJsCliCode
- Contents of flutter_bootstrap.js.
- BuildCliCode
- Contents of build.yaml.
- BuildGradle
-
Class for retrieving and saving files in
android/build.gradle. - CliAiCode
- Abstract class for defining AI code.
- CliAiCodeCommand
- Abstract class for executing AI code creation.
- CliAiCodeGroup
- Abstract class for creating AI code groups.
- CliCode
- Abstract class for defining base code.
- CliCodeCommand
- Abstract class for creating a code-based command template.
- CliCodeSnippet
- Abstract class for defining code snippets.
- CliCommand
- Abstract class for creating command templates.
- CliCommandGroup
- A template for creating command groups.
- CliMcpCode
- Abstract class for defining MCP code.
- CliMcpCodeCommand
- Abstract class for executing MCP code creation.
- CliTestableCodeCommand
- An abstract class for creating testable code-based command templates.
- Clock
- A class that can be used instead of DateTime.
- CodeBootCliCommand
- Create a base class for the Boot page.
- CodeCacheCliCommand
-
Create a
ScopedQuery. - CodeCliCommand
- Dart/Flutter code generation and editing.
- CodeCollectionApiCliCommand
- Generates code to define an API corresponding to CodeCollectionCliCommand.
- CodeCollectionCliCommand
- Create a base class for the collection model.
- CodeCollectionExtensionCliCommand
- Generates code to define an Extension corresponding to CodeCollectionCliCommand.
- CodeControllerCliCommand
- Create a base class for the controller.
- CodeDartDefinesCliCommand
-
Expand
${NAME}indart_defines/<flavor>.envand write the result tobuild/katana/dart_defines/<flavor>.env. - CodeDebugCliCommand
- Create UI debug images for AI.
- CodeDebuggableCliCommand
- Make a Masamune application debuggable with the AI Debugger.
- CodeDocumentApiCliCommand
- Generates code to define an API corresponding to CodeDocumentCliCommand.
- CodeDocumentCliCommand
- Create a base class for the document model.
- CodeDocumentExtensionCliCommand
- Generates code to define an Extension corresponding to CodeDocumentCliCommand.
- CodeEnumCliCommand
- Create an Enum base.
- CodeExceptionCliCommand
- Create a base class for the exception.
- CodeFormatCliCommand
- Dart file formatting.
- CodeFunctionCliCommand
- Create server code for Functions.
- CodeGenerateCliCommand
- Start Dart's build_runner to automatically generate code.
- CodeLocalizeCliCommand
- Creating base data for translation.
- CodeLogCliCommand
- Create a base class for the exception.
- CodeModalCliCommand
- Create a base class for the modal.
- CodeModelAdapterCliCommand
- Create a base class for ModelAdapter.
- CodePageCliCommand
- Create a base class for the page.
- CodePluginCliCommand
- Create a plugin module.
- CodeQueryCliCommand
-
Create a
ChangeNotifierScopedQuery. - CodeRedirectQueryCliCommand
- Create a base class for RedirectQuery.
- CodeSnippetsCliCommand
- Snippets for VSCode.
- CodeStatefulCliCommand
- Create a base class to create a StatefulWidget.
- CodeStatelessCliCommand
- Create a base class to create a StatelessWidget.
- CodeValueCliCommand
- Create a base class for Immutable values.
- CodeValueExtensionCliCommand
- Generates code to define an Extension corresponding to CodeValueCliCommand.
- CodeWatchCliCommand
- Start Dart's build_runner to monitor the code and automatically generate code in real time.
- CodeWidgetCliCommand
- Create a base class to create a ScopedWidget.
- CodeZipCliCommand
- Output the Dart code in a hardened Zip file.
- ComposeCliCommand
- Create a new Flutter project.
- CounterModelCliCode
- Create a base class for the counter model.
- CreateCliCommand
- Create a new Flutter project.
- DartDefinesCliCode
- Contents of dart_defines/**.env
- DartDefinesEnvPropertiesCliCode
- Contents of android/env.properties
- DartDefinesXcconfigCliCode
- Contents of ios/Flutter/DartDefine.xcconfig
- DateDuration
- A class that represents a date period.
- DateFormat
- DateFormat is for formatting and parsing dates in a locale-sensitive manner.
- ExecContext
- The context in which the command is executed.
- FirebaseFunctionsSecrets
- Registers Functions settings without writing secret values to local files. Only secret names are persisted in the generated v2 global options block.
- FlavorContext
- Resolves environment-aware values in Katana configuration files.
- FlutterTestConfigCliCode
- Contents of flutter_test_config.dart.
- Functions
- Class for specifying Functions of Firebase Functions.
- FunctionsEnv
- Class for specifying environment variables of Firebase Functions.
- GitAttributesCliCode
- Contents of .gitattributes.
- GitCliCommand
- Configure settings related to Git and Github.
- GitCommitCliCommand
- Commit and push to Git.
- GitPullRequestCliCommand
- Create a pull request.
- GitPullRequestCommentCliCommand
- Create a pull request comment.
- GitRemoveCliCommand
- Remove files from Git.
- GitSubmoduleCliCommand
- Recursively clone submodules.
- GitUpdateCliCommand
- The katana.yaml configuration is reflected in the application project, with updates only around the Git.
- GradleAllprojects
-
Data in the
allprojectssection. - GradleAllprojectsConfigurations
- Configuration class for the contents of GradleAllprojectsConfigurations.
- GradleAndroid
-
Data in the
androidsection. - GradleAndroidBuildType
- Configuration class for the contents of GradleAndroidBuildTypes.
- GradleAndroidBuildTypes
- Build type setting.
- GradleAndroidCompileOptions
- Compile Option Setting.
- GradleAndroidDefaultConfig
- Default settings.
- GradleAndroidSigningConfig
- Configuration class for the contents of GradleAndroidSigningConfigs.
- GradleAndroidSigningConfigs
- Signature settings.
- GradleAndroidSourceSet
- Source setting.
- GradleBuildScript
-
Data in the
buildscriptsection. - GradleBuildscriptDependencies
- Configuration class for the contents of GradleBuildscriptDependencies.
- GradleDependencies
-
Data in the
dependenciessection. - GradleImport
-
Data in the
importsection. - GradleLoadProperties
-
Data reading part of
xxx.properties. - GradlePlugin
-
Data in the
apply pluginsection. - HomePageCliCode
- Create a base class for the home page.
- Immutable
- Annotation on an immutable class.
- IOSApiKey
- App Store Connect API key supplied by a file or environment variables.
- IOSCertificateBundle
- A PKCS#12 bundle generated from environment variables.
- IOSSigningEnvironment
-
Provides iOS signing materials from environment variables when the
corresponding files are not placed under
ios/. - KatanaCliCode
- Contents of katana.yaml.
- KatanaSecretsCliCode
- Contents of katana.yaml.
- LaunchCliCode
- Contents of launch.json.
- LicenseCliCode
- Contents of LICENSE.
- LoaderCssCliCode
- Contents of loader.css.
- LocalizeYamlCliCode
- Contents of localize.base.yaml.
- MainAdapterCliCode
- Contents of adapter.dart.
- MainCliCode
- Contents of main.dart.
- MainConfigCliCode
- Contents of config.dart.
- MainLocalizeCliCode
- Contents of main.dart.
- MainModuleCliCode
- Contents of module.dart.
- MainRouterCliCode
- Contents of router.dart.
- MainThemeCliCode
- Contents of theme.dart.
- MelosCliCode
- Contents of melos.yaml.
- ModuleCliCode
-
Contents of lib/
module.dart. - ModuleReadMeCliCode
- Contents of README.md.
- NativeAppTarget
-
Validates and applies opt-in application identities from
app.targets. -
NumRange<
TNum extends num> - A class that represents a range of numbers.
- PackageCliCommand
- Create a new Flutter package.
- PackageMainCliCode
- Contents of the Package's main Dart file.
- PackageReadMeCliCode
- Contents of the Package's README.md file.
- PBXBuildConfiguration
- BuildConfiguration data.
- PBXBuildConfigurationSettings
-
Data from
buildSettingsin PBXBuildConfiguration. - PBXBuildFile
- BuildFile data.
- PBXFileReference
- FileReference data.
- PBXFrameworksBuildPhase
- FrameworksBuildPhase data.
- PBXFrameworksBuildPhaseFiles
-
Class for
filesof PBXFrameworksBuildPhase. - PBXGroup
- PBXGroup data.
- PBXGroupChild
-
Class for
childrenof PBXGroup. - PBXProject
- PBXProject data.
- PBXResourcesBuildPhase
- ResourcesBuildPhase data.
- PBXResourcesBuildPhaseFile
- Class for PBXResourcesBuildPhase files.
- PBXVariantGroup
- VariantGroup data.
- PBXVariantGroupChild
-
Data for
childrenin PBXVariantGroup. - PostAction
- Set the action to be taken after execution.
- PubAddCliCommand
- Add packages.
- PubCliCommand
- Version and deployment management for pub.
- PubGetCliCommand
- Get the packages.
- PubignoreCliCode
- Contents of .pubignore.
- PubPublishCliCommand
- Deploy the Dart package to the pub.
- PubspecOverridesCliCode
- Contents of pubspec_overrides.yaml.
- PubUpgradeCliCommand
- Upgrade the package.
- PubVersionCliCommand
- Upgrade the Dart package.
-
RectRange<
TNum extends num> - A class that represents a range of numbers.
- SettingsCliCode
- Contents of settings.json.
- SettingsGradle
-
Class for retrieving and saving files in
android/settings.gradle. - SettingsGradlePlugins
- Configuration class for the contents of SettingsGradlePlugins.
- StoreYamlCliCode
- Contents of store.yaml
- TasksCliCode
- Contents of tasks.json.
- WidgetTestCliCode
- Contents of widget_test.dart.
- WranglerEnvironmentSynchronizer
- Maintains Katana-managed Wrangler dev/prod environments in JSONC.
- XCode
- Utility to edit XCode's project.pbxproj.
Enums
- ApiMethod
- An HTTP method.
- ApiMultipartFileType
- The type of the multipart file.
- DayOfWeek
- Day of the week.
- KatanaFlavor
- Supported Katana deployment environments.
- PodfilePermissionType
- Permission type for Podfile.
- XCodePermissionType
- Permission message type for XCode.
- XCodePrivacyManifests
- Privacy Manifest for XCode.
Mixins
- CliActionMixin
-
Mixin for setting up internal actions to be executed by the
applycommand.
Extensions
- BooleanExtensions on bool
- Provides extended methods for bool.
- CliDirectoryExtensions on Directory
- Extended methods to make Directory easier to use.
- ClockExtensions on Clock
- Provides extended methods for Clock.
-
ClockIterableExtensions
on Iterable<
Clock> - Provides extended methods for Clock arrays.
- DateTimeExtensions on DateTime
- Provides extended methods for DateTime.
-
DateTimeIterableExtensions
on Iterable<
DateTime> - Provides extended methods for DateTime arrays.
- DoubleExtensions on double
- Provides extended methods for double.
-
DoubleIterableExtensions
on Iterable<
double> - Provides extended methods for double arrays.
- DurationExtensions on Duration
- Provides extended methods for Duration.
-
DynamicMapExtensions
on Map<
String, dynamic> - Provides extended methods for DynamicMap.
-
InterableOfIterableExtensions
on Iterable<
Iterable< T> > - Provides extended methods for Iterable arrays.
- IntExtensions on int
- Provides extended methods for int.
-
IntIterableExtensions
on Iterable<
int> - Provides extended methods for int arrays.
-
IterableExtensions
on Iterable<
T> -
Provides extended methods for
Tarrays. - JsonDynamicListExtensions on DynamicList
- Provides Json extension methods for DynamicList.
- JsonDynamicMapExtensions on DynamicMap
- Provides Json extension methods for DynamicMap.
-
ListExtensions
on List<
T> -
Provides extended methods for List in
T. -
MapExtensions
on Map<
K, V> - Provides extended methods for Map.
- NullableDoubleExtensions on double?
- Provides an extension method for double that is nullable.
- NullableIntExtensions on int?
- Provides an extension method for int that is nullable.
-
NullableIterableExtensions
on Iterable<
T> ? - Provides an extension method for Iterable that is nullable.
-
NullableListExtensions
on List<
T> ? - Provides an extension method for List that is nullable.
-
NullableMapExtensions
on Map<
K, V> ? - Provides an extension method for Map that is nullable.
- NullableNumExtensions on num?
- Provides an extension method for num that is nullable.
- NullableObjectExtensions on Object?
- Provides an extension method for List that is nullable.
-
NullableSetExtensions
on Set<
T> ? - Provides an extension method for Set that is nullable.
- NullableStringExtensions on String?
- Provides an extension method for String that is nullable.
- NullableTExtensions on T?
-
Provides an extension method for
T?that is nullable. - NullableUriExtensions on Uri?
- Provides an extension method for Uri that is nullable.
-
NullableValueIterableExtensions
on Iterable<
T?> - Provides an extension method for Iterable whose value is nullable.
-
ProcessExtensions
on Future<
Process> - Extended methods to make Process easier to use.
- RandomExtensions on Random
- Provides extended methods for Random.
-
SetExtensions
on Set<
T> - Provides extended methods for Set.
- StringExtensions on String
- Provides extended methods for String.
- UriExtensions on Uri
- Provides extended methods for Uri.
Constants
- kResolvedDartDefinesDirectory → const String
- Directory where expanded dart-define files are written.
- nullOfBool → const bool?
-
A
nullobject with a defined type of bool? - nullOfDouble → const double?
-
A
nullobject with a defined type of double? - nullOfDynamicList → const DynamicList?
-
A
nullobject with a defined type of DynamicList? - nullOfDynamicMap → const DynamicMap?
-
A
nullobject with a defined type of DynamicMap? - nullOfInt → const int?
-
A
nullobject with a defined type of int? - nullOfNum → const num?
-
A
nullobject with a defined type of num? - nullOfString → const String?
-
A
nullobject with a defined type of String? -
otherFiles
→ const Map<
String, CliCode> - Other generated files.
- zeroOfNum → const num
-
A
0object with a defined type of num?
Properties
-
allOptionsImportPackage
→ List<
String> -
Additional import packages if the "-a" option is used.
final
-
flavors
→ List<
String> -
Flavors.
final
-
importDevPackages
→ List<
String> -
Package for dev to import.
final
-
importPackages
→ List<
String> -
Package to import.
final
- isError → bool
-
Whether an error has occurred.
no setter
- isLocalApply → bool
-
依存変更と外部操作を禁止するローカル適用の実行状態。
no setter
- isNoDeployApply → bool
-
Whether the current apply must not run or schedule deployments.
no setter
- sprintf ↔ PrintFormat
-
getter/setter pair
Functions
-
addFlutterImport(
List< String> packages, {bool development = false, String flutterCommand = "flutter"}) → Future<void> -
Add Flutter dependencies from
packages. -
addNpmImport(
List< String> packages, {bool development = false, String npmCommand = "npm"}) → Future<void> -
Add npm imports by giving
packages. -
command(
String title, List< String> commands, {String? workingDirectory, bool runInShell = true, bool catchError = false, bool failOnStderr = true, void action(Process process, String line)?}) → Future<String> - Run command.
-
dartDefinesEnvironmentNames(
String path, {bool requiredOnly = false}) → Set< String> -
Returns the names of environment variables referenced by
${NAME}in the dart-define file atpath. -
ensureFirebaseDebugLogLink(
{String path = "firebase-debug.log"}) → Future< bool> -
Ensures that
pathis a symbolic link to/dev/null. -
error(
String message) → void - Display errors.
-
expandEnvironmentVariables(
dynamic object, {Map< String, String> ? environment, String? source}) → dynamic -
Expands
${NAME}in the string values ofobjectwith environment variables. -
find(
Directory root, Pattern pattern, {bool recursive = true}) → Future< File?> -
Get the first file that matches
patterninroot. -
findDirectory(
Directory root, Pattern pattern) → Future< Directory?> -
Get the first directory in
rootthat matchespattern. -
findGitDirectory(
Directory current) → Future< Directory?> - Get the directory where Git resides.
-
generateCode(
int length, {int seed = 0, String charSet = "23456789abcdefghjkmnpqrstuvwxy"}) → String -
Generates and returns a random string with the number of characters given by
length. -
getFlutterVersion(
) → Future< String> - Get the Flutter version.
-
githubSecret(
String title, {required String gh, required String name, required String value, String? workingDirectory}) → Future< void> -
Register
valueas the GitHub Actions secretnameusinggh. -
initializeDateFormatting(
[String? locale, String? ignored]) → Future< void> -
This should be called for at least one
localebefore any date formatting methods are called. It sets up the lookup for date symbols. Both thelocaleandignoredparameter are ignored, as the data for all locales is directly available. -
jsonDecodeAsList<
T extends Object?> (String json, [List< T> defaultValue = const []]) → List<T> -
Converts
jsonto a Json-decoded List<dynamic> object. -
jsonDecodeAsMap<
T extends Object?> (String json, [Map< String, T> defaultValue = const {}]) → Map<String, T> -
Converts
jsonto a Json-decoded Map<String, dynamic> object. -
jsonEncodable(
Object? o) → bool -
If this object is Json encodable,
trueis returned. -
label(
String title) → void - Display labels.
-
loadKatanaYaml(
String content, {Map< String, String> ? environment, String? source}) → dynamic -
Loads
contentas YAML into a modifiable object and expands${NAME}with environment variables. -
modifize(
dynamic object) → dynamic - Make an Unmodifidable map or listing Modifidable.
-
nullOfList<
T> () → List< T> ? -
A
nullobject with a defined type of List<T>? -
nullOfMap<
K, V> () → Map< K, V> ? -
A
nullobject with a defined type of Map<K, V>? -
nullOfSet<
T> () → Set< T> ? -
A
nullobject with a defined type of Set<T>? -
resolveDartDefinesFile(
String path, {Map< String, String> ? environment, bool alwaysWrite = false}) → String -
Expands
${NAME}in the values of the dart-define file atpathand returns the path of the file to pass to Flutter. -
resolveDartDefinesFileOrExit(
String path) → String - Calls resolveDartDefinesFile and exits with an error message if it fails.
-
retrievePackageName(
) → String - Retrieve the package name.
-
runApplyCommands<
T> (Future< T> body(), {bool local = false, bool noDeploy = false}) → Future<T> - apply 実行中だけ内部コマンドの終了コードを必須検証します。
-
synchronizeLocationPodfilePermissions(
{required bool requireAlwaysPermission}) → Future< void> - Synchronizes permission_handler and geolocator location compilation flags.
-
uuid(
{DateTime? baseTime, bool reverse = false}) → String - Generate and retrieve the UUID for Version 7.
-
validateFilePath(
String path) → bool - Validate the file path.
-
validateLocalFlutterDependencies(
List< String> packages, {bool development = false}) → void - ローカル適用で使用する、宣言済み・解決済みの Dart 依存を確認します。
-
wait(
Iterable futures) → Future< void> -
Wait until all Futures given in
futuresare completed.
Typedefs
- ApiResponse = Response
- An HTTP response where the entire response body is known in advance.
- ApiResquest = Request
- An HTTP request where the entire request body is known in advance.
- DynamicList = List
- Represents the type of List<dynamic>.
-
DynamicMap
= Map<
String, dynamic> - Represents the type of Map<String, dynamic>.
Exceptions / Errors
- IOSSigningEnvironmentException
- Exception thrown when iOS signing values supplied by environment variables cannot be used.
- KatanaDartDefinesException
- Exception thrown when an expanded dart-define value contains a line break.
- KatanaEnvironmentVariableException
-
Exception thrown when an environment variable referenced by
${NAME}is not defined.