OneSource
OneSource

OneSource

Turn your codebase into AI context in one command.

BUILT FOR DEVELOPERS

Give AI the full picture.

OneSource is a local command-line tool that packages your codebase into a single .onesource file. A directory tree and selected file contents form clear, reusable AI context, with an estimated token count.

Token counts are estimates. Actual usage varies by model and tokenizer.

Three core features

Structured context

A filtered directory tree and clearly framed file blocks give AI both project structure and code. Set independent filtering rules for the tree when needed.

<file path="src/main.rs">

Local execution & filtering

Organize files locally. Default filters respect rules such as .gitignore and skip common sensitive, generated, and dependency paths. Review the output before sharing.

.gitignore · local

Reusable profiles

Save recurring scan settings in .onesourcerc and reuse them with named profiles. Override settings with command-line options whenever you need to.

.onesourcerc

02 / THE OUTPUT

Project structure meets source code.

Run onesource to create a file with a directory tree followed by the contents of each selected file. Clear file paths give AI the project background it needs to discuss issues and changes.

  • Directory tree: keep the relationships between files and folders.
  • File blocks: identify the source of every code section by path.
  • Token estimate: understand the approximate context size before sharing.
my-project.onesourceEXAMPLE OUTPUT
my-project/
├── Cargo.toml
└── src/
    └── main.rs

<file path="Cargo.toml">
[package]
name = "my-project"
</file>

<file path="src/main.rs">
fn main() {
    println!("Hello!");
}
</file>

03 / CONTROL YOUR CONTEXT

Bring only what you need.

SELECT

Include and exclude

Use include to select file types and exclude to omit unwanted paths. Exclusions take priority; the directory tree can also have its own filtering rules.

onesource -i "*.rs,*.toml" -x "legacy/"
PREVIEW

Preview before sharing

A dry run lists selected files and estimates tokens for the full output without creating a file. When ready, you can also copy the context directly to your clipboard.

onesource --dry-run
onesource --copy
REUSE

Keep settings with the project

Save named profiles for different tasks. Settings resolve in this order: command-line options → selected profile → built-in defaults.

onesource profile create backend -i "src/**"
onesource -p backend
EXPLAIN

Find out why a file is missing

The explain command reports content and tree decisions separately, including ignore rules, filters, size, and binary checks. Pass an actual file path to inspect its result.

onesource explain ./target
No 'default' profile in .onesourcerc, using CLI defaults.
════════════════════════════════════════
Path 1/1: ./target
  Content:
    Result: blocked by blacklist
    Rule: blacklist = target
  Tree:
    Result: blocked by blacklist
    Rule: blacklist = target
════════════════════════════════════════

04 / THE DETAILS

Predictable, with answers when you need them.

Default scan scope

Defaults skip files larger than 500 KiB and common paths such as .env, private keys, node_modules, and target. Size and binary checks decide whether content is attached, but do not remove paths from the directory tree.

Review before sharing

Default filters help skip common sensitive paths. Still check the output for secrets and content that should not be shared. File blocks are framing for AI readability, not a security boundary.

Read the full documentation ↗

05 / GET STARTED

Install OneSource. Give AI your project context.

Cargo

With Rust installed, install the free, MIT-licensed OneSource CLI using Cargo.

cargo install onesource

macOS / Linux

The installer downloads the latest release to /usr/local/bin and may request sudo permission.

curl -sSL https://raw.githubusercontent.com/TW-RF54732/onesource/main/install.sh | bash

Windows (PowerShell)

Run the installer in PowerShell, then restart your terminal to refresh PATH.

irm https://raw.githubusercontent.com/TW-RF54732/onesource/main/install.ps1 | iex

From project to AI context

Run these commands from your project directory. Preview the selected files first, then create a .onesource file or copy the context to your clipboard. Review the output before sharing it with AI.

Packaging runs locally; it does not upload your code. Token counts are estimates.

Download a portable binary ↗
onesource --dry-run
onesource
onesource --copy