puma 0.6.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 46

pipeline status coverage report Pub

A simple cli tool to manage your project.

Dependencies management #

Install dependencie #

You can easily add package with puma.

puma package -i mongo_dart

Like that puma will automatically get the latest version of the package.

If you want a specific version of you package you specify the version like that

puma package -i mongo_dart:0.0.1

If you need to reference a package locally you can do

puma package -i ./mongo_dart

Add a dependencie to the dev_dependencies

To add a dev dependencie you can add --dev to the command

puma package -i build_runner:^1.0.0 --dev

Remove dependencie #

To remove a dependencie you can do like that

puma package -d mongo_dart

Version management #

puma help you manage version management.

Breaking change #

If you do a breaking change in your project just run

puma version --breaking

To bump the version of your package.

Major change #

If you just need to bump the major version of your package you can do

puma version --major

Minor change #

If you just need to bump the minor version of your package you can do

puma version --minor

Patch change #

If you just need to bump the patch version of your package you can do

puma version --patch

Flutter management #

Add asset #

You can add Flutter asset by using this command

This will add one file :

puma flutter assets --add lib/main.dart

And this will add the entire folder :

puma flutter assets --add lib

0.6.1 #

  • add basic doc

0.6.0 #

  • add lot of test for the common path

0.5.2 #

  • remove debug

0.5.1 #

  • fix parsing local package
  • re-add bump version for major, minor and patch

0.5.0 #

  • refactor all the package
  • see the readme on how to use it due to lot of breaking change

0.4.3 #

  • fix indentation in yaml

0.4.2 #

  • add add-flutter-asset to the README
  • update CHANGELOG

0.4.1 #

  • fix usage

0.4.0 #

  • Add add-flutter-asset parameters

0.3.0 #

  • improve README.md
  • add run pub get as a command puma get

0.1.0 #

  • Initial version, created by Stagehand


import 'dart:async';
import 'dart:convert';
import 'dart:io';

import 'package:puma/puma.dart';
import 'package:http/io_client.dart';
import 'package:yaml/yaml.dart' as yaml;

Future<void> main(List<String> args) async {
  final pubspecFile = File('pubspec.yaml');
  final pubspecContent = await pubspecFile.readAsString();
    ..pubspec.listen((content) {
      pubspecFile.writeAsStringSync(content, mode: FileMode.write);
    ..needPubGet.listen((_) async {
      await pubGet();

Future<String> getLocalPackageName(String path) async {
  final pubspecPath = '${path}pubspec.yaml';
  final otherPubspec = File(pubspecPath);
  final pubspecExist = await otherPubspec.exists();
  if (pubspecExist) {
    final otherYaml =
        yaml.loadYaml(await otherPubspec.readAsString()) as yaml.YamlMap;
    return otherYaml['name'];
  return null;

Future<List<String>> getAssetsList(String path) async {
  final isDirectory = await FileSystemEntity.isDirectory(path);
  if (isDirectory) {
    final d = Directory(path);
    final paths = d.listSync(recursive: true)
      ..removeWhere((e) => e.statSync().type != FileSystemEntityType.file);
    final newAssets = paths.map((entity) => entity.path).toList();
  return [path];

Future<void> pubGet() async {
  final process = await Process.start('pub', ['get']);

Use this package as an executable

1. Install it

You can install the package from the command line:

$ pub global activate puma

2. Use it

The package has the following executables:

$ puma

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  puma: ^0.6.3

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:puma/puma.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Feb 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Health suggestions

Fix lib/src/commander.dart. (-1.49 points)

Analysis of lib/src/commander.dart reported 3 hints:

line 140 col 7: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

line 141 col 7: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

line 142 col 7: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

Fix bin/main.dart. (-0.50 points)

Analysis of bin/main.dart reported 1 hint:

line 25 col 5: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

Fix lib/src/command/package.dart. (-0.50 points)

Analysis of lib/src/command/package.dart reported 1 hint:

line 18 col 13: Don't explicitly initialize variables to null.

Fix additional 4 files with analysis or formatting issues. (-1.50 points)

Additional issues in the following files:

  • lib/src/commands.dart (1 hint)
  • lib/src/utils/get_command.dart (1 hint)
  • lib/src/utils/write_content.dart (1 hint)
  • lib/src/package_details.dart (Run dartfmt to format lib/src/package_details.dart.)

Maintenance suggestions

Package is getting outdated. (-12.05 points)

The package was last published 58 weeks ago.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
args ^1.5.1 1.5.2
build_cli_annotations ^1.0.1 1.1.0
http ^0.12.0 0.12.0+4
meta ^1.1.7 1.1.8
pub_semver ^1.4.2 1.4.3
yaml ^2.1.15 2.2.0
Transitive dependencies
async 2.4.0
charcode 1.1.3
collection 1.14.12
http_parser 3.1.3
path 1.6.4
pedantic 1.9.0
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
build_cli ^1.2.1
build_runner ^1.0.0
test ^1.0.0