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

パッケージ詳細v10.4.7

dcli

Dart コンソール SDK - Dart を使用してコンソール (CLI) アプリケーション/スクリプトを書く。

macOSWindowsLinux
30日間ダウンロード
5.9万
いいね数
226
Pub ポイント
150

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

flutter pub add dcli

パッケージ概要

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

dcli は、コマンドラインインターフェース(CLI)アプリケーションおよびスクリプトの構築を目的としたDart SDKです。コンソールとの対話、ファイルおよびディレクトリの管理、システムプロセスの処理、コマンドライン引数の解析に役立つ豊富なユーティリティを提供しています。Dart開発者向けに特別に設計されており、macOS、Windows、Linuxでスムーズに動作するクロスプラットフォームCLIツールの作成を容易にします。入出力、ファイル操作、シェル統合のための直感的なAPIにより、dcliは自動化スクリプトや開発者ツールの開発を効率化します。ターミナル環境でDartのパフォーマンスとシンプルさを活かしたい方にとって理想的です。

用途

  • ビルディング自動化スクリプト
  • 開発者向けツールの作成
  • クロスプラットフォームCLIユーティリティの作成
  • ファイルシステム操作の管理
  • コマンドライン引数の解析
  • シェルコマンドの実行

主な機能

  • クロスプラットフォーム対応(macOS、Windows、Linux)
  • 豊富なコンソール I/O 処理
  • ファイルおよびディレクトリの操作
  • プロセスの実行と管理
  • コマンドライン引数の解析
  • 組み込みシェルスクリプティング機能

適している対象

  • CLI ツール向けの Dart 開発者
  • 自動化スクリプト作成者
  • DevOps エンジニア
  • 開発ワークフロー用のツールビルダー
  • 他のスクリプト言語よりもDartを好むユーザー

注意事項

  • Dartの基本的な知識が必要です
  • CLIに焦点を当てた用途に限定
  • 複雑なタスクには追加の依存関係が必要になる場合があります
  • GUIまたはWebアプリケーションには適していません
  • ターミナル環境でのみ最適に使用されます

元の README

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

pub package Pub Version (including pre-releases) pub publisher Pub Likes Pub Popularity Pub Points

README

See the online documentation for DCli

DCli is an API and tooling for building cross platform command line (CLI) applications and scripts using the Dart programming language.

DCli - pronounced d-cli

Overview

DCli is intended to to allow you to create Command Line (CLI) Applications from simple scripts to full blown CLI apps.

DCli is a great replacement for CLI apps that would have traditionally been built with Bash, C, python, ruby, Go, Rust ....

Whether its a 5 line Bash script or a 100,000 line production management system (like we run internally) DCli is the right place to start building your CLI infrastructure.

So why DCli?

DCli is based on Dart which is a modern programming language that has a set of features that makes building CLI apps easy and reliable.

  • Dart and DCli are simple to learn
  • Compiled or JIT
  • Shebang support (run .dart scripts directly from the cli ./hello.dart)
  • Small transportable execs (from 10MB), Dart VM is NOT required on target system.
  • Typesafe language catches errors at compile time
  • Sound null safety reduces null pointer exceptions
  • Fast
  • Great development environment using vs-code
  • Local and Remote development/debugging
  • Cross platform supporting Linux/Windows/osx/arm

Sponsored by OnePub

Help support DCli by supporting OnePub, the private dart repository. OnePub allows you to privately share dart packages between your own projects or with colleagues. Try it for free and publish your first private package in seconds.

https://onepub.dev

Publish a private package in six commands:

dart pub global activate onepub
onepub login
dcli create --template=full myclipackage
cd myclipackage
onepub pub private
dart pub publish

You can now activate your dcli script from any system with dart installed

dart pub global activate onepub
onepub login
onepub pub global activate myclipackage

Example:

#! /usr/bin/env dcli

import 'dart:io';
import 'package:dcli/dcli.dart';

void main() {
  var name = ask('name:', required: true, validator: Ask.alpha);
  print('Hello $name');

}

To run the above script called hello.dart:

./hello.dart

So why is DCli different?

DCli is based on the relatively new programming language; Dart.

Dart is currently the fastest growing language on github and is the basis on which Flutter is built.

Ubuntu has just announced that Flutter will be the primary platform for building GUI's on Ubuntu and is currently working on replacing the Ubuntu installer using Flutter.

You can now use Dart to build GUI's on Android, IOS, Windows, OSX, Linux and the Web, server side applications and with DCli you can also target console apps.

Imagine the benefits of using a single language across you complete ecosystem.

Dart is a simple to learn, and uses the all too familiar 'C' style syntax. I've heard Dart described as the love child of Java and JavaScript. If you come from either of these environments you will find Dart easy to work with.

Being easy to learn also helps with the maintenance cycle of you CLI apps. You no longer need a specialised developer, as anyone that has even a vague familiarity with Java, Javascript or C, ... will be right at home with Dart in a couple of days.

Dart and DCli are easy to install; DCli makes it a breeze to create simple scripts and provides the tools to manage a script that started out as 100 lines but somehow grew to 10,000 lines.

Dart has is also a large and growing ecosystem of third party libraries that you can include in your CLI app with no more than an import statement and a dependency declaration.

Dart is fast and if you need even more speed it can be compiled to a single file executable that is portable between binary compatible machines.

# compile, install to the local PATH and run hello.dart

$> dcli compile --install hello.dart
$> hello
name: brett
Hello brett


# copy to a remote machine (where dart is NOT installed)
$> scp hello remote.domain.com:

# login to remote machine and run the app hello
$> ssh remote.domain.com
./hello
name: brett
Hello brett

You can use your favourite editor to create DCli scripts. Vi or VIM work fine but Visual Studio Code is recommended.

Use Visual Studio Code for the best development experience with Dart.

Visual Studio Code with the dart-code extension provide a great development an debugging experience including the ability to develop and debug code on a remote server.

Contributing

Read the contributing guide for details on how to get involved.

カテゴリー

依存関係

依存関係一覧 34 件

ソースリポジトリ

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