패키지, 저장소 및 앱 카테고리 검색

패키지 상세v10.4.7

dcli

Dart 콘솔 SDK - Dart를 사용하여 콘솔(CLI) 앱/스크립트 작성하기.

macOSWindowsLinux
30일 다운로드
5.9만
좋아요
226
Pub 점수
150

패키지 설치

flutter pub add dcli

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

dcli는 명령줄 인터페이스(CLI) 애플리케이션과 스크립트를 구축하기 위해 설계된 Dart SDK입니다. 콘솔과의 상호작용, 파일 및 디렉터리 관리, 시스템 프로세스 처리, 명령줄 인수 파싱을 위한 풍부한 유틸리티 세트를 제공합니다. Dart 개발자를 위해 특별히 제작된 dcli는 macOS, Windows, Linux에서 원활하게 작동하는 크로스플랫폼 CLI 도구를 쉽게 작성할 수 있도록 합니다. 입력/출력, 파일 작업, 쉘 통합을 위한 직관적인 API를 통해 dcli는 자동화 스크립트와 개발자 도구 개발을 간소화합니다. 터미널 환경에서 Dart의 성능과 단순함을 활용하고 싶은 사용자에게 이상적입니다.

사용 사례

  • 빌딩 자동화 스크립트
  • 개발자 도구 만들기
  • 크로스 플랫폼 CLI 유틸리티 작성
  • 파일 시스템 작업 관리
  • 명령줄 인수 파싱
  • 쉘 명령 실행

주요 기능

  • 크로스 플랫폼 지원 (macOS, Windows, Linux)
  • 풍부한 콘솔 입출력 처리
  • 파일 및 디렉터리 조작
  • 프로세스 실행 및 관리
  • 명령줄 인수 파싱
  • 내장된 쉘 스크립팅 기능

적합한 대상

  • CLI 도구를 대상으로 한 Dart 개발자
  • 자동화 스크립트 생성자
  • 데브옵스 엔지니어
  • 개발 워크플로우를 위한 도구 빌더
  • 다른 스크립트 언어보다 Dart를 선호하는 사용자

고려 사항

  • Dart에 대한 기본 지식이 필요합니다
  • CLI 중심 사용 사례에 제한됨
  • 복잡한 작업을 위해 추가 종속성이 필요할 수 있습니다
  • GUI 또는 웹 애플리케이션에 적합하지 않습니다
  • 터미널 환경에서만 최적으로 사용됨

원본 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 개

소스 저장소

이 패키지를 사용하는 프로젝트