{"record":{"id":"b402ed797e59fdda","repo":"yamadashy/repomix","slug":"config-file-not-found-at-argconfigpath","errorCode":null,"errorMessage":"Config file not found at ${argConfigPath}","messagePattern":"Config file not found at (.+?)","errorType":"exception","errorClass":"RepomixError","httpStatus":null,"severity":"error","filePath":"src/config/configLoad.ts","lineNumber":103,"sourceCode":"export const loadFileConfig = async (\n  rootDir: string,\n  argConfigPath: string | null,\n  options: { skipLocalConfig?: boolean; skipGlobalConfig?: boolean } = {},\n  deps = {\n    jitiImport: defaultJitiImport,\n  },\n): Promise<RepomixConfigFile> => {\n  if (argConfigPath) {\n    // Explicit --config flag is always respected (user's intentional choice)\n    const fullPath = path.resolve(rootDir, argConfigPath);\n    logger.trace('Loading local config from:', fullPath);\n\n    const isLocalFileExists = await checkFileExists(fullPath);\n\n    if (isLocalFileExists) {\n      return await loadAndValidateConfig(fullPath, deps);\n    }\n    throw new RepomixError(`Config file not found at ${argConfigPath}`);\n  }\n\n  // Try to find a local config file using the priority order\n  const localConfigPath = await findLocalConfigPath(rootDir);\n\n  if (localConfigPath) {\n    if (!options.skipLocalConfig) {\n      return await loadAndValidateConfig(localConfigPath, deps);\n    }\n    // Log when config files are skipped for security (remote mode)\n    logger.note(\n      `Skipping config file found in remote repository for security: ${path.basename(localConfigPath)}\\n` +\n        'Use --remote-trust-config to trust and load it.',\n    );\n  }\n\n  // Try to find a global config file using the priority order. skipGlobalConfig\n  // (set for untrusted-agent contexts like --sandbox) skips it too: even the","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/yamadashy/repomix/blob/f465ad909315a22120636baf03fa5e28701a50cb/src/config/configLoad.ts#L85-L121","documentation":"loadFileConfig throws this when an explicit --config path is given, the path is resolved against rootDir, and checkFileExists (fs.stat + isFile) finds no regular file there. The message echoes the argument as typed. Unlike the no-flag case (which silently falls back to local/global discovery and eventually defaults), an explicit --config is treated as the user's intentional choice, so a missing file is a hard error rather than a fallback.","triggerScenarios":"`repomix --config path/to/repomix.config.json` where the resolved path does not exist, is a directory instead of a file, or has a typo'd filename/extension. Also occurs when passing a relative path from the wrong working directory, since it's resolved against rootDir.","commonSituations":"Typo in the config filename or extension; passing a path relative to the wrong cwd in scripts/CI; file deleted or renamed after a version change; passing a directory path; Windows/POSIX path separator confusion in scripts.","solutions":["Verify the path exists and is a file: `ls -la <path>` or `test -f <path> && echo ok`.","Use an absolute path with --config to avoid cwd/rootDir resolution surprises.","Check the filename against supported names/extensions: repomix.config.{ts,mts,cts,js,mjs,cjs,json5,jsonc,json}.","Fix scripts/CI to cd into the project root (or pass paths relative to it) before invoking repomix."],"exampleFix":"# before\nrepomix --config ./configs/repomix.json   # file is actually repomix.config.json\n\n# after\nrepomix --config \"$PWD/configs/repomix.config.json\"","handlingStrategy":"validation","validationCode":"import fs from 'node:fs/promises';\nimport path from 'node:path';\nconst fullPath = path.resolve(rootDir, argConfigPath);\nconst st = await fs.stat(fullPath).catch(() => null);\nif (!st?.isFile()) {\n  throw new Error(`--config target not found or not a file: ${fullPath}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runPack({ config: argConfigPath });\n} catch (e) {\n  if (e instanceof RepomixError && e.message.startsWith('Config file not found at')) {\n    console.error(`Check the path: ${e.message}; resolved against project root.`);\n  } else throw e;\n}","preventionTips":["Always pass absolute paths to --config in scripts and CI.","`cd` to the project root before invoking repomix with relative paths.","Use shell completion or `test -f \"$CONFIG\"` before running.","Standardize on repomix.config.json at the repo root to avoid ad-hoc paths."],"tags":["config","filesystem","cli","missing-file"],"backgroundTag":"config-file-not-found","analyzedSha":"f465ad909315a22120636baf03fa5e28701a50cb","analyzedAt":"2026-08-29T01:27:42.024Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}