Skip to main content

A CLI tool for managing shared context files across projects

Project description

Context File Manager (CFM)

A command-line tool for managing shared context files across projects. CFM provides a centralized repository for storing, organizing, and retrieving commonly used files with descriptions and tags.

Features

  • Centralized Storage: Store commonly used files in a single repository (~/.context-files by default)
  • File Organization: Add descriptions and tags to files for easy searching and filtering
  • Quick Retrieval: Copy files from the repository to any project location
  • Search Capabilities: Find files by name, description, or tags
  • Multiple Output Formats: View file listings in table, JSON, or simple format

Installation

From PyPI (Recommended)

pip install context-file-manager

From Source

Clone the repository and install in development mode:

git clone https://github.com/ananddtyagi/context-file-manager.git
cd context-file-manager
pip install -e .

Manual Installation

Make the script executable and add it to your PATH:

chmod +x cfm
sudo cp cfm /usr/local/bin/

Or create an alias in your shell configuration:

alias cfm='python3 /path/to/context-file-manager/cfm'

Usage

Add a file to the repository

# Add with description
cfm add README.md "Main project documentation"

# Add with description and tags
cfm add config.json "Database configuration" --tags database config production

List files

# List all files
cfm list

# Filter by tag
cfm list --tag database

# Output as JSON
cfm list --format json

Search for files

# Search by filename, description, or tags
cfm search "config"
cfm search "database"

Retrieve a file

# Copy to current directory
cfm get README.md

# Copy to specific location
cfm get config.json ./my-project/

Update file metadata

# Update description
cfm update config.json "Production database configuration"

# Add tags to existing file
cfm tag config.json staging development

Remove a file

cfm remove old-config.json

Custom Repository Location

By default, files are stored in ~/.context-files. You can use a different location:

cfm --repo /path/to/my/repo add file.txt "Description"

File Storage

Files are stored with their original names in the repository directory. If a filename already exists, a numbered suffix is added (e.g., config_1.json, config_2.json).

Metadata is stored in spec.json within the repository, containing:

  • File descriptions
  • Original file paths
  • Tags
  • File sizes
  • Date added

Examples

Managing Configuration Files

# Store various config files
cfm add nginx.conf "Nginx configuration for load balancing" --tags nginx webserver
cfm add docker-compose.yml "Standard Docker setup" --tags docker devops
cfm add .eslintrc.js "JavaScript linting rules" --tags javascript linting

# Find all Docker-related files
cfm list --tag docker

# Get a config for a new project
cfm get docker-compose.yml ./new-project/

Managing Documentation Templates

# Store documentation templates
cfm add README-template.md "Standard README template" --tags documentation template
cfm add API-docs-template.md "API documentation template" --tags documentation api

# Search for documentation
cfm search "template"

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

context_file_manager-0.1.1.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

context_file_manager-0.1.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file context_file_manager-0.1.1.tar.gz.

File metadata

  • Download URL: context_file_manager-0.1.1.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for context_file_manager-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4891eb34c8e6c3c0cade53a0758e47842a4457b12fec2b3dbc5a4a8bdebf8adc
MD5 039cd7762a4c63d8bc91ef214c8f938a
BLAKE2b-256 a5c38b40c0caced51d688e931cd3e83cfde2ff155945c527f847854b26e1a9d7

See more details on using hashes here.

File details

Details for the file context_file_manager-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for context_file_manager-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5d946c44ca6c48e3d0ea4012b94578c1ed54bd54f82712e4f66e0fd9ed58651a
MD5 444daa8851e7d07175049dad4a77d751
BLAKE2b-256 10802ff5d0f7bf43a00ebc0d9d85fbcf60240e77f605bcfc236680414b9baf11

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page