Download the PHP package gregpriday/copy-tree without Composer
On this page you can find all versions of the php package gregpriday/copy-tree. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gregpriday/copy-tree
More information about gregpriday/copy-tree
Files in gregpriday/copy-tree
Package copy-tree
Short Description Copy a directory and its files to your clipboard.
License MIT
Homepage https://github.com/gregpriday/copy-tree
Informations about the package copy-tree
Copy a Directory and Its Files to Your Clipboard with Ctree
Note: This tool is designed exclusively for MacOS and is not compatible with other operating systems.
Ctree is a command-line utility that effortlessly copies the structure and contents of a local directory or GitHub repository to your clipboard. It formats the output specifically for use with AI assistants such as Claude, ChatGPT, and Gemini, making it ideal for code analysis, generation, and sharing.
Features
-
MacOS Integration:
Seamless clipboard operations using native tools (pbcopy
andosascript
). -
GitHub Integration:
Clone and cache GitHub repositories via URL for fast, offline access and updates. -
AI-Powered Capabilities:
- Intelligent File Filtering:
Use natural language descriptions to select relevant files. - Smart Filename Generation:
Automatically generate clear, hyphenated filenames for saved output based on content analysis.
- Intelligent File Filtering:
-
Flexible Directory Management:
- Dynamic Ruleset System:
Configure inclusion/exclusion rules with a powerful JSON format. - Multiple Rulesets & Auto-detection:
Define custom rulesets (e.g.,frontend.json
,backend.json
) or let Ctree auto-detect settings for common project types (Laravel, SvelteKit, etc.).
- Dynamic Ruleset System:
- Versatile Output Options:
- Copy directly to the clipboard.
- Save output to a file (with AI-generated names if desired).
- Display output in the console.
- Stream output for piping.
- Copy a reference to a temporary file (to work around clipboard limitations).
Prerequisites
- MacOS
- PHP 8.2 or higher
- Git (required for GitHub repository support)
- Composer
Installation
-
Install via Composer (globally):
-
Add Composer’s Global Bin to Your PATH:
Edit your~/.zshrc
or~/.bashrc
and add: -
(Optional) Configure AI Features:
Create a.env
file in~/.copytree/
and add your OpenAI credentials:Replace
your-api-key
andyour-org-id
with your actual values.
Quick Start
-
Copy the Current Directory:
-
Copy from a GitHub Repository:
- Use AI to Filter Files:
Workflows
Ctree is designed to integrate into various development processes. Detailed workflows are available for:
-
AI-Driven Design Workflow:
Iterate on web designs with SvelteKit, Tailwind CSS, and Claude. -
AI-Assisted Development Workflow:
Leverage AI for test-driven development, code generation, and managing large codebases. -
AI-Assisted Ruleset Creation Workflow:
Create and refine JSON-based rulesets with AI support. - AI-Powered Business Plan Development:
Develop comprehensive business plans with in-depth market research and operational documentation.
Advanced Usage
GitHub Integration
Ctree caches GitHub repositories in ~/.copytree/cache
for improved performance.
AI Features
Intelligent File Filtering
Filter files using natural language:
For more details, see AI Features Documentation.
Smart Filename Generation
Automatically generate descriptive filenames when saving output:
Output Options
-
Display in Console:
ctree --display
-
Save to File (AI-generated name):
ctree --output
-
Specify Output File:
ctree --output=my-output-file.txt
-
Stream Output (for piping):
ctree --stream
- Copy as Reference (temporary file):
ctree --as-reference
Git Filtering
Focus on changes with Git-based options:
These options are ideal for sharing recent changes or reviewing specific updates.
Ruleset System
Ctree’s flexible ruleset system lets you precisely control file selection:
-
Configuration:
Ctree creates a.ctree
directory in your project to store ruleset configurations. -
Multiple Named Rulesets:
Define and use custom rulesets (e.g.,frontend.json
,backend.json
). - Auto-detection:
Ctree auto-selects appropriate rulesets for recognized project types (e.g., Laravel, SvelteKit).
To use a custom ruleset, run:
For more details, see:
- Ruleset Examples
- Writing Rulesets
- Fields and Operations Reference
- Using Multiple Rulesets
Directory Structure
Ctree uses the following directory structure for configuration and output:
Contributing
Contributions are welcome! Please note that this project is MacOS-only. To contribute:
- Fork the repository.
- Create a feature branch.
- Make your changes.
- Submit a pull request.
Testing
Run the tests with:
Security
If you discover any security issues, please email [email protected] rather than using the issue tracker.
License
This project is licensed under the MIT License. See LICENSE.md for details.
All versions of copy-tree with dependencies
ext-fileinfo Version *
caseyamcl/guzzle_retry_middleware Version ^2.12
civicrm/gitignore Version ^1.2
czproject/git-php Version ^4.3
illuminate/support Version ^11.15
openai-php/client Version ^0.10.3
symfony/console Version ^6.0|^7.0
symfony/finder Version ^7.1
symfony/process Version ^6.0|^7.0