{"record":{"id":"9ca849fe75b11fb1","repo":"phacility/phabricator","slug":"there-are-no-diviner-s-files-anywhere-beneath-t","errorCode":null,"errorMessage":"There are no Diviner '%s' files anywhere beneath the current directory. Use '%s' to specify a documentation book to generate.","messagePattern":"There are no Diviner '(.+?)' files anywhere beneath the current directory\\. Use '(.+?)' to specify a documentation book to generate\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/diviner/workflow/DivinerGenerateWorkflow.php","lineNumber":65,"sourceCode":"    $console = PhutilConsole::getConsole();\n    $console->writeErr($message.\"\\n\");\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $book = $args->getArg('book');\n    if ($book) {\n      $books = array($book);\n    } else {\n      $cwd = getcwd();\n      $this->log(pht('FINDING DOCUMENTATION BOOKS'));\n\n      $books = id(new FileFinder($cwd))\n        ->withType('f')\n        ->withSuffix('book')\n        ->find();\n\n      if (!$books) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            \"There are no Diviner '%s' files anywhere beneath the current \".\n            \"directory. Use '%s' to specify a documentation book to generate.\",\n            '.book',\n            '--book <book>'));\n      } else {\n        $this->log(pht('Found %s book(s).', phutil_count($books)));\n      }\n    }\n\n    foreach ($books as $book) {\n      $short_name = basename($book);\n\n      $this->log(pht('Generating book \"%s\"...', $short_name));\n      $this->generateBook($book, $args);\n      $this->log(pht('Completed generation of \"%s\".', $short_name).\"\\n\");\n    }\n  }","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/diviner/workflow/DivinerGenerateWorkflow.php#L47-L83","documentation":"`diviner generate` can either target an explicit book (`--book path/to/book.book`) or auto-discover books. In discovery mode it runs FileFinder from getcwd() looking for files with the `.book` suffix; if the finder returns nothing, this usage exception is thrown. It means there is no Diviner book configuration anywhere beneath the directory you ran the command in.","triggerScenarios":"Running `diviner generate` without `--book` from a directory whose subtree contains no `*.book` files. Typical when running from an arbitrary checkout that has no Diviner documentation configured.","commonSituations":"Running generate from the wrong working directory (e.g. `/` or `$HOME` instead of the project with a `.book` file); projects that never set up Diviner docs; renamed or deleted `.book` files after a repo reorganization.","solutions":["Run `diviner generate` from the directory that contains your `.book` file (or an ancestor of it)","Or point at it explicitly: `diviner generate --book path/to/book.book`","If the project has no book yet, create a minimal `.book` JSON file (name, root, title)"],"exampleFix":"# before (run from a directory with no .book beneath it)\ndiviner generate\n# after\ndiviner generate --book /path/to/project/docs/book.book","handlingStrategy":"validation","validationCode":"$books = id(new FileFinder(getcwd()))\n  ->withType('f')\n  ->withSuffix('book')\n  ->find();\nif (!$books) {\n  // No book beneath cwd: pass --book <path> explicitly instead of letting generate throw.\n  $args->getArg('book') || print('No .book files found; pass --book <path>'.\"\\n\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  $workflow->execute($args);\n} catch (PhutilArgumentUsageException $ex) {\n  fwrite(STDERR, $ex->getMessage().\"\\n\");\n  exit(1);\n}","preventionTips":["Run `diviner generate` from the project root that contains the .book file","Pin CI jobs to `--book <explicit-path>` so they do not depend on cwd","Commit the .book file and check its presence in CI before the docs job"],"tags":["diviner","cli","file-discovery","usage-error","phabricator"],"backgroundTag":"config-file-not-found","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}