code: public function actionExt($extension, $repo = null)
      {
          // root of the dev repo
          $base = \dirname(\dirname(__DIR__));
          $extensionDir = "$base/extensions/$extension";
  
          if (!file_exists($extensionDir)) {
              if (empty($repo)) {
                  if (isset($this->extensions[$extension])) {
                      $repo = $this->extensions[$extension];
                      if ($this->useHttp) {
                          $repo = str_replace('git@github.com:', 'https://github.com/', $repo);
                      }
                  } else {
                      $this->stderr("Repo argument is required for extension '$extension'.\n", Console::FG_RED);
                      return 1;
                  }
              }
  
              $this->stdout("cloning extension repo '$extension' from '$repo'...\n", Console::BOLD);
              passthru('git clone ' . escapeshellarg($repo) . ' ' . $extensionDir);
              $this->stdout("done.\n", Console::BOLD, Console::FG_GREEN);
          }
  
          // cleanup
          $this->stdout("cleaning up extension '$extension' vendor directory...\n", Console::BOLD);
          $this->cleanupVendorDir($extensionDir);
          $this->stdout("done.\n", Console::BOLD, Console::FG_GREEN);
  
          // composer update
          $this->stdout("updating composer for extension '$extension'...\n", Console::BOLD);
          chdir($extensionDir);
          $command = 'composer update --prefer-dist';
          if ($this->composerNoProgress) {
              $command .= ' --no-progress';
          }
          passthru($command);
          $this->stdout("done.\n", Console::BOLD, Console::FG_GREEN);
  
          // link directories
          $this->stdout("linking framework and extensions to '$extension' vendor dir...\n", Console::BOLD);
          $this->linkFrameworkAndExtensions($extensionDir, $base);
          $this->stdout("done.\n", Console::BOLD, Console::FG_GREEN);
  
          return 0;
      }
docs: This command installs an extension in the `extensions` directory and links the framework and other extensions.
  
  @param string $extension the application name e.g. `basic` or `advanced`.
  @param string $repo url of the git repo to clone if it does not already exist.
  
  @return int