{"id":30353205,"url":"https://github.com/permacommons/ccd","last_synced_at":"2026-01-20T17:37:47.501Z","repository":{"id":306363059,"uuid":"1024069567","full_name":"permacommons/ccd","owner":"permacommons","description":"Change Change Directory - use locate to quickly pick directories","archived":false,"fork":false,"pushed_at":"2025-08-01T06:28:03.000Z","size":437,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-01T08:52:44.790Z","etag":null,"topics":["bash","rust","shell","utility"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/permacommons.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-22T06:27:14.000Z","updated_at":"2025-08-01T06:28:07.000Z","dependencies_parsed_at":"2025-07-25T08:39:05.657Z","dependency_job_id":"3722b53b-11d7-4762-b986-3a3a19afdf91","html_url":"https://github.com/permacommons/ccd","commit_stats":null,"previous_names":["permacommons/ccd"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/permacommons/ccd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permacommons%2Fccd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permacommons%2Fccd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permacommons%2Fccd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permacommons%2Fccd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/permacommons","download_url":"https://codeload.github.com/permacommons/ccd/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permacommons%2Fccd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271088033,"owners_count":24697039,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","rust","shell","utility"],"created_at":"2025-08-19T01:33:34.286Z","updated_at":"2026-01-20T17:37:47.474Z","avatar_url":"https://github.com/permacommons.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ccd - Change Change Directory\n\nA fast, intelligent directory navigation tool that uses the `locate` database to quickly find and change to directories. Features frequency tracking and an interactive TUI for easy directory selection.\n\n`ccd` is a shell function that wraps a Rust tool called `ccd-pick`. First install `ccd-pick`, then use it to install the wrapper.\n\n![Animation showing core functionality](vhs.gif)\n\n## Features\n\n- **Fast search**: Uses the `locate` database for instant directory lookup\n- **Interactive mode**: Beautiful TUI interface for browsing and selecting directories\n- **Bookmarking**: Quickly add a directory to the \"frequently used\" list\n- **Frequency tracking**: Remembers and prioritizes frequently used directories selected via the TUI\n- **Smart sorting**: Results sorted by usage frequency, then by path length\n- **Keyboard navigation**: Full keyboard support for easy navigation\n- **Safe installation**: Automated installer with backup and update support\n- **Shell integration**: Properly changes the current shell's working directory\n\n## Installation\n\n### Quick Install\n\n1. Install the Rust binary to your PATH:\n\n   ```bash\n   cargo install ccd-pick\n   ```\n\n   Or, to build and install from the repository:\n\n   ```bash\n   cargo install --path . --locked\n   ```\n\n2. Ensure `~/.cargo/bin` is in your PATH (add to ~/.bashrc if needed):\n   ```bash\n   export PATH=\"$HOME/.cargo/bin:$PATH\"\n   ```\n\n3. Install the shell function to your ~/.bashrc:\n   ```bash\n   ccd-pick --install\n   ```\n\n4. Reload your shell configuration:\n   ```bash\n   source ~/.bashrc\n   ```\n\nThe `ccd-pick` search functionality will only work if `locate` is installed and working, and the\n`locate` index is up-to-date. It is typically provided via the `plocate` package, which replaces\nthe older `mlocate`, and the underlying database is usually regularly updated in the background\nvia the `updatedb` command.\n\n### Manual Installation\n\nIf you prefer manual installation, you can get the shell function and add it manually:\n```bash\n# Print the shell function\nccd-pick --printfn \u003e ccd_function.sh\n\n# Add this to your ~/.bashrc or ~/.zshrc\nsource /path/to/ccd_function.sh\n```\n\n## Usage\n\n### Interactive Mode (Recommended)\n```bash\n# Launch interactive directory picker\nccd\n```\n\n**Interactive Mode Controls:**\n- Type to search for directories\n- `Tab`: Toggle between search mode and frequent directories view\n- `↑/↓`: Navigate through results\n- `PgUp/PgDn`: Fast navigation (10 items at a time)\n- `Home/End`: Jump to first/last result\n- `Enter`: Select directory and change to it\n- `Shift+Delete`: Reset frequency count for selected directory\n- `Esc`: Quit without changing directory\n\n**Search Mode:**\n- Type to search directories using the locate database\n- Results sorted by frequency, then by path length\n\n**Frequent Mode:**\n- Press `Tab` to view your most frequently used directories\n- Shows directories sorted by usage count (most used first)\n- Press `Tab` again to return to search mode\n\n\n### Direct Search\n```bash\n# Change to best match for \"proj\"\nccd proj\n\n# Show help\nccd --help\n```\n\n## How it works\n\n### Frequency Tracking\n- Each time you select a directory in the TUI, its usage count is incremented\n- If you feel lucky via `ccd \u003csearch\u003e`, the count is _not_ incremented. This is to avoid tracking poor matches.\n- Frequently used directories appear at the top of search results\n- You can reset frequency counts using the `Shift+Delete` key in interactive mode\n- Frequency data is stored in `~/.ccd_frequency`\n\n### Search Process\n1. The `ccd-pick` binary searches the locate database using `locate --limit 100 \u003cpattern\u003e`\n2. Filters results to show only directories\n3. Loads frequency data from `~/.ccd_frequency`\n4. Sorts results by usage frequency (most used first), then by path length\n5. In direct mode: changes to the first directory found\n6. In interactive mode: presents a TUI for selection\n\n\n### Shell Integration\nThe tool uses a shell function wrapper (`ccd`) that calls the Rust binary (`ccd-pick`) and properly changes the current shell's directory. The binary outputs the target directory path, and the shell function captures this and executes `cd`.\n\n## Examples\n\n### Interactive Mode\n```bash\n$ ccd\n# Opens TUI interface - type \"proj\" to search\n# Use arrow keys to navigate, Enter to select\n```\n\n### Direct Mode\n```bash\n$ ccd tmp\nChanged to: /tmp\n\n$ ccd nonexistent\nSearching for directories matching: nonexistent\nNo directories found matching 'nonexistent'\n```\n\n## Requirements\n\n- **Rust** (for building the binary)\n- **locate** command (usually part of `plocate` package)\n- **Updated locate database** (`sudo updatedb`)\n- **Bash** (for the shell wrapper)\n\n## Project Structure\n\n- `src/main.rs` - Main Rust application (`ccd-pick` binary)\n- `ccd.sh` - Shell wrapper function (compiled into binary)\n- `build.rs` - Build script for compiling shell function\n- `Cargo.toml` - Rust project configuration\n\n## Development\n\n### Building\n```bash\n# Debug build\ncargo build\n\n# Release build\ncargo build --release\n\n# Install to ~/.cargo/bin\ncargo install --path . --locked\n```\n\n## Contributing\n\nSee [AGENTS.md](AGENTS.md) for contribution guidelines. We welcome contributions from both humans and AI assistants!\n\n## License\n\nThis project is open source. Please see the license file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermacommons%2Fccd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpermacommons%2Fccd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermacommons%2Fccd/lists"}