Critics have remarked that those four worthies were truly peerless throughout the ages; yet the present falls short of the pastβthe ancients favored unadorned simplicity, whereas the moderns prefer refined elegance. Styles of substance and ornament rise and fall in succession, shifting with the changing mores of the times; such evolution is simply the natural order of things. The ideal lies in honoring antiquity without clashing with the present, and embracing modernity without succumbing to its flawsβembodying that perfect balance of substance and refinement that defines the true gentleman. There is surely no need to abandon a carved palace in favor of a cave dwelling, or to trade a jade carriage for a primitive cart with solid wooden wheels.
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Command\CompleteCommand;
use Symfony\Component\Console\Command\DumpCompletionCommand;
use Symfony\Component\Console\Command\HelpCommand;
use Symfony\Component\Console\Command\LazyCommand;
use Symfony\Component\Console\Command\ListCommand;
use Symfony\Component\Console\Command\SignalableCommandInterface;
use Symfony\Component\Console\CommandLoader\CommandLoaderInterface;
use Symfony\Component\Console\Completion\CompletionInput;
use Symfony\Component\Console\Completion\CompletionSuggestions;
use Symfony\Component\Console\Completion\Suggestion;
use Symfony\Component\Console\Event\ConsoleCommandEvent;
use Symfony\Component\Console\Event\ConsoleErrorEvent;
use Symfony\Component\Console\Event\ConsoleSignalEvent;
use Symfony\Component\Console\Event\ConsoleTerminateEvent;
use Symfony\Component\Console\Exception\CommandNotFoundException;
use Symfony\Component\Console\Exception\ExceptionInterface;
use Symfony\Component\Console\Exception\LogicException;
use Symfony\Component\Console\Exception\NamespaceNotFoundException;
use Symfony\Component\Console\Exception\RuntimeException;
use Symfony\Component\Console\Formatter\OutputFormatter;
use Symfony\Component\Console\Helper\DebugFormatterHelper;
use Symfony\Component\Console\Helper\DescriptorHelper;
use Symfony\Component\Console\Helper\FormatterHelper;
use Symfony\Component\Console\Helper\Helper;
use Symfony\Component\Console\Helper\HelperSet;
use Symfony\Component\Console\Helper\ProcessHelper;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputAwareInterface;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Output\ConsoleOutputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\SignalRegistry\SignalRegistry;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\ErrorHandler\ErrorHandler;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\Service\ResetInterface;
/**
* An Application is the container for a collection of commands.
*
* It is the main entry point of a Console application.
*
* This class is optimized for a standard CLI environment.
*
* Usage:
*
* $app = new Application('myapp', '1.0 (stable)');
* $app->add(new SimpleCommand());
* $app->run();
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class Application implements ResetInterface
{
private array $commands = [];
private bool $wantHelps = false;
private ?Command $runningCommand = null;
private string $name;
private string $version;
private ?CommandLoaderInterface $commandLoader = null;
private bool $catchExceptions = true;
private bool $autoExit = true;
private InputDefinition $definition;
private HelperSet $helperSet;
private ?EventDispatcherInterface $dispatcher = null;
private Terminal $terminal;
private string $defaultCommand;
private bool $singleCommand = false;
private bool $initialized = false;
private ?SignalRegistry $signalRegistry = null;
private array $signalsToDispatchEvent = [];
public function __construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN')
{
$this->name = $name;
$this->version = $version;
$this->terminal = new Terminal();
$this->defaultCommand = 'list';
if (\defined('SIGINT') && SignalRegistry::isSupported()) {
$this->signalRegistry = new SignalRegistry();
$this->signalsToDispatchEvent = [\SIGINT, \SIGTERM, \SIGUSR1, \SIGUSR2];
}
}
/**
* @final
*/
public function setDispatcher(EventDispatcherInterface $dispatcher): void
{
$this->dispatcher = $dispatcher;
}
/**
* @return void
*/
public function setCommandLoader(CommandLoaderInterface $commandLoader)
{
$this->commandLoader = $commandLoader;
}
public function getSignalRegistry(): SignalRegistry
{
if (!$this->signalRegistry) {
throw new RuntimeException('Signals are not supported. Make sure that the "pcntl" extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.');
}
return $this->signalRegistry;
}
/**
* @return void
*/
public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent)
{
$this->signalsToDispatchEvent = $signalsToDispatchEvent;
}
/**
* Runs the current application.
*
* @return int 0 if everything went fine, or an error code
*
* @throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}.
*/
public function run(InputInterface $input = null, OutputInterface $output = null): int
{
if (\function_exists('putenv')) {
@putenv('LINES='.$this->terminal->getHeight());
@putenv('COLUMNS='.$this->terminal->getWidth());
}
$input ??= new ArgvInput();
$output ??= new ConsoleOutput();
$renderException = function (\Throwable $e) use ($output) {
if ($output instanceof ConsoleOutputInterface) {
$this->renderThrowable($e, $output->getErrorOutput());
} else {
$this->renderThrowable($e, $output);
}
};
if ($phpHandler = set_exception_handler($renderException)) {
restore_exception_handler();
if (!\is_array($phpHandler) || !$phpHandler[0] instanceof ErrorHandler) {
$errorHandler = true;
} elseif ($errorHandler = $phpHandler[0]->setExceptionHandler($renderException)) {
$phpHandler[0]->setExceptionHandler($errorHandler);
}
}
$this->configureIO($input, $output);
try {
$exitCode = $this->doRun($input, $output);
} catch (\Exception $e) {
if (!$this->catchExceptions) {
throw $e;
}
$renderException($e);
$exitCode = $e->getCode();
if (is_numeric($exitCode)) {
$exitCode = (int) $exitCode;
if ($exitCode <= 0) {
$exitCode = 1;
}
} else {
$exitCode = 1;
}
} finally {
// if the exception handler changed, keep it
// otherwise, unregister $renderException
if (!$phpHandler) {
if (set_exception_handler($renderException) === $renderException) {
restore_exception_handler();
}
restore_exception_handler();
} elseif (!$errorHandler) {
$finalHandler = $phpHandler[0]->setExceptionHandler(null);
if ($finalHandler !== $renderException) {
$phpHandler[0]->setExceptionHandler($finalHandler);
}
}
}
if ($this->autoExit) {
if ($exitCode > 255) {
$exitCode = 255;
}
exit($exitCode);
}
return $exitCode;
}
/**
* Runs the current application.
*
* @return int 0 if everything went fine, or an error code
*/
public function doRun(InputInterface $input, OutputInterface $output)
{
if (true === $input->hasParameterOption(['--version', '-V'], true)) {
$output->writeln($this->getLongVersion());
return 0;
}
try {
// Makes ArgvInput::getFirstArgument() able to distinguish an option from an argument.
$input->bind($this->getDefinition());
} catch (ExceptionInterface) {
// Errors must be ignored, full binding/validation happens later when the command is known.
}
$name = $this->getCommandName($input);
if (true === $input->hasParameterOption(['--help', '-h'], true)) {
if (!$name) {
$name = 'help';
$input = new ArrayInput(['command_name' => $this->defaultCommand]);
} else {
$this->wantHelps = true;
}
}
if (!$name) {
$name = $this->defaultCommand;
$definition = $this->getDefinition();
$definition->setArguments(array_merge(
$definition->getArguments(),
[
'command' => new InputArgument('command', InputArgument::OPTIONAL, $definition->getArgument('command')->getDescription(), $name),
]
));
}
try {
$this->runningCommand = null;
// the command name MUST be the first element of the input
$command = $this->find($name);
} catch (\Throwable $e) {
if (($e instanceof CommandNotFoundException && !$e instanceof NamespaceNotFoundException) && 1 === \count($alternatives = $e->getAlternatives()) && $input->isInteractive()) {
$alternative = $alternatives[0];
$style = new SymfonyStyle($input, $output);
$output->writeln('');
$formattedBlock = (new FormatterHelper())->formatBlock(sprintf('Command "%s" is not defined.', $name), 'error', true);
$output->writeln($formattedBlock);
if (!$style->confirm(sprintf('Do you want to run "%s" instead? ', $alternative), false)) {
if (null !== $this->dispatcher) {
$event = new ConsoleErrorEvent($input, $output, $e);
$this->dispatcher->dispatch($event, ConsoleEvents::ERROR);
return $event->getExitCode();
}
return 1;
}
$command = $this->find($alternative);
} else {
if (null !== $this->dispatcher) {
$event = new ConsoleErrorEvent($input, $output, $e);
$this->dispatcher->dispatch($event, ConsoleEvents::ERROR);
if (0 === $event->getExitCode()) {
return 0;
}
$e = $event->getError();
}
try {
if ($e instanceof CommandNotFoundException && $namespace = $this->findNamespace($name)) {
$helper = new DescriptorHelper();
$helper->describe($output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output, $this, [
'format' => 'txt',
'raw_text' => false,
'namespace' => $namespace,
'short' => false,
]);
return isset($event) ? $event->getExitCode() : 1;
}
throw $e;
} catch (NamespaceNotFoundException) {
throw $e;
}
}
}
if ($command instanceof LazyCommand) {
$command = $command->getCommand();
}
$this->runningCommand = $command;
$exitCode = $this->doRunCommand($command, $input, $output);
$this->runningCommand = null;
return $exitCode;
}
/**
* @return void
*/
public function reset()
{
}
/**
* @return void
*/
public function setHelperSet(HelperSet $helperSet)
{
$this->helperSet = $helperSet;
}
/**
* Get the helper set associated with the command.
*/
public function getHelperSet(): HelperSet
{
return $this->helperSet ??= $this->getDefaultHelperSet();
}
/**
* @return void
*/
public function setDefinition(InputDefinition $definition)
{
$this->definition = $definition;
}
/**
* Gets the InputDefinition related to this Application.
*/
public function getDefinition(): InputDefinition
{
$this->definition ??= $this->getDefaultInputDefinition();
if ($this->singleCommand) {
$inputDefinition = $this->definition;
$inputDefinition->setArguments();
return $inputDefinition;
}
return $this->definition;
}
/**
* Adds suggestions to $suggestions for the current completion input (e.g. option or argument).
*/
public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void
{
if (
CompletionInput::TYPE_ARGUMENT_VALUE === $input->getCompletionType()
&& 'command' === $input->getCompletionName()
) {
foreach ($this->all() as $name => $command) {
// skip hidden commands and aliased commands as they already get added below
if ($command->isHidden() || $command->getName() !== $name) {
continue;
}
$suggestions->suggestValue(new Suggestion($command->getName(), $command->getDescription()));
foreach ($command->getAliases() as $name) {
$suggestions->suggestValue(new Suggestion($name, $command->getDescription()));
}
}
return;
}
if (CompletionInput::TYPE_OPTION_NAME === $input->getCompletionType()) {
$suggestions->suggestOptions($this->getDefinition()->getOptions());
return;
}
}
/**
* Gets the help message.
*/
public function getHelp(): string
{
return $this->getLongVersion();
}
/**
* Gets whether to catch exceptions or not during commands execution.
*/
public function areExceptionsCaught(): bool
{
return $this->catchExceptions;
}
/**
* Sets whether to catch exceptions or not during commands execution.
*
* @return void
*/
public function setCatchExceptions(bool $boolean)
{
$this->catchExceptions = $boolean;
}
/**
* Gets whether to automatically exit after a command execution or not.
*/
public function isAutoExitEnabled(): bool
{
return $this->autoExit;
}
/**
* Sets whether to automatically exit after a command execution or not.
*
* @return void
*/
public function setAutoExit(bool $boolean)
{
$this->autoExit = $boolean;
}
/**
* Gets the name of the application.
*/
public function getName(): string
{
return $this->name;
}
/**
* Sets the application name.
*
* @return void
*/
public function setName(string $name)
{
$this->name = $name;
}
/**
* Gets the application version.
*/
public function getVersion(): string
{
return $this->version;
}
/**
* Sets the application version.
*
* @return void
*/
public function setVersion(string $version)
{
$this->version = $version;
}
/**
* Returns the long version of the application.
*
* @return string
*/
public function getLongVersion()
{
if ('UNKNOWN' !== $this->getName()) {
if ('UNKNOWN' !== $this->getVersion()) {
return sprintf('%s <info>%s</info>', $this->getName(), $this->getVersion());
}
return $this->getName();
}
return 'Console Tool';
}
/**
* Registers a new command.
*/
public function register(string $name): Command
{
return $this->add(new Command($name));
}
/**
* Adds an array of command objects.
*
* If a Command is not enabled it will not be added.
*
* @param Command[] $commands An array of commands
*
* @return void
*/
public function addCommands(array $commands)
{
foreach ($commands as $command) {
$this->add($command);
}
}
/**
* Adds a command object.
*
* If a command with the same name already exists, it will be overridden.
* If the command is not enabled it will not be added.
*
* @return Command|null
*/
public function add(Command $command)
{
$this->init();
$command->setApplication($this);
if (!$command->isEnabled()) {
$command->setApplication(null);
return null;
}
if (!$command instanceof LazyCommand) {
// Will throw if the command is not correctly initialized.
$command->getDefinition();
}
if (!$command->getName()) {
throw new LogicException(sprintf('The command defined in "%s" cannot have an empty name.', get_debug_type($command)));
}
$this->commands[$command->getName()] = $command;
foreach ($command->getAliases() as $alias) {
$this->commands[$alias] = $command;
}
return $command;
}
/**
* Returns a registered command by name or alias.
*
* @return Command
*
* @throws CommandNotFoundException When given command name does not exist
*/
public function get(string $name)
{
$this->init();
if (!$this->has($name)) {
throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name));
}
// When the command has a different name than the one used at the command loader level
if (!isset($this->commands[$name])) {
throw new CommandNotFoundException(sprintf('The "%s" command cannot be found because it is registered under multiple names. Make sure you don\'t set a different name via constructor or "setName()".', $name));
}
$command = $this->commands[$name];
if ($this->wantHelps) {
$this->wantHelps = false;
$helpCommand = $this->get('help');
$helpCommand->setCommand($command);
return $helpCommand;
}
return $command;
}
/**
* Returns true if the command exists, false otherwise.
*/
public function has(string $name): bool
{
$this->init();
return isset($this->commands[$name]) || ($this->commandLoader?->has($name) && $this->add($this->commandLoader->get($name)));
}
/**
* Returns an array of all unique namespaces used by currently registered commands.
*
* It does not return the global namespace which always exists.
*
* @return string[]
*/
public function getNamespaces(): array
{
$namespaces = [];
foreach ($this->all() as $command) {
if ($command->isHidden()) {
continue;
}
$namespaces[] = $this->extractAllNamespaces($command->getName());
foreach ($command->getAliases() as $alias) {
$namespaces[] = $this->extractAllNamespaces($alias);
}
}
return array_values(array_unique(array_filter(array_merge([], ...$namespaces))));
}
/**
* Finds a registered namespace by a name or an abbreviation.
*
* @throws NamespaceNotFoundException When namespace is incorrect or ambiguous
*/
public function findNamespace(string $namespace): string
{
$allNamespaces = $this->getNamespaces();
$expr = implode('[^:]*:', array_map('preg_quote', explode(':', $namespace))).'[^:]*';
$namespaces = preg_grep('{^'.$expr.'}', $allNamespaces);
if (empty($namespaces)) {
$message = sprintf('There are no commands defined in the "%s" namespace.', $namespace);
if ($alternatives = $this->findAlternatives($namespace, $allNamespaces)) {
if (1 == \count($alternatives)) {
$message .= "\n\nDid you mean this?\n ";
} else {
$message .= "\n\nDid you mean one of these?\n ";
}
$message .= implode("\n ", $alternatives);
}
throw new NamespaceNotFoundException($message, $alternatives);
}
$exact = \in_array($namespace, $namespaces, true);
if (\count($namespaces) > 1 && !$exact) {
throw new NamespaceNotFoundException(sprintf("The namespace \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces));
}
return $exact ? $namespace : reset($namespaces);
}
/**
* Finds a command by name or alias.
*
* Contrary to get, this command tries to find the best
* match if you give it an abbreviation of a name or alias.
*
* @return Command
*
* @throws CommandNotFoundException When command name is incorrect or ambiguous
*/
public function find(string $name)
{
$this->init();
$aliases = [];
foreach ($this->commands as $command) {
foreach ($command->getAliases() as $alias) {
if (!$this->has($alias)) {
$this->commands[$alias] = $command;
}
}
}
if ($this->has($name)) {
return $this->get($name);
}
$allCommands = $this->commandLoader ? array_merge($this->commandLoader->getNames(), array_keys($this->commands)) : array_keys($this->commands);
$expr = implode('[^:]*:', array_map('preg_quote', explode(':', $name))).'[^:]*';
$commands = preg_grep('{^'.$expr.'}', $allCommands);
if (empty($commands)) {
$commands = preg_grep('{^'.$expr.'}i', $allCommands);
}
// if no commands matched or we just matched namespaces
if (empty($commands) || \count(preg_grep('{^'.$expr.'$}i', $commands)) < 1) {
if (false !== $pos = strrpos($name, ':')) {
// check if a namespace exists and contains commands
$this->findNamespace(substr($name, 0, $pos));
}
$message = sprintf('Command "%s" is not defined.', $name);
if ($alternatives = $this->findAlternatives($name, $allCommands)) {
// remove hidden commands
$alternatives = array_filter($alternatives, fn ($name) => !$this->get($name)->isHidden());
if (1 == \count($alternatives)) {
$message .= "\n\nDid you mean this?\n ";
} else {
$message .= "\n\nDid you mean one of these?\n ";
}
$message .= implode("\n ", $alternatives);
}
throw new CommandNotFoundException($message, array_values($alternatives));
}
// filter out aliases for commands which are already on the list
if (\count($commands) > 1) {
$commandList = $this->commandLoader ? array_merge(array_flip($this->commandLoader->getNames()), $this->commands) : $this->commands;
$commands = array_unique(array_filter($commands, function ($nameOrAlias) use (&$commandList, $commands, &$aliases) {
if (!$commandList[$nameOrAlias] instanceof Command) {
$commandList[$nameOrAlias] = $this->commandLoader->get($nameOrAlias);
}
$commandName = $commandList[$nameOrAlias]->getName();
$aliases[$nameOrAlias] = $commandName;
return $commandName === $nameOrAlias || !\in_array($commandName, $commands);
}));
}
if (\count($commands) > 1) {
$usableWidth = $this->terminal->getWidth() - 10;
$abbrevs = array_values($commands);
$maxLen = 0;
foreach ($abbrevs as $abbrev) {
$maxLen = max(Helper::width($abbrev), $maxLen);
}
$abbrevs = array_map(function ($cmd) use ($commandList, $usableWidth, $maxLen, &$commands) {
if ($commandList[$cmd]->isHidden()) {
unset($commands[array_search($cmd, $commands)]);
return false;
}
$abbrev = str_pad($cmd, $maxLen, ' ').' '.$commandList[$cmd]->getDescription();
return Helper::width($abbrev) > $usableWidth ? Helper::substr($abbrev, 0, $usableWidth - 3).'...' : $abbrev;
}, array_values($commands));
if (\count($commands) > 1) {
$suggestions = $this->getAbbreviationSuggestions(array_filter($abbrevs));
throw new CommandNotFoundException(sprintf("Command \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $name, $suggestions), array_values($commands));
}
}
$command = $this->get(reset($commands));
if ($command->isHidden()) {
throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name));
}
return $command;
}
/**
* Gets the commands (registered in the given namespace if provided).
*
* The array keys are the full names and the values the command instances.
*
* @return Command[]
*/
public function all(string $namespace = null)
{
$this->init();
if (null === $namespace) {
if (!$this->commandLoader) {
return $this->commands;
}
$commands = $this->commands;
foreach ($this->commandLoader->getNames() as $name) {
if (!isset($commands[$name]) && $this->has($name)) {
$commands[$name] = $this->get($name);
}
}
return $commands;
}
$commands = [];
foreach ($this->commands as $name => $command) {
if ($namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1)) {
$commands[$name] = $command;
}
}
if ($this->commandLoader) {
foreach ($this->commandLoader->getNames() as $name) {
if (!isset($commands[$name]) && $namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1) && $this->has($name)) {
$commands[$name] = $this->get($name);
}
}
}
return $commands;
}
/**
* Returns an array of possible abbreviations given a set of names.
*
* @return string[][]
*/
public static function getAbbreviations(array $names): array
{
$abbrevs = [];
foreach ($names as $name) {
for ($len = \strlen($name); $len > 0; --$len) {
$abbrev = substr($name, 0, $len);
$abbrevs[$abbrev][] = $name;
}
}
return $abbrevs;
}
public function renderThrowable(\Throwable $e, OutputInterface $output): void
{
$output->writeln('', OutputInterface::VERBOSITY_QUIET);
$this->doRenderThrowable($e, $output);
if (null !== $this->runningCommand) {
$output->writeln(sprintf('<info>%s</info>', OutputFormatter::escape(sprintf($this->runningCommand->getSynopsis(), $this->getName()))), OutputInterface::VERBOSITY_QUIET);
$output->writeln('', OutputInterface::VERBOSITY_QUIET);
}
}
protected function doRenderThrowable(\Throwable $e, OutputInterface $output): void
{
do {
$message = trim($e->getMessage());
if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
$class = get_debug_type($e);
$title = sprintf(' [%s%s] ', $class, 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : '');
$len = Helper::width($title);
} else {
$len = 0;
}
if (str_contains($message, "@anonymous\0")) {
$message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', fn ($m) => class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0], $message);
}
$width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : \PHP_INT_MAX;
$lines = [];
foreach ('' !== $message ? preg_split('/\r?\n/', $message) : [] as $line) {
foreach ($this->splitStringByWidth($line, $width - 4) as $line) {
// pre-format lines to get the right string length
$lineLength = Helper::width($line) + 4;
$lines[] = [$line, $lineLength];
$len = max($lineLength, $len);
}
}
$messages = [];
if (!$e instanceof ExceptionInterface || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
$messages[] = sprintf('<comment>%s</comment>', OutputFormatter::escape(sprintf('In %s line %s:', basename($e->getFile()) ?: 'n/a', $e->getLine() ?: 'n/a')));
}
$messages[] = $emptyLine = sprintf('<error>%s</error>', str_repeat(' ', $len));
if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
$messages[] = sprintf('<error>%s%s</error>', $title, str_repeat(' ', max(0, $len - Helper::width($title))));
}
foreach ($lines as $line) {
$messages[] = sprintf('<error> %s %s</error>', OutputFormatter::escape($line[0]), str_repeat(' ', $len - $line[1]));
}
$messages[] = $emptyLine;
$messages[] = '';
$output->writeln($messages, OutputInterface::VERBOSITY_QUIET);
if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
$output->writeln('<comment>Exception trace:</comment>', OutputInterface::VERBOSITY_QUIET);
// exception related properties
$trace = $e->getTrace();
array_unshift($trace, [
'function' => '',
'file' => $e->getFile() ?: 'n/a',
'line' => $e->getLine() ?: 'n/a',
'args' => [],
]);
for ($i = 0, $count = \count($trace); $i < $count; ++$i) {
$class = $trace[$i]['class'] ?? '';
$type = $trace[$i]['type'] ?? '';
$function = $trace[$i]['function'] ?? '';
$file = $trace[$i]['file'] ?? 'n/a';
$line = $trace[$i]['line'] ?? 'n/a';
$output->writeln(sprintf(' %s%s at <info>%s:%s</info>', $class, $function ? $type.$function.'()' : '', $file, $line), OutputInterface::VERBOSITY_QUIET);
}
$output->writeln('', OutputInterface::VERBOSITY_QUIET);
}
} while ($e = $e->getPrevious());
}
/**
* Configures the input and output instances based on the user arguments and options.
*
* @return void
*/
protected function configureIO(InputInterface $input, OutputInterface $output)
{
if (true === $input->hasParameterOption(['--ansi'], true)) {
$output->setDecorated(true);
} elseif (true === $input->hasParameterOption(['--no-ansi'], true)) {
$output->setDecorated(false);
}
if (true === $input->hasParameterOption(['--no-interaction', '-n'], true)) {
$input->setInteractive(false);
}
switch ($shellVerbosity = (int) getenv('SHELL_VERBOSITY')) {
case -1:
$output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
break;
case 1:
$output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
break;
case 2:
$output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE);
break;
case 3:
$output->setVerbosity(OutputInterface::VERBOSITY_DEBUG);
break;
default:
$shellVerbosity = 0;
break;
}
if (true === $input->hasParameterOption(['--quiet', '-q'], true)) {
$output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
$shellVerbosity = -1;
} else {
if ($input->hasParameterOption('-vvv', true) || $input->hasParameterOption('--verbose=3', true) || 3 === $input->getParameterOption('--verbose', false, true)) {
$output->setVerbosity(OutputInterface::VERBOSITY_DEBUG);
$shellVerbosity = 3;
} elseif ($input->hasParameterOption('-vv', true) || $input->hasParameterOption('--verbose=2', true) || 2 === $input->getParameterOption('--verbose', false, true)) {
$output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE);
$shellVerbosity = 2;
} elseif ($input->hasParameterOption('-v', true) || $input->hasParameterOption('--verbose=1', true) || $input->hasParameterOption('--verbose', true) || $input->getParameterOption('--verbose', false, true)) {
$output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
$shellVerbosity = 1;
}
}
if (-1 === $shellVerbosity) {
$input->setInteractive(false);
}
if (\function_exists('putenv')) {
@putenv('SHELL_VERBOSITY='.$shellVerbosity);
}
$_ENV['SHELL_VERBOSITY'] = $shellVerbosity;
$_SERVER['SHELL_VERBOSITY'] = $shellVerbosity;
}
/**
* Runs the current command.
*
* If an event dispatcher has been attached to the application,
* events are also dispatched during the life-cycle of the command.
*
* @return int 0 if everything went fine, or an error code
*/
protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
{
foreach ($command->getHelperSet() as $helper) {
if ($helper instanceof InputAwareInterface) {
$helper->setInput($input);
}
}
$commandSignals = $command instanceof SignalableCommandInterface ? $command->getSubscribedSignals() : [];
if ($commandSignals || $this->dispatcher && $this->signalsToDispatchEvent) {
if (!$this->signalRegistry) {
throw new RuntimeException('Unable to subscribe to signal events. Make sure that the "pcntl" extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.');
}
if (Terminal::hasSttyAvailable()) {
$sttyMode = shell_exec('stty -g');
foreach ([\SIGINT, \SIGTERM] as $signal) {
$this->signalRegistry->register($signal, static fn () => shell_exec('stty '.$sttyMode));
}
}
if ($this->dispatcher) {
// We register application signals, so that we can dispatch the event
foreach ($this->signalsToDispatchEvent as $signal) {
$event = new ConsoleSignalEvent($command, $input, $output, $signal);
$this->signalRegistry->register($signal, function ($signal) use ($event, $command, $commandSignals) {
$this->dispatcher->dispatch($event, ConsoleEvents::SIGNAL);
$exitCode = $event->getExitCode();
// If the command is signalable, we call the handleSignal() method
if (\in_array($signal, $commandSignals, true)) {
$exitCode = $command->handleSignal($signal, $exitCode);
// BC layer for Symfony <= 5
if (null === $exitCode) {
trigger_deprecation('symfony/console', '6.3', 'Not returning an exit code from "%s::handleSignal()" is deprecated, return "false" to keep the command running or "0" to exit successfully.', get_debug_type($command));
$exitCode = 0;
}
}
if (false !== $exitCode) {
exit($exitCode);
}
});
}
// then we register command signals, but not if already handled after the dispatcher
$commandSignals = array_diff($commandSignals, $this->signalsToDispatchEvent);
}
foreach ($commandSignals as $signal) {
$this->signalRegistry->register($signal, function (int $signal) use ($command): void {
$exitCode = $command->handleSignal($signal);
// BC layer for Symfony <= 5
if (null === $exitCode) {
trigger_deprecation('symfony/console', '6.3', 'Not returning an exit code from "%s::handleSignal()" is deprecated, return "false" to keep the command running or "0" to exit successfully.', get_debug_type($command));
$exitCode = 0;
}
if (false !== $exitCode) {
exit($exitCode);
}
});
}
}
if (null === $this->dispatcher) {
return $command->run($input, $output);
}
// bind before the console.command event, so the listeners have access to input options/arguments
try {
$command->mergeApplicationDefinition();
$input->bind($command->getDefinition());
} catch (ExceptionInterface) {
// ignore invalid options/arguments for now, to allow the event listeners to customize the InputDefinition
}
$event = new ConsoleCommandEvent($command, $input, $output);
$e = null;
try {
$this->dispatcher->dispatch($event, ConsoleEvents::COMMAND);
if ($event->commandShouldRun()) {
$exitCode = $command->run($input, $output);
} else {
$exitCode = ConsoleCommandEvent::RETURN_CODE_DISABLED;
}
} catch (\Throwable $e) {
$event = new ConsoleErrorEvent($input, $output, $e, $command);
$this->dispatcher->dispatch($event, ConsoleEvents::ERROR);
$e = $event->getError();
if (0 === $exitCode = $event->getExitCode()) {
$e = null;
}
}
$event = new ConsoleTerminateEvent($command, $input, $output, $exitCode);
$this->dispatcher->dispatch($event, ConsoleEvents::TERMINATE);
if (null !== $e) {
throw $e;
}
return $event->getExitCode();
}
/**
* Gets the name of the command based on input.
*/
protected function getCommandName(InputInterface $input): ?string
{
return $this->singleCommand ? $this->defaultCommand : $input->getFirstArgument();
}
/**
* Gets the default input definition.
*/
protected function getDefaultInputDefinition(): InputDefinition
{
return new InputDefinition([
new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'),
new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display help for the given command. When no command is given display help for the <info>'.$this->defaultCommand.'</info> command'),
new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message'),
new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'),
new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version'),
new InputOption('--ansi', '', InputOption::VALUE_NEGATABLE, 'Force (or disable --no-ansi) ANSI output', null),
new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question'),
]);
}
/**
* Gets the default commands that should always be available.
*
* @return Command[]
*/
protected function getDefaultCommands(): array
{
return [new HelpCommand(), new ListCommand(), new CompleteCommand(), new DumpCompletionCommand()];
}
/**
* Gets the default helper set with the helpers that should always be available.
*/
protected function getDefaultHelperSet(): HelperSet
{
return new HelperSet([
new FormatterHelper(),
new DebugFormatterHelper(),
new ProcessHelper(),
new QuestionHelper(),
]);
}
/**
* Returns abbreviated suggestions in string format.
*/
private function getAbbreviationSuggestions(array $abbrevs): string
{
return ' '.implode("\n ", $abbrevs);
}
/**
* Returns the namespace part of the command name.
*
* This method is not part of public API and should not be used directly.
*/
public function extractNamespace(string $name, int $limit = null): string
{
$parts = explode(':', $name, -1);
return implode(':', null === $limit ? $parts : \array_slice($parts, 0, $limit));
}
/**
* Finds alternative of $name among $collection,
* if nothing is found in $collection, try in $abbrevs.
*
* @return string[]
*/
private function findAlternatives(string $name, iterable $collection): array
{
$threshold = 1e3;
$alternatives = [];
$collectionParts = [];
foreach ($collection as $item) {
$collectionParts[$item] = explode(':', $item);
}
foreach (explode(':', $name) as $i => $subname) {
foreach ($collectionParts as $collectionName => $parts) {
$exists = isset($alternatives[$collectionName]);
if (!isset($parts[$i]) && $exists) {
$alternatives[$collectionName] += $threshold;
continue;
} elseif (!isset($parts[$i])) {
continue;
}
$lev = levenshtein($subname, $parts[$i]);
if ($lev <= \strlen($subname) / 3 || '' !== $subname && str_contains($parts[$i], $subname)) {
$alternatives[$collectionName] = $exists ? $alternatives[$collectionName] + $lev : $lev;
} elseif ($exists) {
$alternatives[$collectionName] += $threshold;
}
}
}
foreach ($collection as $item) {
$lev = levenshtein($name, $item);
if ($lev <= \strlen($name) / 3 || str_contains($item, $name)) {
$alternatives[$item] = isset($alternatives[$item]) ? $alternatives[$item] - $lev : $lev;
}
}
$alternatives = array_filter($alternatives, fn ($lev) => $lev < 2 * $threshold);
ksort($alternatives, \SORT_NATURAL | \SORT_FLAG_CASE);
return array_keys($alternatives);
}
/**
* Sets the default Command name.
*
* @return $this
*/
public function setDefaultCommand(string $commandName, bool $isSingleCommand = false): static
{
$this->defaultCommand = explode('|', ltrim($commandName, '|'))[0];
if ($isSingleCommand) {
// Ensure the command exist
$this->find($commandName);
$this->singleCommand = true;
}
return $this;
}
/**
* @internal
*/
public function isSingleCommand(): bool
{
return $this->singleCommand;
}
private function splitStringByWidth(string $string, int $width): array
{
// str_split is not suitable for multi-byte characters, we should use preg_split to get char array properly.
// additionally, array_slice() is not enough as some character has doubled width.
// we need a function to split string not by character count but by string width
if (false === $encoding = mb_detect_encoding($string, null, true)) {
return str_split($string, $width);
}
$utf8String = mb_convert_encoding($string, 'utf8', $encoding);
$lines = [];
$line = '';
$offset = 0;
while (preg_match('/.{1,10000}/u', $utf8String, $m, 0, $offset)) {
$offset += \strlen($m[0]);
foreach (preg_split('//u', $m[0]) as $char) {
// test if $char could be appended to current line
if (mb_strwidth($line.$char, 'utf8') <= $width) {
$line .= $char;
continue;
}
// if not, push current line to array and make new line
$lines[] = str_pad($line, $width);
$line = $char;
}
}
$lines[] = \count($lines) ? str_pad($line, $width) : $line;
mb_convert_variables($encoding, 'utf8', $lines);
return $lines;
}
/**
* Returns all namespaces of the command name.
*
* @return string[]
*/
private function extractAllNamespaces(string $name): array
{
// -1 as third argument is needed to skip the command short name when exploding
$parts = explode(':', $name, -1);
$namespaces = [];
foreach ($parts as $part) {
if (\count($namespaces)) {
$namespaces[] = end($namespaces).':'.$part;
} else {
$namespaces[] = $part;
}
}
return $namespaces;
}
private function init(): void
{
if ($this->initialized) {
return;
}
$this->initialized = true;
foreach ($this->getDefaultCommands() as $command) {
$this->add($command);
}
}
}
We have trained our AI Chat Bots with the knowledge of industry experts and conversion experts so you can be sure it knows how to do its job and answer all your questions instantly and provide requested information
AI Content Generation
Create amazing content 10X faster
Wordfairy can help you with a variety of writing tasks, from writing blog post, creating better resumes and job descriptions to composing emails and social media content, and many more. With 70+ templates, we can save you time and improve your writing skills.
AI Image Creation
Use AI to create any art or image
Are you looking for a tool to help you create unique beautiful artwork and images quickly and easily? Look no further! Our AI-powered software makes it simple to generate high-quality art and images with just a few clicks. With our intuitive interface and powerful technology, you can create stunning visuals in minutes instead of hours.
AI Voiceover Synthesize
Make studio-quality voiceovers in minutes
Truly human emotions in every voice over generated, breathing life into your voice overs. Our AI voices have elements that make a voice sound NATURAL and have all the expressions and tone inflections that are needed to make people more engaged in your content
AI Speech to Text Transcribe
Transcribe accurately your audio
Accurately transcribe audio content in various formats. Enable transcription of your audio files in multiple languages, as well as translation from those languages into English.
AI Code Generation
Write code like a Pro
Generate complex algorithms simply by using natural language to explain what you are after, we will take care rest for you. Write code like Pro in Python, Flutter, PHP, JavaScript, Ruby and other programming languages.
Think Big, Task Easy
Customers Using Incus Have Experienced:
90%
Time Reduced In Task
4x
Increase In Visibility
60%
Increase In Revenue
Select a Task
Choose from a variety of writing skills trained on industry best-practices
Ads
Create ads much faster and be more creative
Clickbait Titles
Create a creative clickbait titles for your products
Pro
Ad Headlines
Write an attention grabbing ad headlines
Blog Posts
Content for the generating articles, blog post
Blog Titles
Nobody wants to read boring blog titles, generate catchy blog titles with this tool
Blog Section
Write a full blog section (few paragraphs) about a subheading of your article
Blog Ideas
The perfect tool to start writing great articles. Generate creative ideas for your next post
Blog Intros
Write an intro that will entice your visitors to read more about your article
Blog Conclusion
End your blog articles with an engaging conclusion paragraph
Contents
Tools for writing creatives for different moods and tasks
Article Generator
Turn a title and outline text into a fully complete high quality article within seconds
Content Rewriter
Take a piece of content and rewrite it to make it more interesting, creative, and engaging
Paragraph Generator
Generate paragraphs about any topic including a keyword and in a specific tone of voice
Talking Points
Write short, simple and informative points for the subheadings of your article
Pros & Cons
Write the pros and cons of a product, service or website for your blog article
Summarize Text
Summarize any text in a short and easy to understand concise way
Product Description
Write the description about your product and why it worth it
Startup Name Generator
Generate cool, creative, and catchy names for your startup in seconds
Product Name Generator
Create creative product names from examples words
Academic Essay
Create creative academic essays for various subjects just in a second
Creative Stories
Allow AI to generate creative stories for you based on input text
Grammar Checker
Make sure that there are no errors in your content
Summarize for 2nd Grader
Summarize any complex content for a 2nd grader child
Text Extender
Extend your sentences with more description and additional information
Rewrite with Keywords
Rewrite your existing content with including specific keywords
Business Ideas
Generate business ideas based on your keywords and description
Tone Changer
Change the tone of your writing to match your audience
Dictionary
Use a dictionary to find all details of your word
Privacy Policy
Develop a privacy policy information for your organization
Terms and Conditions
Develop a terms and conditions information for your organization
Ecommerce
Powerful tools for e-commerce, listings of your products
Great AI tool to use for academic essay writing and summarising texts!
Josh P
UK
5
Absolutely blown away with the quality of the writing that the AI provides and all the different features, one of the best i've used by far.
Laura S
UK
5
Using this for university and its made my life so much easier!
Tom W
UK
5
Really impressed with everything thats offered by the price!
Sarah
UK
5
Used this when I had a writers block and wow! one of the best features is being able to change the writing tone and style of each text.
Peter Scott
UK
5
An absolute dream for an assignment that I had due. I was skeptical at first, but after seeing my grades go up I use wordfairy for all of my coursework.
John Cross
UK
5
Woohoo! Word Fairy AI just sprinkled some serious writing magic in my life! It's like having a personal writing assistant that never sleeps.
Tim
UK
5
I'm not exaggerating when I say Word Fairy AI is the Dumbledore of writing tools. It's like having a magical professor guiding me through the writing process. I was skeptical at firstβit's AI after all, right? But boy, was I proven wrong!
Kira Brown
UK
5
Finally met my writing soulmate! Word Fairy AI has become my brainstorm buddy, my grammar guru, and my secret weapon in the writing world. Its artificial intelligence beams with brilliance, offering word choices I'd never even think of!
Rob
UK
5
Writing just got a major upgrade, thanks to Word Fairy AI! It's like having a pocket-sized Shakespeare with impeccable grammar skills! This clever tool turns my writing foes into friends, fixing those sneaky typos and suggesting ways to improve clarity.
Bill
UK
5
Word Fairy AI is a total game-changer! It's like having a writing superhero by my side, guiding me through every paragraph. It spins my ideas into engaging content effortlessly.
Carol K
UK
5
Wow, Word Fairy AI has turned me into a wordsmith extraordinaire! I used to struggle with writer's block, but with this incredible writing tool, ideas flow like a river.
Rafique
UK
5
Prepare to be mind-blown by Word Fairy AI! This brilliant tool is my secret weapon in the battle against dull content. It sprinkles captivating phrases and catchy headlines all over my writing. Breath-taking AI-powered magic at its best.
Bella
UK
5
Wowza! Word Fairy AI is the writing genie I never knew I needed! With just a few clicks, it conjures up impeccable sentences and helps structure my thoughts flawlessly. Writing, editing, and proofreading have become a breeze.
Antonio
UK
5
This brilliant tool sprinkles dazzling vocabulary and grammar skills into your work, making it shine like a supernova. No more worrying about errors or boring content.
Jenny
UK
5
This baby corrects my clumsy wording, suggests better sentence structures, and even helps me find the perfect synonyms to spice things up. Seriously, if you've ever struggled with writing, let the Word Fairy AI work its magic for you!"
Iris
UK
5
t's like having a personal coach, pushing me towards better writing. Whether I'm composing a professional email or a creative masterpiece, this tool sprinkles linguistic fairy dust on every word. If you're tired of mediocre writing, make Word Fairy AI your new BFF!
Chen
UK
5
My productivity and creativity have hit the stratosphere thanks to this incredible AI. Prepare yourself for word wizardry!
Sumaya
UK
5
Seriously, where has this little AI genius been all my life? Writing projects have become a breeze, and my work is so much more polished now. Word Fairy AI, you've earned your wings in my heart!
Ellie
UK
5
Thanks to this genius AI, my writing has soared to new heights! I can't wait to see what magical stories we'll create together next!
Adam G
USA
5
Great AI tool to use for academic essay writing and summarising texts!
Josh P
UK
5
Absolutely blown away with the quality of the writing that the AI provides and all the different features, one of the best i've used by far.
Laura S
UK
5
Using this for university and its made my life so much easier!
Tom W
UK
5
Really impressed with everything thats offered by the price!
Sarah
UK
5
Used this when I had a writers block and wow! one of the best features is being able to change the writing tone and style of each text.
Peter Scott
UK
5
An absolute dream for an assignment that I had due. I was skeptical at first, but after seeing my grades go up I use wordfairy for all of my coursework.
John Cross
UK
5
Woohoo! Word Fairy AI just sprinkled some serious writing magic in my life! It's like having a personal writing assistant that never sleeps.
Tim
UK
5
I'm not exaggerating when I say Word Fairy AI is the Dumbledore of writing tools. It's like having a magical professor guiding me through the writing process. I was skeptical at firstβit's AI after all, right? But boy, was I proven wrong!
Kira Brown
UK
5
Finally met my writing soulmate! Word Fairy AI has become my brainstorm buddy, my grammar guru, and my secret weapon in the writing world. Its artificial intelligence beams with brilliance, offering word choices I'd never even think of!
Rob
UK
5
Writing just got a major upgrade, thanks to Word Fairy AI! It's like having a pocket-sized Shakespeare with impeccable grammar skills! This clever tool turns my writing foes into friends, fixing those sneaky typos and suggesting ways to improve clarity.
Bill
UK
5
Word Fairy AI is a total game-changer! It's like having a writing superhero by my side, guiding me through every paragraph. It spins my ideas into engaging content effortlessly.
Carol K
UK
5
Wow, Word Fairy AI has turned me into a wordsmith extraordinaire! I used to struggle with writer's block, but with this incredible writing tool, ideas flow like a river.
Rafique
UK
5
Prepare to be mind-blown by Word Fairy AI! This brilliant tool is my secret weapon in the battle against dull content. It sprinkles captivating phrases and catchy headlines all over my writing. Breath-taking AI-powered magic at its best.
Bella
UK
5
Wowza! Word Fairy AI is the writing genie I never knew I needed! With just a few clicks, it conjures up impeccable sentences and helps structure my thoughts flawlessly. Writing, editing, and proofreading have become a breeze.
Antonio
UK
5
This brilliant tool sprinkles dazzling vocabulary and grammar skills into your work, making it shine like a supernova. No more worrying about errors or boring content.
Jenny
UK
5
This baby corrects my clumsy wording, suggests better sentence structures, and even helps me find the perfect synonyms to spice things up. Seriously, if you've ever struggled with writing, let the Word Fairy AI work its magic for you!"
Iris
UK
5
t's like having a personal coach, pushing me towards better writing. Whether I'm composing a professional email or a creative masterpiece, this tool sprinkles linguistic fairy dust on every word. If you're tired of mediocre writing, make Word Fairy AI your new BFF!
Chen
UK
5
My productivity and creativity have hit the stratosphere thanks to this incredible AI. Prepare yourself for word wizardry!
Sumaya
UK
5
Seriously, where has this little AI genius been all my life? Writing projects have become a breeze, and my work is so much more polished now. Word Fairy AI, you've earned your wings in my heart!
Ellie
UK
5
Thanks to this genius AI, my writing has soared to new heights! I can't wait to see what magical stories we'll create together next!
Frequently Asked Questions
Got Questions? We have you covered
We are always here to provide full support and clear any doubts that you might have
What Is WordFairy AI?
Word Fairy AI is an advanced artificial intelligence writing tool designed to assist writers in creating high-quality and engaging content. Equipped with state-of-the-art algorithms, this innovative tool offers unparalleled writing guidance and support.
With Word Fairy AI, users can expect an intelligent and efficient writing partner that can generate ideas, provide grammar and spelling suggestions, and help structure essays, articles, or any written work. By leveraging the power of AI, this tool harnesses vast amounts of data and knowledge to deliver accurate and contextually relevant recommendations, saving writers valuable time and effort.
Gone are the days of struggling with writer's block or spending hours on end trying to perfect a sentence or paragraph. Word Fairy AI acts as a virtual mentor, offering creative inspiration and guiding users with well-crafted suggestions tailored to their specific writing needs. Whether you're an aspiring writer, a student, or a seasoned professional, this writing tool is your ultimate companion in the journey of crafting impeccable content.
Does Wordfairy AI Offer A Free Trial?
Absolutely! Word Fairy AI offers a free sign up and trail of 1000 words for you to see all of our different features and test out our custom AI software. We're certain that you will be blown away with how advanced and customised our software is.
What Is The Word Fairy AI Referral Scheme
Do you know anyone who can benefit from Word Fairy AI? Refer a friend and we will give you 50% of the value of the first month of their subscription in the form of a digital amazon voucher. Get in touch with us at admin@wordfairy.ai for more details!
How Does Word Fairy AI Work?
Equipped with cutting-edge algorithms, Word Fairy AI assists users in generating engaging and persuasive content across various genres and formats. From blog posts and marketing copy to academic papers and creative writing, this tool adapts to the specific writing style and requirements of each user, providing invaluable suggestions to enhance coherence, clarity, and overall impact.
What sets Word Fairy AI apart is its ability to learn and adapt to individual preferences and writing goals. As users interact with the tool, it gradually tailors its suggestions based on their writing patterns and preferences. This personalized approach ensures that each user receives the most relevant and helpful recommendations throughout their writing journey.
By leveraging the vast knowledge and deep understanding of language encoded within its algorithms, Word Fairy AI enables writers to express their ideas with precision and eloquence. From grammar and spelling corrections to insightful vocabulary suggestions, this tool acts as a virtual writing tutor, providing continuous feedback and support to help users reach their full potential.
How Are Texts Generated For The Same Answer Different?
What sets Word Fairy AI apart is its ability to analyze the context and purpose of the writing, generating tailored suggestions that resonate with the intended audience. By considering factors such as genre, tone, and target audience, this tool guides users toward crafting content that captivates and engages readers, making every written piece a masterpiece.
Furthermore, Word Fairy AI acts as a platform for continuous growth and improvement. By analyzing the writing patterns and preferences of each user, this tool learns and adapts, delivering increasingly accurate and contextually relevant suggestions as users interact with it more frequently. This personalized approach guarantees that each individual's unique style and voice shine through, fostering a sense of authenticity in every written work.
With its vast knowledge database and intricate understanding of language nuances, Word Fairy AI offers comprehensive writing support at users' fingertips. From instantaneous grammar checks to insightful vocabulary suggestions, this tool inspires users to push the boundaries of their writing abilities and enables them to create compelling and impactful content that resonates with their intended audience.
This means that even if the same question for the same topic is asked 100 times, there will be 100 unique and completely different answers with no similarities.
How Is Word Fairy AI Different From Chat GPT?
Word Fairy AI is distinct from Chat GPT in terms of its primary function and purpose. While Chat GPT is mainly designed to engage in conversational interactions and provide responses like a chatbot, Word Fairy AI focuses predominantly on enhancing the writing capabilities of its users. With a range of advanced language models and text generation algorithms, Word Fairy AI aims to assist individuals in crafting high-quality written content for various purposes, such as articles, reports, blog posts, or creative writing. By leveraging it's powerful AI technology, Word Fairy AI can provide users with intelligent suggestions, grammar corrections, and insightful recommendations to refine their writing skills and create compelling textual compositions.
Can I Use Word Fairy For My University Assignments?
Yes, you can definitely use Word Fairy for your university assignments. Word Fairy AI is an advanced artificial intelligence writing tool designed to assist users in creating well-written and professional documents. Its powerful features, such as grammar and spell-check, suggest improvements, and content enhancement, make it an ideal tool for academic writing.
Word Fairy AI ensures that your assignments are free from grammatical errors, typos, and awkward phrasing. This tool not only helps you proofread your work but also offers suggestions for improving sentence structure, vocabulary usage, and overall coherence. It acts as a virtual writing assistant, providing valuable feedback to enhance the quality of your assignments.
Moreover, Word Fairy AI saves you time and effort by automating tedious tasks such as citations and bibliography formatting. With its comprehensive database of citation styles, including APA, MLA, and Chicago, you can be confident that your references are accurately formatted. This allows you to focus more on the content of your assignments, ensuring it meets the high academic standards set by your university.
It is important to note that while Word Fairy AI assists and streamlines the writing process, it is still your responsibility as a student to ensure the integrity of your work. The tool's primary purpose is to enhance your writing skills and provide suggestions, but ultimately, you must ensure that the content and ideas presented in your assignments are original and properly cited.
In summary, Word Fairy AI is an invaluable tool for your university assignments. It provides a range of features designed to improve your writing, enhance the quality of your work, and save you time. By using Word Fairy AI, you can confidently submit well-written and professional assignments that meet the academic standards of your university.
I Still Have Questions
No Problem at all! Please feel free to get in touch with us at admin@wordfairy.ai and we would be more than happy to help
Facebook Ads
Write Facebook ads that engage your audience and deliver a high conversion rate
Instagram Captions
Grab attention with catchy captions for your Instagram posts
Instagram Hashtags Generator
Find the best hashtags to use for your Instagram posts
Social Media Post (Personal)
Write a social media post for yourself to be published on any platform
Social Media Post (Business)
Write a post for your business to be published on any social media platform
Facebook Headlines
Write catchy and convincing headlines to make your Facebook Ads stand out
Google Ads Headlines
Write catchy 30-character headlines to promote your product with Google Ads
Google Ads Description
Write a Google Ads description that makes your ad stand out and generates leads
LinkedIn Posts
Create an interesting linkedin post with the help of AI
Twitter Tweets
Generate an interesting twitter tweets with AI
LinkedIn Ad Headlines
Attention-grabbing, click-inducing and high-converting ad headlines for LinkedIn
LinkedIn Ad Descriptions
Professional and eye-catching ad descriptions that will make your product shine