code: def _command(self, args: argparse.Namespace):
      config_manager = ConfigManager()
      if args.remove:
          config_manager.delete_project(args.project)
          config_manager.save()
          console.print(f"[grey58]OK[/]")
          return
  
      if not args.url:
          console.print("Specify --url")
          exit(1)
      elif not args.token:
          console.print("Specify --token")
          exit(1)
      api_client = dstack.api.server.APIClient(
          base_url=args.url, token=args.token
      )
      try:
          api_client.projects.get(args.project)
      except HTTPError as e:
          if e.response.status_code == 403:
              raise CLIError("Forbidden. Ensure the token is valid.")
          elif e.response.status_code == 404:
              raise CLIError(f"Project '{args.project}' not found.")
          else:
              raise e
      default_project = config_manager.get_project_config()
      if (
          default_project is None
          or default_project.name != args.project
          or default_project.url != args.url
          or default_project.token != args.token
      ):
          set_it_as_default = (
              (
                  args.default
                  or not default_project
                  or confirm_ask(
                      f"Set '{args.project}' as your default project?"
                  )
              )
              if not args.no_default
              else False
          )
          config_manager.configure_project(
              name=args.project,
              url=args.url,
              token=args.token,
              default=set_it_as_default,
          )
          config_manager.save()
      console.print(
          f"Configuration updated at [{colors['code']}]{config_manager.config_filepath}[/{colors['code']}]."
      )
  
file_path: dstack/src/dstack/_internal/cli/commands/config.py
imports: import argparse
  from requests import HTTPError
  import dstack.api.server
  from dstack._internal.cli.commands import BaseCommand
  from dstack._internal.cli.utils.common import colors, confirm_ask, console
  from dstack._internal.core.errors import CLIError
  from dstack._internal.core.services.configs import ConfigManager
label_desc: Use image node_id 2 for calling the ConfigCommand obj's underlying member method code with example usage: obj._command(args) without return types