Troubleshooting and limits

Follow checks, corrections and verification for installation, missing files, config migration and output errors.

Collect the symptom and current settings

This page starts from your own project, not a prepared demo. Preserve the failing command and its full error. Confirm whether the problem is finding OneSource, selecting files, loading config, writing output or copying. Use the relevant section below; changing unrelated flags can hide the real cause. For a bundling issue, record the scan root and working directory, then run the same command with --dry-run --show-arg and without --save/--replace/--copy.

Command
onesource --dry-run --show-arg

This uses your existing profile/default; append your original include/exclude/-p options when reproducing the problem. show-arg prints resolved settings after preview. If loading config itself fails, there will be no resolved settings; use the migration section. Preview still reads files, so inaccessible inputs can produce warnings.

Command not found, wrong version or permission denied

Check which executable is selected

On macOS/Linux:

Command
command -v onesource
onesource --version

On Windows PowerShell:

Command
Get-Command onesource
onesource --version

If no path is found, reopen the terminal after installation, then confirm the installation folder is on PATH. Portable executables can be run directly with ./onesource or .\onesource.exe from their folder. If a path is found but the version is unexpected, compare it with the binary you installed; correct PATH or invoke the intended path directly and verify again.

Check the kind of permission error

A manually downloaded Unix executable may need chmod +x onesource in its folder. Installation to /usr/local/bin may require sudo; use a writable user directory or Cargo if you cannot modify it. A bundling write error concerns the output parent, not executable permission: choose an existing writable output folder. For download failures, check GitHub/network/API limits and use the platform-specific release asset. After any reinstall, verify --version; the Unix installer does not fail fast on every command, so its completion banner is insufficient.

A file is missing or a warning appears

Choose one missing relative path, then explain it with the same profile and filters as your failing run. Replace the example path and options with yours:

Command
onesource explain src/main.rs -i "src/**"

Read Content Result and Rule. blocked by exclude requires narrowing exclude, not adding include. not included by include requires broadening include. blocked by ignore filters requires reviewing .gitignore/.ignore or a deliberate --no-ignore. blocked by blacklist requires inspecting the built-in Rule; keep real secrets excluded. A saved profile can supply any of these rules, so do not add --no-config to a diagnostic if the original command loaded configuration.

For size warnings, preserve the same limit:

Command
onesource explain src/main.rs -m 1

Read actual bytes in Rule; 1 KiB allows up to 1024 bytes. A NUL byte makes content binary; export text or leave it out rather than changing size. For unreadable results, inspect the metadata/read error, check access rights and broken links, then retry. Non-UTF-8 text is included with replacement characters: convert to UTF-8 first if exact text matters. Re-run the original preview after the correction, then inspect the saved bundle.

If a path is shown in Tree but not Content, they may have separate filters, or content may fail size/read/binary checks. Directory symlinks are not recursively followed; outside-root file symlinks are skipped. Non-UTF-8 filenames display lossily, so different names can look identical. Read the diagnostic walkthrough for a complete worked example.

Config fails to load: back up and migrate

If an error mentions an incompatible old format, open scan-root/.onesourcerc and make a backup copy outside the project before editing. A flat option object is the old shape:

Configuration example (JSON)
{
  "include": "src/**",
  "max_size": 100,
  "no_tree": true
}

Keep the same option values, but wrap them in a named profile. To preserve unnamed-run behavior, name it default:

Configuration example (JSON)
{
  "profiles": {
    "default": {
      "include": "src/**",
      "max_size": 100,
      "no_tree": true
    }
  }
}

Save valid JSON, with strings quoted, true/false unquoted, max_size numeric and no trailing commas. Now validate before saving other settings:

Command
onesource profile show default --json

Expect the inner object with the same three fields. Then verify the resulting selection:

Command
onesource --dry-run

Expect the default profile loaded and no tree. Files depend on your project’s src directory. If normal bundling must continue while you repair config, onesource --no-config --dry-run bypasses loading without modifying it. It does not repair it.

Invalid JSON or field types still require manual correction. Unknown fields may be ignored and then lost when rewritten. --no-config does not bypass management reads or --save reads; do not try to overwrite broken config through --save. For a missing named profile, check list or create it; for --replace without --save, either add --save intentionally or remove --replace. Avoid simultaneous config edits, since writes are not atomic.

Output directory or clipboard fails

For Output directory does not exist, remember that -o is relative to the current working directory, even if the scan root is elsewhere. Create the output folder first. From your project root, using a new folder name:

Command
mkdir bundles
onesource -o bundles/review.onesource --dry-run

Check the planned path, then run without dry-run. If permissions fail, select another existing writable folder. A previous output is preserved on render failure, but --save may already have changed configuration.

For clipboard initialization/flush failures, avoid --copy in remote or headless environments. Produce a file instead:

Command
onesource -o review.onesource

Expect Output saved to and inspect the text with an editor. If you previously included --dry-run --copy, no copy was attempted; remove dry-run only when the preview is correct and a clipboard is available. A stale clipboard can otherwise look like successful output.

Limits to account for after the fix

Selection and reading are separate steps; concurrent changes can affect output. Files are read whole; copy mode also buffers the complete bundle. Dry-run still reads and tokenizes. Token estimates are approximate. The blacklist is a fixed safeguard, not a complete secret detector. Output overwrites the chosen file after successful rendering; there is no confirmation prompt. Parent folders must exist. Normal output is a file or clipboard, not a stdout-only mode. There is no configuration inheritance, profile export command or recursive config discovery.

After resolving an issue, repeat the original preview, inspect the intended output and confirm the selected executable/config path. To recover from self-update failure use Updating; it has a different failure path from bundling.