title: Symfony 4 custom container aware command error
body: <p>I am trying to create custom command in Symfony 4 project</p>
  
  <pre><code>class AppOauthClientCreateCommand extends ContainerAwareCommand
  {
  
     protected function configure()
     {
       $this
          -&gt;setName('app:oauth-client:create')
          -&gt;setDescription('Create a new OAuth client');
     }
  
     protected function execute(InputInterface $input, OutputInterface $output)
     {
      $clientManager = $this-&gt;getContainer()-&gt;get('fos_oauth_server.client_manager.default');
      $client = $clientManager-&gt;createClient();
      $client-&gt;setAllowedGrantTypes(array(OAuth2::GRANT_TYPE_USER_CREDENTIALS));
      $clientManager-&gt;updateClient($client);
  
      $output-&gt;writeln(sprintf('client_id=%s_%s', $client-&gt;getId(), $client-&gt;getRandomId()));
      $output-&gt;writeln(sprintf('client_secret=%s', $client-&gt;getSecret()));
     }
  }
  </code></pre>
  
  <p>I am getting following error when I try to run this command</p>
  
  <blockquote>
    <p>The "fos_oauth_server.client_manager.default" service or alias has been removed or inlined when the container was compiled. You should either<br>
       make it public, or stop using the container directly and use dependency injection instead.   </p>
  </blockquote>
  
  <p>How do I make vendor service public or am I missing something in command configurations?</p>