Skip to content

Repository files navigation

tmpc

tc is a Rust CLI that unifies two daily workflows:

  1. Snippet copy: type tc copy <snippet> (alias tc c) to stream any markdown snippet under ~/.config/tmpc/commands/ into your clipboard.
  2. Context orchestration: type tc touch <key> (alias tc t) to create context files in your project with clipboard content, and tc cat <key> (alias tc ct) to view their contents.

tc runs on macOS and Linux.

Storage layout

~/.config/tmpc/
  commands/
    w/wc.md
    sdd/sdd-0-rq.md
    ... (any nested directory structure)
  • Snippet lookup scans commands/ recursively for .md files. Both tc c wc and tc c w/wc resolve to commands/w/wc.md.
  • tc which (alias: tc wh) prints the absolute commands root path. tc which <snippet> prints the absolute path for the resolved snippet file.

Architecture

The crate is organized by explicit ownership boundaries:

  • src/cli/: clap parsing, terminal output, and process-facing behavior.
  • src/app/: use-case orchestration modules at the app root (list, copy, which, touch, cat, clean).
  • src/snippets/: snippet models, lookup contracts, and filesystem catalog implementation.
  • src/context_files/: context alias/path resolution and context lifecycle storage.
  • src/clipboard/: clipboard contract and system/file implementations.
  • src/project_fs/: safe path validation and project-root filesystem concerns.
  • src/error.rs: shared application error boundary.

Documentation

  • CLI usage: Learn how to use the CLI, manage context aliases, and work with dynamic paths.
  • Configuration: Environment variables and other ways to configure tc.
  • Development guide: Instructions for setting up the development environment, running tests, and contributing.

About

Streamlines snippets and context files

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages