パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.3.4+1

cli_launcher

ローカルにインストールされたバージョンの起動をサポートするCLI開発ユーティリティ。

AndroidiOSLinuxmacOSWindows
30日間ダウンロード
106万
いいね数
5
Pub ポイント
160

パッケージをインストール

flutter pub add cli_launcher

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

開発中にローカルにインストールされたコマンドラインツールを簡単に起動できるように設計されたFlutter/Dartパッケージです。Flutterアプリ内からCLIユーティリティをスムーズに実行でき、Android、iOS、Linux、macOS、Windowsでのクロスプラットフォームワークフローをサポートします。外部のコマンドラインプログラムと統合または呼び出す必要があるツールを開発する開発者にとって理想的であり、ローカルインストールや実行パスの管理を通じてテストおよびデバッグを簡素化します。システムレベルのコマンドに直接アクセスが必要な開発環境では特に有用です。

用途

  • アプリ開発中にローカルCLIツールを起動する
  • Flutterアプリに外部コマンドラインユーティリティを統合する
  • 制御された環境でコマンドラインの相互作用をテストする
  • Flutterアプリ内でのビルドまたはデプロイスクリプトの自動化
  • ローカル実行可能ファイルに依存する開発者ツールチェーンのサポート

主な機能

  • クロスプラットフォーム CLI 実行サポート
  • ローカルにインストールされたツールとの簡単な統合
  • 実行可能ファイルの自動パス解決
  • コマンドを実行するためのシンプルな API
  • コマンドの失敗に対する組み込みエラーハンドリング

適している対象

  • CLI ツールを使用する Flutter 開発者
  • システムコマンドとの統合を必要とするツール
  • ローカルコマンド実行を必要とする開発環境
  • Flutter プロジェクトにおけるビルドおよび自動化スクリプト
  • カスタムまたはサードパーティのCLIユーティリティを使用するチーム

注意事項

  • システムコマンドを実行するための適切な権限が必要です
  • プラットフォーム固有の構成が必要になる場合があります
  • CLI ツールの本番配布を想定していません
  • ローカルインストールに限定され、リモート実行は不可
  • ホストシステム上のターゲットCLIツールの正しく設定されていること依存

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

CI Pub Version

CLI development utility to support launching locally installed versions.

When the globally installed version of a CLI is launched and it finds a locally installed version of itself that is a different version, it will launch the locally installed version.

Otherwise, the globally installed version will continue to run.

Installing means adding the package that contains the CLI executable to a pubspec.yaml file.

To find the locally installed version, the globally installed version will search for a pubspec.yaml file in the current directory or any parent directory. If it finds one, it will look for a dependency on the package that contains the CLI executable.

In addition, if the CLI is executed in the package that contains the CLI executable, the current version in that package will be launched. This is useful for development.

Launch flow

flowchart TD
    A["User invokes CLI"] --> B["launchExecutable()"]
    B --> C{"Launch context<br/>in args?"}

    C -- "Yes (relaunched by global)" --> D["Restore original working<br/>directory, call entrypoint"]
    C -- "No (initial invocation)" --> E["Detect global installation<br/>from Platform.script"]

    E --> F["Search for local installation<br/>(walk up from cwd, check pubspec.yaml<br/>for dependency or dev_dependency)"]

    F -- "Found" --> G{"pubspec.lock<br/>up to date?"}
    F -- "Not found" --> GLOBAL

    G -- "Yes" --> I
    G -- "Missing or<br/>older than<br/>pubspec.yaml" --> H["Run pub get from<br/>lock file root"]

    H -- "OK" --> I{"Source package,<br/>path dep, or<br/>version mismatch?"}
    H -- "Failed" --> EXIT["Exit with error"]

    I -- "No" --> GLOBAL["Run entrypoint<br/>with global installation"]
    I -- "Yes" --> J["Launch local via<br/>dart run package:executable<br/>(inject launch context in args)"]

    J --> K["New process starts,<br/>calls launchExecutable(),<br/>finds launch context in args"]
    K --> D

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。

ランキング