public function packCommand($in, $out): int
    {
        $time = \microtime(1);
        $workDir = $in->getPwd();

        $dir = $in->getOpt('dir') ?: $workDir;
        $cpr = $this->configCompiler($dir);

        $counter = null;
        $refresh = $in->boolOpt('refresh');
        $pharFile = $workDir . '/' . $in->sameOpt(['o', 'output'], \basename($workDir) . '.phar');

        // use fast build
        if ($this->input->boolOpt('fast')) {
            $cpr->setModifies($cpr->findChangedByGit());
            $this->output->liteNote('Use fast build, will only pack changed or new files(from git status)');
        }

        $out->liteInfo(
            "Now, will begin building phar package.\n from path: <comment>$workDir</comment>\n" .
            " phar file: <info>$pharFile</info>"
        );

        $out->info('Pack file to Phar: ');
        $cpr->onError(function ($error) {
            $this->output->warning($error);
        });

        if ($in->getOpt('debug')) {
            $cpr->onAdd(function ($path) {
                $this->output->write(" <comment>+</comment> $path");
            });
        } else {
            $counter = Show::counterTxt('Handling ...', 'Done.');
            $cpr->onAdd(function () use ($counter) {
                $counter->send(1);
            });
        }

        // packing ...
        $cpr->pack($pharFile, $refresh);

        // end
        if ($counter) {
            $counter->send(-1);
        }

        $out->write([
            PHP_EOL . '<success>Phar build completed!</success>',
            " - Phar file: $pharFile",
            ' - Phar size: ' . round(filesize($pharFile) / 1024 / 1024, 2) . ' Mb',
            ' - Pack Time: ' . round(microtime(1) - $time, 3) . ' s',
            ' - Pack File: ' . $cpr->getCounter(),
            ' - Commit ID: ' . $cpr->getVersion(),
        ]);

        return 0;
    }