> For the complete documentation index, see [llms.txt](https://quantumphp.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://quantumphp.gitbook.io/docs/packages/console/overview.md).

# Overview

The Console package provides Quantum's command base class, command discovery helper, and the built-in framework commands used by `qt`.

Use it when you want to:

* add project-specific CLI commands
* inspect routes and scheduled work from the terminal
* run framework setup tasks such as key generation, module scaffolding, and local serving

## Package shape

The package has three main pieces:

* `Quantum\Console\CliCommand` is the base class for custom commands
* `Quantum\Console\CommandDiscovery` finds command classes inside a directory
* `Quantum\Console\Commands\*` contains the framework's built-in commands

## What the package gives you

A Console command can declare:

* a command name
* a description and help text
* positional arguments
* named options
* one `exec()` method with your command logic

The base class also gives you small terminal helpers such as `info()`, `error()`, `comment()`, `question()`, and `confirm()`.

## Important constraints

* Discovered commands must be instantiable subclasses of `CliCommand`.
* Discovered commands must have a constructor that can be called without required arguments, because `CommandDiscovery` creates them with `newInstance()` and no parameters.
* `CliCommand::execute()` always returns Symfony's success status after calling `exec()`. In practice, many command failures are printed as messages instead of returning a non-zero exit code.
* Input and output objects are available only while the command is running. Calling `getArgument()`, `getOption()`, or output helpers before execution raises a runtime error.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://quantumphp.gitbook.io/docs/packages/console/overview.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
